From 39110d0785b7bc654ae18cb6665cfcc8148fb012 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Fri, 19 Jul 2024 18:59:58 -0700 Subject: [PATCH] feat: Adjust shape to be closer to Nue left --- nhf/touhou/houjuu_nue/__init__.py | 4 +++- nhf/touhou/houjuu_nue/joints.py | 4 +++- nhf/touhou/houjuu_nue/wing.py | 7 ++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/nhf/touhou/houjuu_nue/__init__.py b/nhf/touhou/houjuu_nue/__init__.py index 3a414cf..f14ac2e 100644 --- a/nhf/touhou/houjuu_nue/__init__.py +++ b/nhf/touhou/houjuu_nue/__init__.py @@ -38,6 +38,7 @@ import nhf.touhou.houjuu_nue.wing as MW import nhf.touhou.houjuu_nue.trident as MT import nhf.touhou.houjuu_nue.joints as MJ import nhf.touhou.houjuu_nue.harness as MH +from nhf.parts.item import Item import nhf.utils @dataclass @@ -61,7 +62,7 @@ class Parameters(Model): )) wing_l1: MW.WingL = field(default_factory=lambda: MW.WingL( name="l1", - wrist_angle=-45.0, + wrist_angle=-60.0, )) wing_l2: MW.WingL = field(default_factory=lambda: MW.WingL( name="l2", @@ -147,6 +148,7 @@ class Parameters(Model): "wing-depth": bbox.ylen, "wing-height": bbox.zlen, "wing-mass": a.total_mass(), + "items": Item.count(a), } diff --git a/nhf/touhou/houjuu_nue/joints.py b/nhf/touhou/houjuu_nue/joints.py index 57e80c9..e5aa154 100644 --- a/nhf/touhou/houjuu_nue/joints.py +++ b/nhf/touhou/houjuu_nue/joints.py @@ -215,7 +215,7 @@ class ShoulderJoint(Model): mass=float('nan'), ) - height: float = 60.0 + height: float = 70.0 torsion_joint: TorsionJoint = field(default_factory=lambda: TorsionJoint( radius_track=18, radius_rider=18, @@ -271,6 +271,7 @@ class ShoulderJoint(Model): directrix_id: int = 0 angle_neutral: float = 10.0 + angle_max_deflection: float = 80.0 def __post_init__(self): assert self.parent_lip_length * 2 < self.height @@ -440,6 +441,7 @@ class ShoulderJoint(Model): @assembly() def assembly(self, fastener_pos: float = 0.0, deflection: float = 0) -> Cq.Assembly: + assert deflection <= self.angle_max_deflection directrix = self.directrix_id mat = Material.RESIN_TRANSPERENT mat_spring = Material.STEEL_SPRING diff --git a/nhf/touhou/houjuu_nue/wing.py b/nhf/touhou/houjuu_nue/wing.py index c5bd232..6d9780b 100644 --- a/nhf/touhou/houjuu_nue/wing.py +++ b/nhf/touhou/houjuu_nue/wing.py @@ -615,9 +615,10 @@ class WingProfile(Model): .constrain("s0/base?conn2", "root/child?conn2", "Plane", param=0) ) if "shoulder" in parts: + angle = shoulder_deflection * self.shoulder_joint.angle_max_deflection result.add(self.shoulder_joint.assembly( fastener_pos=fastener_pos, - deflection=shoulder_deflection * 80), name="shoulder") + deflection=angle), name="shoulder") if "s0" in parts and "shoulder" in parts: ( result @@ -805,11 +806,11 @@ class WingR(WingProfile): @dataclass(kw_only=True) class WingL(WingProfile): - elbow_bot_loc: Cq.Location = Cq.Location.from2d(250.0, 110.0, 10.0) + elbow_bot_loc: Cq.Location = Cq.Location.from2d(260.0, 110.0, 0.0) elbow_height: float = 80.0 wrist_angle: float = -45.0 - wrist_bot_loc: Cq.Location = Cq.Location.from2d(480.0, 0.0, -45.0) + wrist_bot_loc: Cq.Location = Cq.Location.from2d(460.0, -10.0, -45.0) wrist_height: float = 43.0 shoulder_bezier_ext: float = 120.0