GithubHelp home page GithubHelp logo

Comments (9)

elalish avatar elalish commented on July 20, 2024 2

The first problem polygon is not overlapped, but it is entirely colinear within precision. It's an error in my handling of uncertain East/West positioning. Once I fix that we'll see if this test exposes any other errors.

from manifold.

pca006132 avatar pca006132 commented on July 20, 2024

Some thoughts about tracking precision:

If we consider the precision as 2 terms: inherent error and floating point error, the updated precision after transformation M should probably be oldPrecision * det(M), kTolerence*bbox.Scale() because the inherent error is scaled according to the transformation and is independent of the floating point error, while the floating point error is independent of the percentage error in the original model. (Not sure if we should use determinant or the max of norms of the 3x3 translation matrix)

The current way of scaling the precision by glm::max(1.0f, newScale / oldScale) looks a bit weird to me: consider a line (0, 0, 0) to (0, 0, 1) with precision 0.01, if we transform it to (0, 0, -1) to (0, 0, 1), the precision should be 0.02, but the current calculation will only give 0.01 because the maximum absolute coordinate is still 1. Also, when we scale the model down, we should get better precision.

from manifold.

pca006132 avatar pca006132 commented on July 20, 2024

Also, when we perform boolean operations, should we take the precision into account? It seems that the boolean operation code do not use precision when checking for overlaps, including both the shadow code and the bounding box overlap check.

from manifold.

elalish avatar elalish commented on July 20, 2024

The Boolean operation does not account for precision; its robustness is based on exact comparisons and ensuring that floating-point equality is handled consistently. The precision is only used in the triangulation and decimation steps at the end.

You make a good point regarding my precision calculations; I don't think I spent as much time thinking about that as I should have. Probably a good idea to add a few more simple tests like you lay out and update the math until they all pass. I'm pretty sure you're on the right track.

from manifold.

pca006132 avatar pca006132 commented on July 20, 2024

If we want to change the precision calculation, we might as well want to change some APIs because we do not have the precision information for them. For example, we currently don't track precision for polygons which we probably should, and the precision after the Warp operation is user defined. We probably want to allow the users to set the precision as well, which the function is currently not exposed to users.

from manifold.

elalish avatar elalish commented on July 20, 2024

Agreed that the precision should be settable. I don't think we want to track precision per face, as it gets too complicated in the API.

from manifold.

pca006132 avatar pca006132 commented on July 20, 2024

I don't mean to track precision per face, just precision for some polygons, and use that as the precision for models constructed by extruding/revolving the polygon. When we extract a polygon from a solid, either its face or through some slice API, it will inherit the precision of the model. Although we may need to do some scaling for the precision if the face is not axis aligned.

from manifold.

elalish avatar elalish commented on July 20, 2024

Oh, interesting. Yes, that's a good idea too.

from manifold.

fire avatar fire commented on July 20, 2024

Yay!

from manifold.

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.