From 621c7d54b6df7ad016d0a017a2d8a53dd2f25eb3 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Tue, 8 Jul 2025 22:48:36 -0700 Subject: [PATCH 1/3] fix: Remove subloc override --- nhf/utils.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/nhf/utils.py b/nhf/utils.py index 1234796..1141422 100644 --- a/nhf/utils.py +++ b/nhf/utils.py @@ -8,30 +8,6 @@ from cadquery.occ_impl.solver import ConstraintSpec from nhf import Role from nhf.materials import KEY_ITEM, KEY_MATERIAL -# Bug fixes -def _subloc(self, name: str) -> Tuple[Cq.Location, str]: - """ - Calculate relative location of an object in a subassembly. - - Returns the relative positions as well as the name of the top assembly. - """ - - rv = Cq.Location() - obj = self.objects[name] - name_out = name - - if obj not in self.children and obj is not self: - locs = [] - while not obj.parent is self: - locs.append(obj.loc) - obj = cast(Cq.Assembly, obj.parent) - name_out = obj.name - - rv = functools.reduce(lambda l1, l2: l2 * l1, locs) - - return (rv, name_out) -Cq.Assembly._subloc = _subloc - ### Vector arithmetic def location_sub(self: Cq.Location, rhs: Cq.Location) -> Cq.Vector: -- 2.44.1 From 66976d7e1d5f7d3c9ba1d3b9d0dba4c23d5a155d Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Tue, 8 Jul 2025 22:53:06 -0700 Subject: [PATCH 2/3] fix: Close polygonal wire in torsion joint --- nhf/parts/joints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nhf/parts/joints.py b/nhf/parts/joints.py index 4245eff..f375919 100644 --- a/nhf/parts/joints.py +++ b/nhf/parts/joints.py @@ -317,7 +317,7 @@ class TorsionJoint: if not rider_slot_begin: rider_slot_begin = self.rider_slot_begin def slot(loc): - wire = Cq.Wire.makePolygon(self._slot_polygon(flip=False)) + wire = Cq.Wire.makePolygon(self._slot_polygon(flip=False)).close() face = Cq.Face.makeFromWires(wire) return face.located(loc) wall_profile = ( -- 2.44.1 From 9a53040bfa08d75081d1761d344bfff39ef660ee Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Wed, 9 Jul 2025 20:35:55 -0700 Subject: [PATCH 3/3] doc: Directly call CQ-editor in environment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 457ccb2..cc3b93f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Test the environment with `python3 -c "import nhf"` To visualize an object, create a file `visualize.py`, and run `cq-editor`: ``` sh -python3 -m cq_editor visualize.py +CQ-editor visualize.py ``` ### Folder Structure -- 2.44.1