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)
- [Question] robust geometric predicates, polygon triangulation
- Warning comparison of integer expressions of different signedness
- Modularize Manifold HOT 25
- Build without exceptions HOT 3
- Remove Thrust HOT 19
- How to figure out required size of mem in the C-API? HOT 1
- Crash in Project() HOT 4
- gcc14 build failure HOT 7
- Triangulation issue: Zebra HOT 3
- BSD compiler error HOT 1
- Another Zebra Triangulation issue HOT 6
- Port for vcpkg HOT 7
- use size_t whenever possible
- Auto generated python stubs inconsistent with cpp API HOT 14
- Rust bindings HOT 22
- Build error with Emscripten 3.1.61 HOT 1
- Debug MSVC build error HOT 8
- NumTri returns uint32_t, while array uses size_t (like uint64_t or int64_t) HOT 3
- Warning as errors HOT 4
- operator""_z returns unsigned and is in the global scope
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.