From 33e32aa14b4144533e1b2f3145e9777e5ffbf987 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Thu, 25 Jul 2024 12:35:36 -0700 Subject: [PATCH] fix: Left side wrist joint --- nhf/parts/box.py | 6 +++++- nhf/touhou/houjuu_nue/wing.py | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/nhf/parts/box.py b/nhf/parts/box.py index 9aac091..ebd5d63 100644 --- a/nhf/parts/box.py +++ b/nhf/parts/box.py @@ -1,6 +1,6 @@ import cadquery as Cq from dataclasses import dataclass, field -from typing import Tuple, Optional, Union +from typing import Tuple, Optional, Union, Callable from nhf.build import Model, TargetKind, target import nhf.utils @@ -64,6 +64,8 @@ class MountingBox(Model): # Determines the position of side tags flip_y: bool = False + profile_callback: Optional[Callable[[Cq.Sketch], Cq.Sketch]] = None + def __post_init__(self): for i, hole in enumerate(self.holes): if hole.tag is None: @@ -84,6 +86,8 @@ class MountingBox(Model): for hole in self.holes: diam = hole.diam if hole.diam else self.hole_diam result.push([(hole.x, hole.y)]).circle(diam / 2, mode='s') + if self.profile_callback: + profile = self.profile_callback(profile) return result def generate(self) -> Cq.Workplane: diff --git a/nhf/touhou/houjuu_nue/wing.py b/nhf/touhou/houjuu_nue/wing.py index ec9f4f1..acd0bd4 100644 --- a/nhf/touhou/houjuu_nue/wing.py +++ b/nhf/touhou/houjuu_nue/wing.py @@ -33,7 +33,6 @@ WRIST_PARAMS = dict( radius_disk=13.0, radius_housing=15.0, ), - actuator=LINEAR_ACTUATOR_21, ) @dataclass(kw_only=True) @@ -1107,6 +1106,7 @@ class WingR(WingProfile): flexor_mount_angle_child=-40, hole_pos=[10, 20], lip_length=50, + actuator=LINEAR_ACTUATOR_21, #flexor_pos_smaller=False, **WRIST_PARAMS )) @@ -1363,8 +1363,11 @@ class WingL(WingProfile): lip_length=30, child_arm_radius=23.0, parent_arm_radius=30.0, - flexor_offset_angle=30.0, + flexor_offset_angle=0.0, flexor_child_arm_radius=None, + flexor_line_length=50.0, + flexor_line_slack=1.0, + actuator=LINEAR_ACTUATOR_10, **WRIST_PARAMS ))