// Making prism.
BRepPrimAPI_MakePrism* aPrismBuilder =
- new BRepPrimAPI_MakePrism(aMovedBase, anExtVec * (theFromSize + theToSize));
+ new BRepPrimAPI_MakePrism(aMovedBase, anExtVec * (theFromSize + theToSize), true);
if (!aPrismBuilder || !aPrismBuilder->IsDone()) {
return;
}
// Making prism.
BRepPrimAPI_MakePrism* aPrismBuilder =
- new BRepPrimAPI_MakePrism(aMovedBase, anExtVec * 2 * aPrismLength);
+ new BRepPrimAPI_MakePrism(aMovedBase, anExtVec * 2 * aPrismLength, true);
if(!aPrismBuilder || !aPrismBuilder->IsDone()) {
return;
}
// Solid based on "To" bounding plane
gp_Vec aNormal = aToDir->impl<gp_Dir>();
BRepPrimAPI_MakePrism* aToPrismBuilder =
- new BRepPrimAPI_MakePrism(aToShape, aNormal * (-2.0 * aBndBoxSize));
+ new BRepPrimAPI_MakePrism(aToShape, aNormal * (-2.0 * aBndBoxSize), true);
if (!aToPrismBuilder || !aToPrismBuilder->IsDone()) {
return;
}
// Solid based on "From" bounding plane
aNormal = aFromDir->impl<gp_Dir>();
BRepPrimAPI_MakePrism* aFromPrismBuilder =
- new BRepPrimAPI_MakePrism(aFromShape, aNormal * (-2.0 * aBndBoxSize));
+ new BRepPrimAPI_MakePrism(aFromShape, aNormal * (-2.0 * aBndBoxSize), true);
if (!aFromPrismBuilder || !aFromPrismBuilder->IsDone()) {
return;
}
// Making prism.
BRepPrimAPI_MakePrism* aPrismBuilder =
- new BRepPrimAPI_MakePrism(aMovedBase, anExtVec * 2 * aPrismLength);
+ new BRepPrimAPI_MakePrism(aMovedBase, anExtVec * 2 * aPrismLength, true);
if (!aPrismBuilder || !aPrismBuilder->IsDone()) {
return;
}
return;
}
+ // the value to enlarge the bounding box of each object to make the extruded shape
+ // a little bit larger than overall objects to get the correct result of Boolean CUT operation
+ double anEnlargement = 0.1 * aBndObjs.front()->distance(aBndObjs.back());
+
// Prism direction
if (theDir.get()) {
// One direction for all prisms
// Bounding box of the base
std::list<std::shared_ptr<GeomAPI_Pnt> > aBndBases =
- GeomAlgoAPI_ShapeTools::getBoundingBox(aBaseShapes_i);
+ GeomAlgoAPI_ShapeTools::getBoundingBox(aBaseShapes_i, anEnlargement);
if (aBndBases.size() != 8) {
return;
}