Git Product home page Git Product logo

Comments (3)

jandam avatar jandam commented on May 31, 2024

Proposed fix starting at line 343 SemiVirtualIntegrityCheck:

    double h = geoOp.inCircle(a, b, c, d);

    if (h > 0) {
      if (e.isConstrained()) {
        // because the edge will not necessarily have had conformity
        // restored, we do not automatically treat the test as a failure here
        if (h > thresholds.getDelaunayThreshold()) {  // ADDED THIS TEST
          this.nDelaunayViolationsConstrained++;
          this.sumDelaunayViolationsConstrained += h;
          if (h > this.maxDelaunayViolationConstrained) {
            this.maxDelaunayViolationConstrained = h;
          }
        }
      } else {
        this.nDelaunayViolations++;
        this.sumDelaunayViolations += h;
        if (h > this.maxDelaunayViolation) {
          this.maxDelaunayViolation = h;
        }

        if (h > thresholds.getDelaunayThreshold()) {
          message = "InCircle failure h=" + h
            + ", starting at edge " + e
            + ": ("
            + a.getIndex()
            + ", " + b.getIndex()
            + ", " + c.getIndex()
            + ", " + d.getIndex() + ")";
          return false;

        }
      }
    }

from tinfour.

gwlucastrig avatar gwlucastrig commented on May 31, 2024

You make a good observation. The constrained-violation count was intended as a qualitative view of how often an inCircle() violation was suppressed due to a constrained edge. It would be more meaningful if it were changed to match the logic in the restore-conformity modules.

Coincidentally, I recently changed the wording in the IntegrityCheck printSummary() method from:

  • Detected Delaunay violations within tolerance

to read

  • Detected acceptable Delaunay violations within tolerance

I think this better conveys the fact that the algorithm tolerates very-small violations for efficiency purposes. Someday, when I have some spare time (as if that would ever happen), I want to try using Shewchuk's robust inCircle() implementation. Shewchuk's predicates are supposed to always give the correct answer regardless of numerical precision issues. It would be interesting to see how much performance overhead they require.

from tinfour.

gwlucastrig avatar gwlucastrig commented on May 31, 2024

Changes made as suggested and new code uploaded to git.

I am marking this issue as closed.

Thank you for your observation. Having a user with a fresh perspective on the code is a welcome resource.

from tinfour.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.