From c8bbc0de91cee4c8304b873881892586cb467864 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Fri, 30 May 2025 22:31:08 -0700 Subject: [PATCH] Magnet holder --- nhf/touhou/yasaka_kanako/onbashira.py | 43 +++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/nhf/touhou/yasaka_kanako/onbashira.py b/nhf/touhou/yasaka_kanako/onbashira.py index bb0b797..2032b52 100644 --- a/nhf/touhou/yasaka_kanako/onbashira.py +++ b/nhf/touhou/yasaka_kanako/onbashira.py @@ -82,7 +82,7 @@ class FlangeCoupler(Model): diam_thread_flange: float = 4.0 n_hole_flange: int = 4 - r_hole_flange: float = 8.0 # FIXME: Measure! + r_hole_flange: float = 12.0 # FIXME: Measure! def generate(self) -> Cq.Workplane: result = ( @@ -237,6 +237,8 @@ class Onbashira(Model): section1_gohei_loc: float = 30.0 gohei_bolt_diam: float = 6.0 + magnet_size: float = 6.0 + # The angle joint bridges between two sets of side panels. # Extra thickness beyond the onbashira's body @@ -434,6 +436,41 @@ class Onbashira(Model): .extrude(self.side_width * 1.5) ) + @target(name="magnet-holder") + def magnet_holder(self) -> Cq.Workplane: + magnet_size = self.magnet_size + gap = 1.0 + length1 = 10.0 + width = magnet_size * 3 + height = gap + magnet_size + 1 + result = ( + Cq.Workplane() + .box( + length=length1 + magnet_size, + width=width, + height=height, + centered=(False, True, False) + ) + ) + corner_cut = Cq.Solid.makeBox( + length=height, + width=width, + height=height, + ).moved(0, -width/2, 0) - Cq.Solid.makeCylinder( + radius=height, + height=width, + pnt=(height, -width/2, 0), + dir=(0, 1, 0) + ) + box_cut = Cq.Solid.makeBox( + length=magnet_size, + width=magnet_size, + height=magnet_size + gap, + ).moved(length1, -magnet_size/2, 0) + return result - box_cut - corner_cut + + ### Motor ### + @target(name="motor-coupler") def motor_coupler(self) -> Cq.Workplane: """ @@ -777,8 +814,8 @@ class Onbashira(Model): ) hole = Cq.Solid.makeCylinder( radius=(BOLT_BEARING.diam_thread + self.bearing_spindle_gap)/2, - height=h*2 - ).moved(0, 0, -h) + height=h*4 + ).moved(0, 0, -h*2) top = cone + cyl - hole return top + top.mirror("XY")