Comments (9)
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.
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.
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.
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.
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.
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.
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.
Oh, interesting. Yes, that's a good idea too.
from manifold.
Yay!
from manifold.
Related Issues (20)
- Is Manifold CAD opensource? HOT 2
- #528 causes invalid `UpdateVert` calls HOT 31
- Refactor triangulator HOT 2
- triangulator bugs related to #528
- vertProperties behavior HOT 3
- refactor SparseIndices to use HashTable HOT 1
- allow double precision HOT 14
- Python Interface Vertex and Face Types HOT 5
- Volume calculation is not deterministic HOT 12
- Testing booleans of meshes HOT 2
- Emscripten build HOT 10
- Lost faces when creating manifold HOT 22
- Subtraction creates overlapping triangles HOT 6
- extrude twist can cause invalid geometry HOT 5
- XCode 15 Link problem with <memory_resource> HOT 6
- How could I create a manifold object for a simple rectangle? HOT 4
- non-manifold mesh repair HOT 1
- refine to length HOT 6
- Support for OS X 10.13? HOT 4
- Wrong vertex normals and uvs after boolean subtraction HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manifold.