TopoDS_Vertex V1, V2;
TopExp::Vertices(anEdge, V1, V2);
BRepAdaptor_Curve2d BAcurve2d(anEdge, theRefFace);
- gp_Pnt2d FirstP2d = BAcurve2d.Value(BAcurve2d.FirstParameter());
- gp_Pnt2d LastP2d = BAcurve2d.Value(BAcurve2d.LastParameter());
- Standard_Real aSqDist;
+ if (BAcurve2d.Curve().IsNull())
+ {
+ continue;
+ }
+
+ const gp_Pnt2d FirstP2d = BAcurve2d.Value(BAcurve2d.FirstParameter());
+ const gp_Pnt2d LastP2d = BAcurve2d.Value(BAcurve2d.LastParameter());
+ Standard_Real aSqDist;
if (V1.IsSame(V2) && !BRep_Tool::Degenerated(anEdge))
{
gp_Pnt2d MidP2d =
aSqDist = FirstP2d.SquareDistance(MidP2d);
}
else
+ {
aSqDist = FirstP2d.SquareDistance(LastP2d);
- if (aSqDist < MinSize)
- MinSize = aSqDist;
+ }
+
+ MinSize = std::min(MinSize, aSqDist);
}
MinSize = Sqrt(MinSize);
return MinSize;
{
const TopoDS_Edge& anEdge = TopoDS::Edge(edges(ii));
BRepAdaptor_Curve2d aBAcurve(anEdge, F_RefFace);
- gp_Pnt2d aFirstPoint = aBAcurve.Value(aBAcurve.FirstParameter());
- gp_Pnt2d aLastPoint = aBAcurve.Value(aBAcurve.LastParameter());
+ if (aBAcurve.Curve().IsNull())
+ {
+ continue;
+ }
+
+ gp_Pnt2d aFirstPoint = aBAcurve.Value(aBAcurve.FirstParameter());
+ gp_Pnt2d aLastPoint = aBAcurve.Value(aBAcurve.LastParameter());
if (aFirstPoint.X() < FaceUmin)
FaceUmin = aFirstPoint.X();
Standard_Real fpar, lpar;
Handle(Geom2d_Curve) StartPCurve =
BRep_Tool::CurveOnSurface(StartEdge, F_RefFace, fpar, lpar);
+ if (StartPCurve.IsNull())
+ {
+ edges.Remove(istart);
+ continue;
+ }
TopoDS_Vertex StartVertex, CurVertex;
TopExp::Vertices(StartEdge, StartVertex, CurVertex, Standard_True); // with orientation
Standard_Real StartParam, CurParam;