fix: Tag points on wing

This commit is contained in:
Leni Aniva 2024-07-17 12:11:08 -07:00
parent 21e5ad0b82
commit 348799c46e
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
1 changed files with 22 additions and 18 deletions

View File

@ -62,6 +62,8 @@ class WingProfile(Model):
radius_disk=13.0,
radius_housing=15.0,
),
child_arm_radius=20.0,
parent_arm_radius=30.0,
))
# Distance between the two spacers on the elbow, halved
wrist_h2: float = 5.0
@ -464,7 +466,8 @@ class WingProfile(Model):
]
profile = self.profile_s1()
tags = tags_shoulder + tags_elbow
return nhf.utils.extrude_with_markers(profile, self.panel_thickness, tags, reverse=front)
return nhf.utils.extrude_with_markers(
profile, self.panel_thickness, tags, reverse=front)
@submodel(name="spacer-s1-shoulder")
def spacer_s1_shoulder(self) -> MountingBox:
holes = [
@ -505,7 +508,7 @@ class WingProfile(Model):
result,
o,
point_tag=t,
flipped=is_top != True #is_parent,
flipped=not is_top,
)
return result.solve()
@ -527,10 +530,10 @@ class WingProfile(Model):
tags_elbow = [
("elbow_bot",
self.elbow_to_abs(elbow_mount_inset, h - self.elbow_h2),
self.elbow_angle),
self.elbow_angle + 180),
("elbow_top",
self.elbow_to_abs(elbow_mount_inset, h + self.elbow_h2),
self.elbow_angle),
self.elbow_angle + 180),
]
h = self.wrist_height / 2
tags_wrist = [
@ -578,8 +581,8 @@ class WingProfile(Model):
result,
o.generate(),
point_tag=t,
flipped=is_top,# != is_parent,
rotate=is_parent,
flipped=is_top == is_parent,
#rotate=True,
)
return result.solve()
@ -598,10 +601,10 @@ class WingProfile(Model):
tags = [
("wrist_bot",
self.wrist_to_abs(wrist_mount_inset, h - self.wrist_h2),
self.wrist_angle),
self.wrist_angle + 180),
("wrist_top",
self.wrist_to_abs(wrist_mount_inset, h + self.wrist_h2),
self.wrist_angle),
self.wrist_angle + 180),
]
profile = self.profile_s3()
return nhf.utils.extrude_with_markers(profile, self.panel_thickness, tags, reverse=front)
@ -632,7 +635,8 @@ class WingProfile(Model):
result,
o.generate(),
point_tag=t,
flipped=is_top != is_parent,
flipped=is_top,# != is_parent,
#rotate=True,
)
return result.solve()
@ -698,20 +702,20 @@ class WingProfile(Model):
# Mounted backwards to bend in other direction
(
result
.constrain("s2/wrist_top?conn0", "wrist/parent_upper/bot?conn0", "Plane")
.constrain("s2/wrist_top?conn1", "wrist/parent_upper/bot?conn1", "Plane")
.constrain("s2/wrist_bot?conn0", "wrist/parent_upper/top?conn0", "Plane")
.constrain("s2/wrist_bot?conn1", "wrist/parent_upper/top?conn1", "Plane")
.constrain("s2/wrist_top?conn0", "wrist/parent_upper/lip?conn_bot0", "Plane")
.constrain("s2/wrist_top?conn1", "wrist/parent_upper/lip?conn_bot1", "Plane")
.constrain("s2/wrist_bot?conn0", "wrist/parent_upper/lip?conn_top0", "Plane")
.constrain("s2/wrist_bot?conn1", "wrist/parent_upper/lip?conn_top1", "Plane")
)
if "s3" in parts:
result.add(self.assembly_s3(), name="s3")
if "s3" in parts and "wrist" in parts:
(
result
.constrain("s3/wrist_top?conn0", "wrist/child/bot?conn0", "Plane")
.constrain("s3/wrist_top?conn1", "wrist/child/bot?conn1", "Plane")
.constrain("s3/wrist_bot?conn0", "wrist/child/top?conn0", "Plane")
.constrain("s3/wrist_bot?conn1", "wrist/child/top?conn1", "Plane")
.constrain("s3/wrist_top?conn0", "wrist/child/lip?conn_bot0", "Plane")
.constrain("s3/wrist_top?conn1", "wrist/child/lip?conn_bot1", "Plane")
.constrain("s3/wrist_bot?conn0", "wrist/child/lip?conn_top0", "Plane")
.constrain("s3/wrist_bot?conn1", "wrist/child/lip?conn_top1", "Plane")
)
if len(parts) > 1:
result.solve()
@ -970,6 +974,6 @@ class WingL(WingProfile):
(self.elbow_x, self.wrist_y),
(self.wrist_x, self.wrist_y),
(self.wrist_top_x, self.wrist_top_y),
(self.elbow_x, self.elbow_top_y + 50),
(self.elbow_x, self.elbow_top_y + l),
(0, l),
]