Magnet holder

This commit is contained in:
Leni Aniva 2025-05-30 22:31:08 -07:00
parent 34ecf59124
commit c8bbc0de91
Signed by: aniva
GPG Key ID: D5F96287843E8DFB
1 changed files with 40 additions and 3 deletions

View File

@ -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")