X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FShapeFix%2FShapeFix_Face.cxx;h=6349c0177e7b092f3b8b7a1454075996c335e452;hp=0412c3732e1c1750bad396d38e4c2ce78fa3013b;hb=eafb234bf120f005d1a52abc75384d33d2de1721;hpb=4e18e72a22679f14d021c5fe7d5f9628107369b8 diff --git a/src/ShapeFix/ShapeFix_Face.cxx b/src/ShapeFix/ShapeFix_Face.cxx index 0412c3732e..6349c0177e 100755 --- a/src/ShapeFix/ShapeFix_Face.cxx +++ b/src/ShapeFix/ShapeFix_Face.cxx @@ -443,7 +443,7 @@ Standard_Boolean ShapeFix_Face::Perform() } if ( theAdvFixWire->Perform() ) { //fixed = Standard_True; - isfixReorder = ((theAdvFixWire->StatusReorder(ShapeExtend_DONE) && !theAdvFixWire->StatusReorder(ShapeExtend_DONE5)) || isfixReorder); + isfixReorder = (theAdvFixWire->StatusReorder(ShapeExtend_DONE) || isfixReorder); fixed = (theAdvFixWire->StatusSmall(ShapeExtend_DONE) || theAdvFixWire->StatusConnected(ShapeExtend_DONE) || theAdvFixWire->StatusEdgeCurves(ShapeExtend_DONE) || @@ -480,7 +480,9 @@ Standard_Boolean ShapeFix_Face::Perform() } if(fixed || isfixReorder) { myFace = tmpFace; - myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 ); + if (!theAdvFixWire->StatusReorder(ShapeExtend_DONE5)) { + myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 ); + } } } @@ -1397,16 +1399,18 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() if ( ::Precision::IsInfinite ( SUF ) || ::Precision::IsInfinite ( SUL ) ) { if ( ::Precision::IsInfinite ( SUF ) ) SUF = fU1; if ( ::Precision::IsInfinite ( SUL ) ) SUL = fU2; - if(Abs(SUL-SUF) < ::Precision::PConfusion()) + if(Abs(SUL-SUF) < ::Precision::PConfusion()) { if ( ::Precision::IsInfinite ( SUF ) ) SUF-=1000.; else SUL+=1000.; + } } if ( ::Precision::IsInfinite ( SVF ) || ::Precision::IsInfinite ( SVL ) ) { if ( ::Precision::IsInfinite ( SVF ) ) SVF = fV1; if ( ::Precision::IsInfinite ( SVL ) ) SVL = fV2; - if(Abs(SVL-SVF) < ::Precision::PConfusion()) + if(Abs(SVL-SVF) < ::Precision::PConfusion()) { if ( ::Precision::IsInfinite ( SVF ) ) SVF-=1000.; else SVL+=1000.; + } } URange = Abs ( SUL - SUF ); @@ -1627,9 +1631,10 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() vf = pos1.Y(); } } - if ( skipU && skipV ) + if ( skipU && skipV ) { if ( i1 <= nb1 ) continue; else break; + } // or yet better - if it is end of some edges on both wires for ( Standard_Integer i2 = 1; i1 <= nb1 && i2 <= nb2; i2++ ) { TopoDS_Edge edge2 = wd2->Edge ( i2 ); @@ -2209,18 +2214,24 @@ Standard_Boolean ShapeFix_Face::FixSplitFace(const TopTools_DataMapOfShapeListOf TopoDS_Shape S = myFace; if ( ! Context().IsNull() ) S = Context()->Apply ( myFace ); - Standard_Integer NbWires=0, NbWiresNew=0; + Standard_Integer NbWires=0, NbWiresNew=0, NbEdges; for(TopoDS_Iterator iter(S,Standard_False); iter.More(); iter.Next()) { - if(iter.Value().ShapeType() != TopAbs_WIRE || - (iter.Value().Orientation() != TopAbs_FORWARD && iter.Value().Orientation() != TopAbs_REVERSED)) + const TopoDS_Shape& aShape = iter.Value(); + if(aShape.ShapeType() != TopAbs_WIRE || + (aShape.Orientation() != TopAbs_FORWARD && aShape.Orientation() != TopAbs_REVERSED)) continue; - TopoDS_Wire wire = TopoDS::Wire ( iter.Value() ); + TopoDS_Wire wire = TopoDS::Wire ( aShape ); NbWires++; if(MapWires.IsBound(wire)) { // if wire not closed --> stop split and return false Handle(ShapeExtend_WireData) sewd = new ShapeExtend_WireData(wire); + NbEdges = sewd->NbEdges(); + if (NbEdges == 0) { + continue; + } + // TopoDS_Edge E1 = sewd->Edge(1); - TopoDS_Edge E2 = sewd->Edge(sewd->NbEdges()); + TopoDS_Edge E2 = sewd->Edge(NbEdges); TopoDS_Vertex V1,V2; ShapeAnalysis_Edge sae; V1=sae.FirstVertex(E1);