feat: Truncate inner panel to avoid collision

This commit is contained in:
Leni Aniva 2024-08-04 14:32:10 -07:00
parent c4a5f5770f
commit 556a35392d
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
1 changed files with 17 additions and 4 deletions

View File

@ -59,6 +59,7 @@ class WingProfile(Model):
# strength
spacer_thickness: float = 25.4 / 4
rod_width: float = 10.0
panel_s0_inner_trunc = 0.05
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
"""
@ -203,9 +204,21 @@ class WingProfile(Model):
(-self.base_width + dx1, dy1),
(-self.base_width, 0),
]
return Cq.Edge.makeBezier(
bezier = Cq.Edge.makeBezier(
[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
@ -266,7 +279,7 @@ class WingProfile(Model):
return result
def inner_shell_s0(self) -> Cq.Workplane:
t = self.panel_thickness_s0
profile = self.inner_profile_s0()
profile = self.inner_profile_s0(trunc=self.panel_s0_inner_trunc)
result = (
Cq.Workplane('XZ')
.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.
"""
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
return Cq.Sketch().rect(length, height)