Mirror wing geometry

This commit is contained in:
Leni Aniva 2025-05-13 17:20:51 -07:00
parent a684996475
commit 22a4f4ceec
Signed by: aniva
GPG Key ID: D5F96287843E8DFB
2 changed files with 35 additions and 32 deletions

View File

@ -3,6 +3,9 @@
This is the design repository for NorCal Hakkero Factory No. 1, where we use
parametric CAD to make cosplay props.
> NorCal Hakkero Factory № 1
> 北加国営八卦炉第一工場
## Development
Most cosplay schematics are created with Blender, CadQuery, and Inkscape. To

View File

@ -21,7 +21,7 @@ class Mirror(Model):
outer_gap: float = 3.0
core_thickness: float = 25.4 / 8
casing_thickness: float = 25.4 / 16
casing_thickness: float = 25.4 / 8
flange_r0: float = 5.0
flange_r1: float = 15.0
@ -61,36 +61,7 @@ class Mirror(Model):
"""
Base of the casing with no holes carved out
"""
return (
Cq.Sketch()
.ellipse(self.width/2, self.height/2)
)
def casing_bot(self) -> Cq.Workplane:
return (
Cq.Workplane()
.placeSketch(self.profile_casing_bot())
.extrude(self.casing_thickness)
)
def profile_wing(self, sign: float=1) -> Cq.Sketch:
xt = self.width / 2 - self.outer_gap
return (
Cq.Sketch()
.polygon([
(sign*xt, self.wing_r1),
(sign*(xt+self.wing_x1), self.wing_r1),
(sign*(xt+self.wing_x1), self.wing_r2),
(sign*(xt+self.wing_x2), self.wing_r2),
(sign*(xt+self.wing_x2), -self.wing_r2),
(sign*(xt+self.wing_x1), -self.wing_r2),
(sign*(xt+self.wing_x1), -self.wing_r1),
(sign*xt, -self.wing_r1),
])
)
@target(name="casing-mid", kind=TargetKind.DXF)
def profile_casing_mid(self) -> Cq.Sketch:
yt = self.height / 2 - self.outer_gap
rx = self.width/2 - self.outer_gap
ry = self.height/2 - self.outer_gap
yh = (self.flange_y1 + self.flange_y2) / 2
flange = (
Cq.Sketch()
@ -124,13 +95,42 @@ class Mirror(Model):
])
)
return (
self.profile_casing_bot()
.ellipse(rx, ry, mode="s")
Cq.Sketch()
.ellipse(self.width/2, self.height/2)
.boolean(flange, mode="a")
.boolean(tail, mode="a")
.boolean(self.profile_wing(-1), mode="a")
.boolean(self.profile_wing(1), mode="a")
)
def casing_bot(self) -> Cq.Workplane:
return (
Cq.Workplane()
.placeSketch(self.profile_casing_bot())
.extrude(self.casing_thickness)
)
def profile_wing(self, sign: float=1) -> Cq.Sketch:
xt = self.width / 2 - self.outer_gap
return (
Cq.Sketch()
.polygon([
(sign*xt, self.wing_r1),
(sign*(xt+self.wing_x1), self.wing_r1),
(sign*(xt+self.wing_x1), self.wing_r2),
(sign*(xt+self.wing_x2), self.wing_r2),
(sign*(xt+self.wing_x2), -self.wing_r2),
(sign*(xt+self.wing_x1), -self.wing_r2),
(sign*(xt+self.wing_x1), -self.wing_r1),
(sign*xt, -self.wing_r1),
])
)
@target(name="casing-mid", kind=TargetKind.DXF)
def profile_casing_mid(self) -> Cq.Sketch:
rx = self.width/2 - self.outer_gap
ry = self.height/2 - self.outer_gap
return (
self.profile_casing_bot()
.ellipse(rx, ry, mode="s")
)
def casing_mid(self) -> Cq.Workplane:
return (
Cq.Workplane()