Skip to content

Commit

Permalink
Merge pull request SINTEF-Geometry#375 from sbriseid/coincidence_line…
Browse files Browse the repository at this point in the history
…ar_int_cvs

Coincidence linear int cvs
  • Loading branch information
sbriseid authored Oct 10, 2024
2 parents 4ba4229 + bd68a24 commit e2f6e13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gotools-core/src/geometry/BoundedUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ BoundedUtils::intersectWithSurface(CurveOnSurface& curve,
double int_tol = 0.1*epsge; //1e-06;
shared_ptr<const ParamSurface> 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;
Expand Down
8 changes: 8 additions & 0 deletions intersections/src/Coincidence.C
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e2f6e13

Please sign in to comment.