if (myFixTailMode != 0)
{
- Fixed |= FixTails();
- if (Fixed)
+ if (FixTails())
{
+ Fixed =Standard_True;
FixShifted();
}
}
}
if ( seq.Length() >0 ) { // supposed that edge is SP
#ifdef OCCT_DEBUG
- cout << "Edge going over singularity detected; splitted" << endl;
+ std::cout << "Edge going over singularity detected; splitted" << std::endl;
#endif
Standard_Boolean isFwd = ( E.Orientation() == TopAbs_FORWARD );
E.Orientation ( TopAbs_FORWARD );
myFixEdge->FixAddPCurve ( sbwd->Edge(overdegen), face, sbwd->IsSeam(overdegen), myAnalyzer->Surface(), Precision());
}
#ifdef OCCT_DEBUG
- cout << "Edge going over singularity detected; pcurve adjusted" << endl;
+ std::cout << "Edge going over singularity detected; pcurve adjusted" << std::endl;
#endif
}
}
sbwd->Remove ( i-- );
nb--;
myStatusEdgeCurves |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );
- FixConnected (i + 1, Precision());
+ if (i == nb)
+ {
+ FixClosed (Precision());
+ }
+ else
+ {
+ FixConnected (i + 1, Precision());
+ }
}
myStatusEdgeCurves |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL5 );
}
if(sae.HasPCurve(sbwd->Edge(i),face)) {
Handle(Geom2d_Curve) C2d;
Standard_Real fp2d,lp2d;
- if(sae.PCurve(sbwd->Edge(i),face,C2d,fp2d,lp2d)) {
+ if(sae.PCurve(sbwd->Edge(i),face,C2d,fp2d,lp2d, Standard_False)) {
if( fabs(First-fp2d)>Precision::PConfusion() ||
- fabs(Last-lp2d)>Precision::PConfusion() ) {
+ fabs(Last-lp2d)>Precision::PConfusion() )
+ {
BRep_Builder B;
B.SameRange(sbwd->Edge(i),Standard_False);
}
+ else if(!sae.CheckPCurveRange(First, Last, C2d))
+ {
+ //Replace pcurve
+ TopLoc_Location L;
+ const Handle(Geom_Surface)& S = BRep_Tool::Surface(face, L);
+ ShapeBuild_Edge().RemovePCurve (sbwd->Edge(i), S, L);
+ myFixEdge->FixAddPCurve ( sbwd->Edge(i), face, sbwd->IsSeam(i),
+ myAnalyzer->Surface(), Precision() );
+ if ( myFixEdge->Status ( ShapeExtend_DONE ) )
+ myStatusEdgeCurves |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
+ if ( myFixEdge->Status ( ShapeExtend_FAIL ) )
+ myStatusEdgeCurves |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL3 );
+ }
}
}
myFixEdge->FixSameParameter ( sbwd->Edge(i), Face());
num = ( myClosedMode ? 1 : 2 );
nb = sbwd->NbEdges();
#ifdef OCCT_DEBUG
- cout << "Warning: ShapeFix_Wire::FixSelfIntersection: Edge removed" << endl;
+ std::cout << "Warning: ShapeFix_Wire::FixSelfIntersection: Edge removed" << std::endl;
#endif
}
else
}
#ifdef OCCT_DEBUG
if (StatusSelfIntersection (ShapeExtend_DONE5))
- cout<<"Warning: ShapeFix_Wire::FixIntersection: Non-adjacent intersection fixed (split-"
- <<NbSplit<<", cut-"<<NbCut<<", removed-"<<NbRemoved<<")"<<endl;
+ std::cout<<"Warning: ShapeFix_Wire::FixIntersection: Non-adjacent intersection fixed (split-"
+ <<NbSplit<<", cut-"<<NbCut<<", removed-"<<NbRemoved<<")"<<std::endl;
#endif
/*
myStatusSelfIntersection |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );
#ifdef OCCT_DEBUG
if (StatusSelfIntersection (ShapeExtend_DONE5))
- cout << "Warning: ShapeFix_Wire::FixSelfIntersection: Non ajacent intersection fixed" << endl;
+ std::cout << "Warning: ShapeFix_Wire::FixSelfIntersection: Non ajacent intersection fixed" << std::endl;
#endif
*/
}
VRange = aBaseCrv->Period();
IsVCrvClosed = Standard_True;
#ifdef OCCT_DEBUG
- cout << "Warning: ShapeFix_Wire::FixShifted set vclosed True for Surface of Revolution" << endl;
+ std::cout << "Warning: ShapeFix_Wire::FixShifted set vclosed True for Surface of Revolution" << std::endl;
#endif
}
}
ShapeBuild_Edge sbe;
Standard_Integer nb = sbwd->NbEdges();
- Standard_Boolean end = (nb == 0), degstop = Standard_False;;
+ Standard_Boolean end = (nb == 0), degstop = Standard_False;
Standard_Integer stop = nb;
Standard_Integer degn2 = 0;
gp_Pnt pdeg;
}
myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
#ifdef OCCT_DEBUG
- cout << "Info: ShapeFix_Wire::FixShifted(): bi - meridian case fixed" << endl;
+ std::cout << "Info: ShapeFix_Wire::FixShifted(): bi - meridian case fixed" << std::endl;
#endif
continue;
}
return Standard_False;
#ifdef OCCT_DEBUG
- cout << "Cut Loop: params (" << t1 << ", " << t2;
+ std::cout << "Cut Loop: params (" << t1 << ", " << t2;
#endif
GeomAdaptor_Curve GAC ( crv, f, l );
Standard_Real dt = tolfact * GAC.Resolution(prec);
t1 -= dt; //1e-3;//::Precision::PConfusion();
t2 += dt; //1e-3;//::Precision::PConfusion();
#ifdef OCCT_DEBUG
- cout << ") -> (" << t1 << ", " << t2 << ")" << endl;
+ std::cout << ") -> (" << t1 << ", " << t2 << ")" << std::endl;
#endif
if ( t1 <= a || t2 >= b ) { // should not be so, but to be sure ..
Standard_Real tol = BRep_Tool::Tolerance ( E );
#ifdef OCCT_DEBUG
- cout << "Cut Loop: tol orig " << tol << ", prec " << prec << ", new tol " << newtol << endl;
+ std::cout << "Cut Loop: tol orig " << tol << ", prec " << prec << ", new tol " << newtol << std::endl;
#endif
if ( newtol > Max ( prec, tol ) ) return Standard_False;
//:s2 bs = BRep_Tool::CurveOnSurface ( edge, face, a, b );
TopoDS_Edge &E2)
{
#ifdef OCCT_DEBUG
- cout<<"Info: ShapeFix_Wire::FixSelfIntersection : Try insert vertex"<<endl;
+ std::cout<<"Info: ShapeFix_Wire::FixSelfIntersection : Try insert vertex"<<std::endl;
#endif
if ( BRep_Tool::IsClosed ( E, face ) ) return Standard_False;
if (myRemoveLoopMode<1) {
for ( Standard_Integer iter=0; iter < 30; iter++ ) {
- Standard_Boolean loopRemoved = Standard_False;;
+ Standard_Boolean loopRemoved = Standard_False;
Standard_Real prevFirst = 0 , prevLast = 0;
for ( Standard_Integer i=1; i<=points2d.Length(); i++ ) {
gp_Pnt pint = points3d.Value(i);
if ( BRep_Tool::Tolerance(E1) < te1 || BRep_Tool::Tolerance(E2) < te2 )
{
#ifdef OCCT_DEBUG
- cout << "Warning: ShapeFix_Wire::FixIE: edges tolerance increased: (" <<
- te1 << ", " << te2 << ") / " << newtol << endl;
+ std::cout << "Warning: ShapeFix_Wire::FixIE: edges tolerance increased: (" <<
+ te1 << ", " << te2 << ") / " << newtol << std::endl;
#endif
// Make copy of edges.
if ( ! TryNewPCurve ( E, face, c2d, first, last, tol ) ) return Standard_False;
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure const& ) {
#ifdef OCCT_DEBUG
- cout << "Warning: ShapeFix_Wire::FixLacking: Exception in Geom2d_BSplineCurve::Segment()" << endl;
+ std::cout << "Warning: ShapeFix_Wire::FixLacking: Exception in Geom2d_BSplineCurve::Segment()" << std::endl;
#endif
return Standard_False;
}
if ( doAddDegen ) {
myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
#ifdef OCCT_DEBUG
- cout << "Warning: ShapeFix_Wire::FixLacking: degenerated edge added" << endl;
+ std::cout << "Warning: ShapeFix_Wire::FixLacking: degenerated edge added" << std::endl;
#endif
}
else if ( ! doAddLong ) {
FixSelfIntersectingEdge ( n2 );
FixIntersectingEdges ( n2 ); //skl 24.04.2003 for OCC58
#ifdef OCCT_DEBUG
- cout << "Info: ShapeFix_Wire::FixLacking: Bending pcurves" << endl;
+ std::cout << "Info: ShapeFix_Wire::FixLacking: Bending pcurves" << std::endl;
#endif
myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );
}
Handle(Geom2d_Curve) c2d;
Standard_Real a, b;
sae.PCurve ( splitE, face, c2d, a, b, Standard_True );
- Standard_Real ppar = (isRemoveFirst ? b : a);
ShapeBuild_Edge sbe;
TopAbs_Orientation orient = splitE.Orientation();
- if ( Abs(param - ppar) > ::Precision::PConfusion() ) {
- //pdn perform splitting of the edge and adding to wire
-
+
+ // check whether the whole edges should be removed - this is the case
+ // when split point coincides with the end of the edge;
+ // for closed edges split point may fall at the other end (see issue #0029780)
+ if (Abs(param - (isRemoveFirst ? b : a)) <= ::Precision::PConfusion() ||
+ (sae.IsClosed3d(splitE) && Abs(param - (isRemoveFirst ? a : b)) <= ::Precision::PConfusion()))
+ {
+ FixDummySeam(n1);
+ // The seam edge is removed from the list. So, need to step back to avoid missing of edge processing
+ i--;
+ }
+ else // perform splitting of the edge and adding to wire
+ {
//pdn check if it is necessary
if( Abs((isRemoveFirst ? a : b)-param) < ::Precision::PConfusion() ) {
continue;
FixDummySeam(isRemoveLast ? NbEdges() : toRemove);
myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
}
- else
- {
- FixDummySeam(n1);
- // The seam edge is removed from the list. So, need to step back to avoid missing of edge processing
- i--;
- }
i--;
if(!Context().IsNull()) //skl 07.03.2002 for OCC180