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