Make all angle joints flanged

This commit is contained in:
Leni Aniva 2025-05-16 07:15:30 -07:00
parent c5f9e570a6
commit bd7e8677c7
Signed by: aniva
GPG Key ID: D5F96287843E8DFB
1 changed files with 28 additions and 31 deletions

View File

@ -846,7 +846,7 @@ class Onbashira(Model):
return result
@target(name="angle-joint")
def angle_joint(self) -> Cq.Workplane:
def angle_joint(self, add_flange=True) -> Cq.Workplane:
"""
Angular joint between two side panels (excluding chamber). This sits at the intersection of
4 side panels to provide compressive, shear, and tensile strength.
@ -961,36 +961,33 @@ class Onbashira(Model):
result.tagAbsolute(f"holeRSO{i}", locrot * Cq.Location(dr, -x, -py), direction="+X")
result.tagAbsolute(f"holeLSM{i}", locrot * Cq.Location(dr0, -x, py), direction="-X")
result.tagAbsolute(f"holeRSM{i}", locrot * Cq.Location(dr0, -x, -py), direction="-X")
return result
@target(name="angle-joint-flanged")
def angle_joint_flanged(self) -> Cq.Workplane:
result = self.angle_joint()
th = math.pi / self.n_side
r = self.bulk_radius
flange = (
Cq.Workplane()
.sketch()
.push([
(r, r * math.tan(th))
])
.circle(self.angle_joint_flange_radius)
.reset()
.regularPolygon(self.side_width_inner, self.n_side, mode="i")
.finalize()
.extrude(self.angle_joint_flange_thickness)
.translate((0, 0, -self.angle_joint_flange_thickness/2))
)
ri = self.stator_bind_radius
h = self.angle_joint_flange_thickness
cyl = Cq.Solid.makeCylinder(
radius=self.rotor_bind_bolt_diam/2,
height=h,
pnt=(ri * math.cos(th), ri * math.sin(th), -h/2),
)
result = result + flange - cyl
result.tagAbsolute("holeStatorL", (ri * math.cos(th), ri * math.sin(th), h/2), direction="+Z")
result.tagAbsolute("holeStatorR", (ri * math.cos(th), ri * math.sin(th), -h/2), direction="-Z")
if add_flange:
th = math.pi / self.n_side
r = self.bulk_radius
flange = (
Cq.Workplane()
.sketch()
.push([
(r, r * math.tan(th))
])
.circle(self.angle_joint_flange_radius)
.reset()
.regularPolygon(self.side_width_inner, self.n_side, mode="i")
.finalize()
.extrude(self.angle_joint_flange_thickness)
.translate((0, 0, -self.angle_joint_flange_thickness/2))
)
ri = self.stator_bind_radius
h = self.angle_joint_flange_thickness
cyl = Cq.Solid.makeCylinder(
radius=self.rotor_bind_bolt_diam/2,
height=h,
pnt=(ri * math.cos(th), ri * math.sin(th), -h/2),
)
result = result + flange - cyl
result.tagAbsolute("holeStatorL", (ri * math.cos(th), ri * math.sin(th), h/2), direction="+Z")
result.tagAbsolute("holeStatorR", (ri * math.cos(th), ri * math.sin(th), -h/2), direction="-Z")
return result
def assembly_ring(self, base) -> Cq.Assembly:
@ -1016,7 +1013,7 @@ class Onbashira(Model):
name="section1",
)
.add(
self.assembly_ring(self.angle_joint_flanged()),
self.assembly_ring(self.angle_joint()),
name="ring1",
)
.add(