TopExp_Explorer ex2;
for(ex2.Init(curface,TopAbs_EDGE); ex2.More(); ex2.Next()){
const TopoDS_Edge& E = TopoDS::Edge(ex2.Current());
+ if (BRep_Tool::Degenerated(E))
+ continue;
+
TopoDS_Shape aNe = theReshaper.Value(E);
Standard_Real aNewEtol = -1;
GetEdgeTol(TopoDS::Edge(aNe), curface, aNewEtol);
myError = BRepLib_NotPlanar;
return;
}
-
+
// build the face and add the wire
BRep_Builder B;
myError = BRepLib_FaceDone;
Standard_Real tol = Max(1.2*FS.ToleranceReached(), FS.Tolerance());
B.MakeFace(TopoDS::Face(myShape),FS.Surface(),FS.Location(),tol);
- Add(W);
+
+ TopoDS_Wire aW;
+ if (OnlyPlane)
+ {
+ // get rid of degenerative edges in the input wire
+ BRep_Builder aB;
+ aB.MakeWire (aW);
+
+ TopoDS_Wire aWForw = W;
+ aWForw.Orientation (TopAbs_FORWARD);
+ TopoDS_Iterator anIter (aWForw);
+ for (; anIter.More(); anIter.Next())
+ {
+ const TopoDS_Edge& aE = TopoDS::Edge (anIter.Value());
+
+ if (!BRep_Tool::Degenerated (aE))
+ aB.Add (aW, aE);
+ }
+
+ aW.Orientation (W.Orientation()); // return to original orient
+ aW.Closed (W.Closed());
+ }
+ else
+ {
+ aW = W;
+ }
+
+ Add (aW);
//
BRepLib::UpdateTolerances(myShape);
//
BRepLib::SameParameter(myShape, tol, Standard_True);
//
- if (BRep_Tool::IsClosed(W))
+ if (BRep_Tool::IsClosed(aW))
CheckInside();
}