diff --git a/nhf/touhou/yasaka_kanako/onbashira.py b/nhf/touhou/yasaka_kanako/onbashira.py index fcba7ba..c2c631b 100644 --- a/nhf/touhou/yasaka_kanako/onbashira.py +++ b/nhf/touhou/yasaka_kanako/onbashira.py @@ -40,15 +40,48 @@ class Motor(Model): power: float = 30.0 # watts diam_thread: float = 4.0 - diam_body: float = 51.82 - height_body: float = 70.87 - height_shaft: float = 37.85 + diam_body: float = 51.0 + height_body: float = 83.5 + diam_ring: float = 25.93 + height_ring: float = 6.55 + height_shaft: float = 38.1 + # Distance between anchor and the body + dx_anchor: float = 20.2 + height_anchor: float = 10.4 def __post_init__(self): + assert self.diam_ring < self.diam_body + assert self.height_ring < self.height_body + assert self.dx_anchor < self.diam_body / 2 pass - def model(self) -> Cq.Workplane: - pass + def generate(self) -> Cq.Workplane: + result = ( + Cq.Workplane() + .cylinder( + radius=self.diam_body/2, + height=self.height_body - self.height_ring, + centered=(True, True, False) + ) + .faces(">Z") + .cylinder( + radius=self.diam_ring/2, + height=self.height_ring, + centered=(True, True, False) + ) + ) + shaft = Cq.Solid.makeCylinder( + radius=self.diam_thread/2, + height=self.height_shaft, + pnt=(0, 0, self.height_body) + ) + anchor = Cq.Solid.makeCylinder( + radius=self.diam_thread/2, + height=self.height_anchor, + pnt=(0, 0, self.height_body - self.height_ring) + ) + result = result + shaft + anchor.moved(self.dx_anchor, 0, 0) + anchor.moved(-self.dx_anchor, 0, 0) + return result @dataclass