Correct mode == Mode.INTERSECT to iterate intersections instead of pass all in to_intersect

Shape.intersect(A, B) through BRepAlgoAPI_Common appears to treat tool as a single object such that intersection is Shape ^ (A + B). The updated intersect methods treat this intersection as Shape ^ A ^ B. The intersections in this change need to be interated to accomadate.
This commit is contained in:
Jonathan Wagenet 2025-10-29 00:16:02 -04:00
parent 069b691964
commit 5d7b098379

View file

@ -466,7 +466,13 @@ class Builder(ABC, Generic[ShapeT]):
elif mode == Mode.INTERSECT:
if self._obj is None:
raise RuntimeError("Nothing to intersect with")
combined = self._obj.intersect(*typed[self._shape])
intersections: ShapeList[Shape] = ShapeList()
for target in typed[self._shape]:
result = self._obj.intersect(target)
if result is None:
continue
intersections.extend(result)
combined = self._sub_class(intersections)
elif mode == Mode.REPLACE:
combined = self._sub_class(list(typed[self._shape]))