cosplay: Touhou/Houjuu Nue #4

Open
aniva wants to merge 189 commits from touhou/houjuu-nue into main
1 changed files with 17 additions and 4 deletions
Showing only changes of commit 556a35392d - Show all commits

View File

@ -59,6 +59,7 @@ class WingProfile(Model):
# strength # strength
spacer_thickness: float = 25.4 / 4 spacer_thickness: float = 25.4 / 4
rod_width: float = 10.0 rod_width: float = 10.0
panel_s0_inner_trunc = 0.05
light_strip: LightStrip = LightStrip() light_strip: LightStrip = LightStrip()
@ -186,7 +187,7 @@ class WingProfile(Model):
] ]
] ]
) )
def inner_profile_s0(self) -> Cq.Edge: def inner_profile_s0(self, trunc: float=0.0) -> Cq.Edge:
""" """
The inner boundary of s0 The inner boundary of s0
""" """
@ -203,9 +204,21 @@ class WingProfile(Model):
(-self.base_width + dx1, dy1), (-self.base_width + dx1, dy1),
(-self.base_width, 0), (-self.base_width, 0),
] ]
return Cq.Edge.makeBezier( bezier = Cq.Edge.makeBezier(
[Cq.Vector(x, y) for x, y in points] [Cq.Vector(x, y) for x, y in points]
) )
if trunc == 0.0:
return bezier
tip = bezier.positionAt(d=trunc, mode='parameter')
tangent = bezier.tangentAt(locationParam=trunc, mode='parameter')
points = [
tip,
tip + tangent,
Cq.Vector(-self.base_width + dx1, dy1),
Cq.Vector(-self.base_width, 0),
]
return Cq.Edge.makeBezier(points)
@property @property
@ -266,7 +279,7 @@ class WingProfile(Model):
return result return result
def inner_shell_s0(self) -> Cq.Workplane: def inner_shell_s0(self) -> Cq.Workplane:
t = self.panel_thickness_s0 t = self.panel_thickness_s0
profile = self.inner_profile_s0() profile = self.inner_profile_s0(trunc=self.panel_s0_inner_trunc)
result = ( result = (
Cq.Workplane('XZ') Cq.Workplane('XZ')
.moveTo(-t, 0) .moveTo(-t, 0)
@ -291,7 +304,7 @@ class WingProfile(Model):
""" """
This part should be laser cut and then bent on a falsework to create the required shape. This part should be laser cut and then bent on a falsework to create the required shape.
""" """
length = self.inner_profile_s0().Length() length = self.inner_profile_s0(trunc=self.panel_s0_inner_trunc).Length()
height = self.root_height + self.panel_thickness_s0 * 2 height = self.root_height + self.panel_thickness_s0 * 2
return Cq.Sketch().rect(length, height) return Cq.Sketch().rect(length, height)