diff --git a/gotools-core/src/geometry/BoundedUtils.C b/gotools-core/src/geometry/BoundedUtils.C index 5d5b19323..4baede2fb 100644 --- a/gotools-core/src/geometry/BoundedUtils.C +++ b/gotools-core/src/geometry/BoundedUtils.C @@ -114,6 +114,9 @@ BoundedUtils::intersectWithSurface(CurveOnSurface& curve, double int_tol = 0.1*epsge; //1e-06; shared_ptr under_sf = bounded_surf.underlyingSurface(); double ptol = getParEps(epsge, under_sf.get()); + if (std::isnan(ptol)) { + THROW("Parametric epsilon is nan, suspecting unbounded domain, not supported"); + } int_tol = ptol; double tdel = curve.endparam() - curve.startparam(); double delfac = 0.01; diff --git a/intersections/src/Coincidence.C b/intersections/src/Coincidence.C index 362b39283..8a2ab9811 100644 --- a/intersections/src/Coincidence.C +++ b/intersections/src/Coincidence.C @@ -527,6 +527,14 @@ int checkCoincide(ParamCurveInt *curve, if (fabs(other_end - other_start) < tol->getRelParRes()) return 0; // Probably a closed curve + // With both end points equal we then check if curves are both linear. Needed + // to handle cases with practically unbounded domains (cylinders, planes, cones). + bool curve_linear = (curve->getParamCurve()->instanceType() == Class_Line); + bool other_linear = (other->getParamCurve()->instanceType() == Class_Line); + if (curve_linear && other_linear) { + return 1; + } + // double delta = 0.9*eps*eps; // double init_dist = std::max(pnt1.dist(pnt2), pnt3.dist(pnt4)); //double delta = (init_dist < 0.9*toler) ? 0.9*toler : toler;