Path.Area: add parameter 'Outline' to remove inner holes
This commit is contained in:
@@ -977,6 +977,7 @@ std::list<TopoDS_Wire> Area::project(const TopoDS_Shape &solid)
|
||||
area.myParams.Explode = false;
|
||||
area.myParams.FitArcs = false;
|
||||
area.myParams.Reorient = false;
|
||||
area.myParams.Outline = false;
|
||||
area.myParams.Coplanar = CoplanarNone;
|
||||
area.add(joiner.comp, OperationUnion);
|
||||
TopoDS_Shape shape = area.getShape();
|
||||
@@ -1358,6 +1359,19 @@ void Area::build() {
|
||||
myArea = std::move(area.myArea);
|
||||
}
|
||||
|
||||
if(myParams.Outline) {
|
||||
myArea->Reorder();
|
||||
for(auto it=myArea->m_curves.begin(),itNext=it;
|
||||
it!=myArea->m_curves.end();
|
||||
it=itNext)
|
||||
{
|
||||
++itNext;
|
||||
auto &curve = *it;
|
||||
if(curve.IsClosed() && curve.IsClockwise())
|
||||
myArea->m_curves.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
TIME_TRACE(t,"prepare");
|
||||
|
||||
}catch(...) {
|
||||
|
||||
@@ -60,6 +60,8 @@
|
||||
"but 'Check' only gives warning.",(None)(Check)(Force)))\
|
||||
((bool,reorient,Reorient,true,\
|
||||
"Re-orient closed wires in wire only shapes so that inner wires become holes."))\
|
||||
((bool,outline,Outline,false,\
|
||||
"Remove all inner wires (holes) before output the final shape"))\
|
||||
((bool,explode,Explode,false,\
|
||||
"If true, Area will explode the first shape into disconnected open edges, \n"\
|
||||
"with all curves discretized, so that later operations like 'Difference' \n"\
|
||||
|
||||
Reference in New Issue
Block a user