From 40ebf93dc5a77ec9f351582a53834ce2c2df3d36 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Fri, 2 Aug 2024 00:28:12 -0700 Subject: [PATCH] feat: Simplify geometry in electronic mount --- nhf/touhou/houjuu_nue/electronics.py | 10 +++++----- nhf/touhou/houjuu_nue/wing.py | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/nhf/touhou/houjuu_nue/electronics.py b/nhf/touhou/houjuu_nue/electronics.py index da980db..8d8120d 100644 --- a/nhf/touhou/houjuu_nue/electronics.py +++ b/nhf/touhou/houjuu_nue/electronics.py @@ -493,10 +493,10 @@ class ElectronicBoard(Model): length: float = 70.0 width: float = 170.0 mount_holes: list[Hole] = field(default_factory=lambda: [ - Hole(x=25, y=70), - Hole(x=25, y=-70), - Hole(x=-25, y=70), - Hole(x=-25, y=-70), + Hole(x=25, y=75), + Hole(x=25, y=-75), + Hole(x=-25, y=75), + Hole(x=-25, y=-75), ]) panel_thickness: float = 25.4 / 16 mount_panel_thickness: float = 25.4 / 4 @@ -526,7 +526,7 @@ class ElectronicBoard(Model): result = ( Cq.Assembly() .addS(panel.generate(), name="panel", - role=Role.STRUCTURE, material=self.material) + role=Role.ELECTRONIC | Role.STRUCTURE, material=self.material) ) for hole in panel.holes: spacer_name = f"{hole.tag}_spacer" diff --git a/nhf/touhou/houjuu_nue/wing.py b/nhf/touhou/houjuu_nue/wing.py index e0fbb20..3a3ff62 100644 --- a/nhf/touhou/houjuu_nue/wing.py +++ b/nhf/touhou/houjuu_nue/wing.py @@ -351,6 +351,12 @@ class WingProfile(Model): Hole(x=h.x, y=h.y, face=face, tag=h.tag) for h in self.electronic_board.mount_holes ] + def post(sketch: Cq.Sketch) -> Cq.Sketch: + return ( + sketch + .push([(0,0)]) + .rect(70, 130, mode='s') + ) return MountingBox( holes=holes, hole_diam=self.electronic_board.mount_hole_diam, @@ -360,6 +366,7 @@ class WingProfile(Model): thickness=self.spacer_thickness, flip_y=False,#self.flip, generate_reverse_tags=True, + profile_callback=post, ) @submodel(name="spacer-s0-shoulder-act") def spacer_s0_shoulder_act(self) -> MountingBox: