mirror of
https://github.com/johndoe6345789/bamboogenerator.git
synced 2026-04-24 13:24:54 +00:00
Add return type hints to Primitive methods
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user