Revert mode == Mode.INTERSECT iteration. pass Compound instead

This commit is contained in:
Jonathan Wagenet 2025-11-14 14:40:58 -05:00
parent c384df21c7
commit 5523a2184c

View file

@ -466,13 +466,7 @@ class Builder(ABC, Generic[ShapeT]):
elif mode == Mode.INTERSECT: elif mode == Mode.INTERSECT:
if self._obj is None: if self._obj is None:
raise RuntimeError("Nothing to intersect with") raise RuntimeError("Nothing to intersect with")
intersections: ShapeList[Shape] = ShapeList() combined = self._obj.intersect(Compound(typed[self._shape]))
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: elif mode == Mode.REPLACE:
combined = self._sub_class(list(typed[self._shape])) combined = self._sub_class(list(typed[self._shape]))