mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
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:
parent
069b691964
commit
5d7b098379
1 changed files with 7 additions and 1 deletions
|
|
@ -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]))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue