feat: Add deflection parameter to assembly
This commit is contained in:
parent
052575017a
commit
0ed1a1a5a4
|
@ -117,19 +117,21 @@ class Parameters(Model):
|
|||
return self.wing_l3
|
||||
|
||||
@assembly()
|
||||
def wings_harness_assembly(self, parts: Optional[list[str]] = None) -> Cq.Assembly:
|
||||
def wings_harness_assembly(self,
|
||||
parts: Optional[list[str]] = None,
|
||||
**kwargs) -> Cq.Assembly:
|
||||
"""
|
||||
Assembly of harness with all the wings
|
||||
"""
|
||||
result = (
|
||||
Cq.Assembly()
|
||||
.add(self.harness.assembly(), name="harness", loc=Cq.Location((0, 0, 0)))
|
||||
.add(self.wing_r1.assembly(parts), name="wing_r1")
|
||||
.add(self.wing_r2.assembly(parts), name="wing_r2")
|
||||
.add(self.wing_r3.assembly(parts), name="wing_r3")
|
||||
.add(self.wing_l1.assembly(parts), name="wing_l1")
|
||||
.add(self.wing_l2.assembly(parts), name="wing_l2")
|
||||
.add(self.wing_l3.assembly(parts), name="wing_l3")
|
||||
.add(self.wing_r1.assembly(parts, **kwargs), name="wing_r1")
|
||||
.add(self.wing_r2.assembly(parts, **kwargs), name="wing_r2")
|
||||
.add(self.wing_r3.assembly(parts, **kwargs), name="wing_r3")
|
||||
.add(self.wing_l1.assembly(parts, **kwargs), name="wing_l1")
|
||||
.add(self.wing_l2.assembly(parts, **kwargs), name="wing_l2")
|
||||
.add(self.wing_l3.assembly(parts, **kwargs), name="wing_l3")
|
||||
)
|
||||
for tag, offset in [("r1", 9), ("r2", 7), ("r3", 6), ("l1", 7), ("l2", 8), ("l3", 9)]:
|
||||
self.harness.hs_hirth_joint.add_constraints(
|
||||
|
|
|
@ -622,7 +622,8 @@ class WingProfile(Model):
|
|||
@assembly()
|
||||
def assembly(self,
|
||||
parts: Optional[list[str]] = None,
|
||||
angle_elbow_wrist: float = 0.0,
|
||||
shoulder_deflection: float = 0.0,
|
||||
elbow_wrist_deflection: float = 0.0,
|
||||
) -> Cq.Assembly():
|
||||
if parts is None:
|
||||
parts = ["s0", "shoulder", "s1", "elbow", "s2", "wrist", "s3"]
|
||||
|
@ -636,7 +637,7 @@ class WingProfile(Model):
|
|||
if "s0" in parts:
|
||||
result.add(self.assembly_s0(), name="s0")
|
||||
if "shoulder" in parts:
|
||||
result.add(self.shoulder_joint.assembly(), name="shoulder")
|
||||
result.add(self.shoulder_joint.assembly(deflection=shoulder_deflection * 80), name="shoulder")
|
||||
if "s0" in parts and "shoulder" in parts:
|
||||
(
|
||||
result
|
||||
|
@ -656,7 +657,8 @@ class WingProfile(Model):
|
|||
.constrain("s1/shoulder_bot?conn1", f"shoulder/child/lip_{tag_bot}?conn1", "Plane")
|
||||
)
|
||||
if "elbow" in parts:
|
||||
result.add(self.elbow_joint.assembly(angle=angle_elbow_wrist), name="elbow")
|
||||
angle = self.elbow_joint.disk_joint.movement_angle * elbow_wrist_deflection
|
||||
result.add(self.elbow_joint.assembly(angle=angle), name="elbow")
|
||||
if "s1" in parts and "elbow" in parts:
|
||||
(
|
||||
result
|
||||
|
@ -676,7 +678,8 @@ class WingProfile(Model):
|
|||
.constrain("s2/elbow_bot?conn1", "elbow/child/lip?conn_bot1", "Plane")
|
||||
)
|
||||
if "wrist" in parts:
|
||||
result.add(self.wrist_joint.assembly(angle=angle_elbow_wrist), name="wrist")
|
||||
angle = self.wrist_joint.disk_joint.movement_angle * elbow_wrist_deflection
|
||||
result.add(self.wrist_joint.assembly(angle=elbow_wrist_deflection), name="wrist")
|
||||
if "s2" in parts and "wrist" in parts:
|
||||
# Mounted backwards to bend in other direction
|
||||
(
|
||||
|
|
Loading…
Reference in New Issue