#define PYTHON_POLYLINEXY_ID "KIND_POLYLINEXY"
+const double LOCAL_SELECTION_TOLERANCE = 0.0001;
+
IMPLEMENT_STANDARD_HANDLE(HYDROData_PolylineXY, HYDROData_IPolyline)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_PolylineXY, HYDROData_IPolyline)
gp_Pnt aPnt1( aFirstPoint.X(), aFirstPoint.Y(), aFirstPoint.Z() );
gp_Pnt aPnt2( aLastPoint.X(), aLastPoint.Y(), aLastPoint.Z() );
+ if ( aPnt1.IsEqual( aPnt2, LOCAL_SELECTION_TOLERANCE ) )
+ continue;
+
TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aPnt1, aPnt2 ).Edge();
aMakeWire.Add( anEdge );
}
}
else //if( theType == PolylineSection::SECTION_SPLINE )
{
- HYDROData_BSplineOperation aBSpline( thePoints, theIsClosed );
+ HYDROData_BSplineOperation aBSpline( thePoints, theIsClosed, LOCAL_SELECTION_TOLERANCE );
TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aBSpline.Curve() ).Edge();
aMakeWire.Add( anEdge );
}
else
{
- HYDROData_BSplineOperation aBSpline( thePoints, theIsClosed );
+ HYDROData_BSplineOperation aBSpline( thePoints, theIsClosed, LOCAL_SELECTION_TOLERANCE );
aBSpline.ComputePath( thePath );
}
}
aPointToTest = aPoint;
}
- HYDROData_BSplineOperation aBSpline( aPoints, anIsSectionClosed );
+ HYDROData_BSplineOperation aBSpline( aPoints, anIsSectionClosed, LOCAL_SELECTION_TOLERANCE );
Quantity_Parameter aFirstParam = aBSpline.Curve()->FirstParameter();
Quantity_Parameter aSecondParam = aBSpline.Curve()->LastParameter();