Front chamber separator

This commit is contained in:
Leni Aniva 2025-05-30 14:35:55 -07:00
parent e4cfc71f1a
commit a0100f8fb7
Signed by: aniva
GPG Key ID: D5F96287843E8DFB
2 changed files with 69 additions and 6 deletions

View File

@ -144,6 +144,7 @@ class BatteryBox18650(Item):
centered=(True, True, False),
combine=True,
)
.copyWorkplane(Cq.Workplane('XY'))
)
hole = Cq.Solid.makeCylinder(
radius=self.diam_thread/2,

View File

@ -318,10 +318,10 @@ class Onbashira(Model):
controller: ArduinoUnoR3 = ArduinoUnoR3()
controller_loc: Cq.Location = Cq.Location.from2d(-30, -35, 90)
battery_box_locs: list[Cq.Location] = field(default_factory=lambda: [
Cq.Location.from2d(70, -35, 90),
Cq.Location.from2d(140, -35, 90),
Cq.Location.from2d(-70, -35, 90),
Cq.Location.from2d(-140, -35, 90),
Cq.Location.from2d(70, 0, 90),
Cq.Location.from2d(140, 0, 90),
Cq.Location.from2d(-70, 0, 90),
Cq.Location.from2d(-140, 0, 90),
])
# Distance between bind point and motor's mount points
@ -1612,12 +1612,17 @@ class Onbashira(Model):
@target(name="chamber-back", kind=TargetKind.DXF)
def profile_chamber_back(self) -> Cq.Sketch:
shift = 180 / self.n_side
return (
Cq.Sketch()
.regularPolygon(self.side_width - self.side_thickness, self.n_side)
.regularPolygon(
self.side_width - self.side_thickness,
self.n_side,
angle=shift)
.reset()
.regularPolygon(
self.angle_joint_bind_radius, self.n_side,
angle=shift,
mode="c", tag="bolt")
.vertices(tag="bolt")
.circle(self.rotor_bind_bolt_diam/2, mode="s")
@ -1631,7 +1636,7 @@ class Onbashira(Model):
)
# Mark all attachment points
for i in range(self.n_side):
angle = (i+0.5) * math.radians(360 / self.n_side)
angle = i * math.radians(360 / self.n_side)
x = self.angle_joint_bind_radius * math.cos(angle)
y = self.angle_joint_bind_radius * math.sin(angle)
result.tagAbsolute(f"holeF{i}", (x, y, self.side_thickness), direction="+Z")
@ -1652,6 +1657,38 @@ class Onbashira(Model):
)
return a
@target(name="chamber-front", kind=TargetKind.DXF)
def profile_chamber_front(self) -> Cq.Sketch:
"""
Front chamber must allow access to the electronics section
"""
l = self.side_width
h = self.side_width
h2 = 15
return (
self.profile_chamber_back()
.reset()
.rect(l, h, mode="s")
.reset()
.push([(0, h/2 + h2)])
.rect(l/2, h2, mode="s")
)
def chamber_front(self) -> Cq.Sketch:
sketch = self.profile_chamber_front()
result = (
Cq.Workplane()
.placeSketch(sketch)
.extrude(self.side_thickness)
)
# Mark all attachment points
for i in range(self.n_side):
angle = i * math.radians(360 / self.n_side)
x = self.angle_joint_bind_radius * math.cos(angle)
y = self.angle_joint_bind_radius * math.sin(angle)
result.tagAbsolute(f"holeF{i}", (x, y, self.side_thickness), direction="+Z")
result.tagAbsolute(f"holeB{i}", (x, -y, 0), direction="-Z")
return result
def angle_joint_flange(self) -> Cq.Workplane:
th = math.pi / self.n_side
r = self.bulk_radius
@ -2230,6 +2267,13 @@ class Onbashira(Model):
material=self.material_side,
role=Role.STRUCTURE | Role.DECORATION,
)
if has_part(parts, "chamber_front"):
a = a.addS(
self.chamber_front(),
name="chamber_front",
material=self.material_side,
role=Role.STRUCTURE | Role.DECORATION,
)
if has_part(parts, "motor"):
a = a.add(self.assembly_motor(), name="motor")
if has_part(parts, "machine"):
@ -2309,6 +2353,19 @@ class Onbashira(Model):
f"{name_bolt}?root",
"Plane",
)
name_bolt =f"chamber_front{i}boltFPI{i}"
a = a.addS(
BOLT_COMMON.generate(),
name=name_bolt,
material=self.material_fastener,
role=Role.CONNECTION,
)
a = a.constrain(
f"chamber_front?holeF{i}",
f"{name_bolt}?root",
"Plane",
)
for ih in range(len(self.angle_joint_bolt_position)):
a = a.constrain(
f"chamber/side{i}?holeFPI{ih}",
@ -2325,6 +2382,11 @@ class Onbashira(Model):
f"chamber_back?holeB{i}",
"Plane",
)
a = a.constrain(
f"ring3/side{i}?holeStatorR",
f"chamber_front?holeB{i}",
"Plane",
)
#a = a.constrain(
# f"barrel/stator2?holeB{i}",