From 1b5729c79318139c3118e25ec999c3f18500f696 Mon Sep 17 00:00:00 2001 From: Sverre Briseid Date: Thu, 10 Oct 2024 14:51:07 +0200 Subject: [PATCH 1/2] Special handling of linear int cvs. --- intersections/src/Coincidence.C | 8 ++++++++ 1 file changed, 8 insertions(+) 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; From bd68a24016e5ac263dc0aa1af030b84bb48f9b9e Mon Sep 17 00:00:00 2001 From: Sverre Briseid Date: Thu, 10 Oct 2024 15:32:52 +0200 Subject: [PATCH 2/2] Throwing error when encountering NaN ptol, will otherwise never stop subdividing. --- gotools-core/src/geometry/BoundedUtils.C | 3 +++ 1 file changed, 3 insertions(+) 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;