add Approximation option to TopoShape section
This commit is contained in:
@@ -1637,17 +1637,23 @@ TopoDS_Shape TopoShape::oldFuse(TopoDS_Shape shape) const
|
||||
#endif
|
||||
}
|
||||
|
||||
TopoDS_Shape TopoShape::section(TopoDS_Shape shape) const
|
||||
TopoDS_Shape TopoShape::section(TopoDS_Shape shape, const Standard_Boolean approximate) const
|
||||
{
|
||||
if (this->_Shape.IsNull())
|
||||
Standard_Failure::Raise("Base shape is null");
|
||||
if (shape.IsNull())
|
||||
Standard_Failure::Raise("Tool shape is null");
|
||||
BRepAlgoAPI_Section mkSection(this->_Shape, shape);
|
||||
BRepAlgoAPI_Section mkSection;
|
||||
mkSection.Init1(this->_Shape);
|
||||
mkSection.Init2(shape);
|
||||
mkSection.Approximation(approximate);
|
||||
mkSection.Build();
|
||||
if (!mkSection.IsDone())
|
||||
throw Base::RuntimeError("Section failed");
|
||||
return mkSection.Shape();
|
||||
}
|
||||
|
||||
TopoDS_Shape TopoShape::section(const std::vector<TopoDS_Shape>& shapes, Standard_Real tolerance) const
|
||||
TopoDS_Shape TopoShape::section(const std::vector<TopoDS_Shape>& shapes, Standard_Real tolerance, const Standard_Boolean approximate) const
|
||||
{
|
||||
if (this->_Shape.IsNull())
|
||||
Standard_Failure::Raise("Base shape is null");
|
||||
@@ -1658,6 +1664,7 @@ TopoDS_Shape TopoShape::section(const std::vector<TopoDS_Shape>& shapes, Standar
|
||||
#else
|
||||
BRepAlgoAPI_Section mkSection;
|
||||
mkSection.SetRunParallel(true);
|
||||
mkSection.Approximation(approximate);
|
||||
TopTools_ListOfShape shapeArguments,shapeTools;
|
||||
shapeArguments.Append(this->_Shape);
|
||||
for (std::vector<TopoDS_Shape>::const_iterator it = shapes.begin(); it != shapes.end(); ++it) {
|
||||
|
||||
Reference in New Issue
Block a user