Path.Area: add parameter 'Outline' to remove inner holes

This commit is contained in:
Zheng, Lei
2017-05-09 14:21:32 +08:00
committed by wmayer
parent 9120d6db77
commit 997200d3b4
2 changed files with 16 additions and 0 deletions

View File

@@ -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(...) {