157157#endif
158158
159159namespace {
160- TopTools_ListOfShape copy_operand (const TopTools_ListOfShape& l) {
160+ void copy_operand (const TopTools_ListOfShape& l, TopTools_ListOfShape& r ) {
161161#if OCC_VERSION_HEX < 0x70000
162162 TopTools_ListOfShape r;
163163 TopTools_ListIteratorOfListOfShape it (l);
@@ -169,7 +169,7 @@ namespace {
169169 // On OCCT 7.0 and higher BRepAlgoAPI_BuilderAlgo::SetNonDestructive(true) is
170170 // called. Not entirely sure on the behaviour before 7.0, so overcautiously
171171 // create copies.
172- return l ;
172+ r. Assign (l) ;
173173#endif
174174 }
175175
@@ -3381,7 +3381,7 @@ bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a, const TopoDS_Shap
33813381bool IfcGeom::Kernel::boolean_operation (const TopoDS_Shape& a, const TopTools_ListOfShape& b_, BOPAlgo_Operation op, TopoDS_Shape& result, double fuzziness) {
33823382 bool success = false ;
33833383 BRepAlgoAPI_BooleanOperation* builder;
3384- TopTools_ListOfShape b;
3384+ TopTools_ListOfShape B, b;
33853385 if (op == BOPAlgo_CUT) {
33863386 builder = new BRepAlgoAPI_Cut ();
33873387 bounding_box_overlap (getValue (GV_PRECISION), a, b_, b);
@@ -3420,7 +3420,8 @@ bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a, const TopTools_Li
34203420#endif
34213421 builder->SetFuzzyValue (fuzz);
34223422 builder->SetArguments (s1s);
3423- builder->SetTools (copy_operand (b));
3423+ copy_operand (b, B);
3424+ builder->SetTools (B);
34243425 builder->Build ();
34253426 if (builder->IsDone ()) {
34263427 TopoDS_Shape r = *builder;
0 commit comments