From 621c7d54b6df7ad016d0a017a2d8a53dd2f25eb3 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Tue, 8 Jul 2025 22:48:36 -0700 Subject: [PATCH] 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: