From d4ffab20363f4cdcccdcd719254c2266713d12d7 Mon Sep 17 00:00:00 2001 From: Richard Ward Date: Fri, 18 Jul 2025 09:12:00 +0100 Subject: [PATCH] Add return type hints to Primitive methods --- parametric_cad/primitives/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parametric_cad/primitives/base.py b/parametric_cad/primitives/base.py index bd9957d..8ad7a00 100644 --- a/parametric_cad/primitives/base.py +++ b/parametric_cad/primitives/base.py @@ -1,4 +1,4 @@ -from typing import Optional, Sequence +from typing import Optional, Sequence, Self from parametric_cad.core import tm @@ -10,12 +10,12 @@ class Primitive: self._position = (0.0, 0.0, 0.0) self._rotation: Optional[tuple[Sequence[float], float]] = None - def at(self, x: float, y: float, z: float): + def at(self, x: float, y: float, z: float) -> Self: """Translate the primitive to ``(x, y, z)``.""" self._position = (x, y, z) return self - def rotate(self, axis: Sequence[float], angle: float): + def rotate(self, axis: Sequence[float], angle: float) -> Self: """Rotate the primitive around ``axis`` by ``angle`` radians.""" self._rotation = (axis, angle) return self