Comments (12)
I have similar problem
Test for reproduce:
TEST(Manifold, Substract) {
Mesh firstMesh;
firstMesh.vertPos = {
{0, 0, 0}, {1540, 0, 0}, {1540, 70, 0},
{0, 70, 0}, {0, 0, -278.282}, {1540, 70, -278.282},
{1540, 0, -278.282}, {0, 70, -278.282}};
firstMesh.triVerts = {
{0, 1, 2}, {2, 3, 0}, {4, 5, 6}, {5, 4, 7}, {6, 2, 1}, {6, 5, 2},
{5, 3, 2}, {5, 7, 3}, {7, 0, 3}, {7, 4, 0}, {4, 1, 0}, {4, 6, 1},
};
Mesh secondMesh;
secondMesh.vertPos = {
{2.04636e-12, 70, 50000}, {2.04636e-12, -1.27898e-13, 50000},
{1470, -1.27898e-13, 50000}, {1540, 70, 50000},
{2.04636e-12, 70, -28.2818}, {1470, -1.27898e-13, 0},
{2.04636e-12, -1.27898e-13, 0}, {1540, 70, -28.2818}};
secondMesh.triVerts = {{0, 1, 2}, {2, 3, 0}, {4, 5, 6}, {5, 4, 7},
{6, 2, 1}, {6, 5, 2}, {5, 3, 2}, {5, 7, 3},
{7, 0, 3}, {7, 4, 0}, {4, 1, 0}, {4, 6, 1}};
Manifold first(firstMesh);
Manifold second(secondMesh);
first -= second;
first.GetMesh();
}
from manifold.
Test case from #141 (comment)
This is probably related to precision.
TEST(Boolean, Close) {
Manifold a = Manifold::Sphere(10, 256);
Manifold result = a;
for (int i = 0; i < 10; i++) {
std::cout << i << std::endl;
result ^= a.Translate({a.Precision()/10 * i, 0.0, 0.0});
EXPECT_TRUE(result.IsManifold());
EXPECT_TRUE(result.MatchesTriNormals());
}
}
For circularSegments = 128
, it triggered this issue. For circularSegments = 256
, it shows triangulation failed without triggering this, but I guess the calculation is wrong anyway.
from manifold.
Interesting; I tried your test with valgrind
(which is what I usually use for this kind of thing) and my usual GCC compiler, but it found no problems. I've never used -fsanitize
, which I suppose shows I'm still a C++ noob in some ways, and it doesn't want to compile for me. Should we add that to our CI tests?
from manifold.
I think you may need to install libsan
according to this SO thread. I use sanitizers because it is much faster than valgrind
, but I am not sure if it can catch more bugs than valgrind.
Yes we can compile all tests on our CI with address sanitizer enabled.
I tested with both clang++ 13.0.0 and g++ 10.3.0, so this should not be dependent on certain version of the compiler.
from manifold.
I found this SO answer, which helped (and also made me wonder if our CMakeLists is more complex than it needs to be?). However, I'm still not seeing any errors on your test. I'm on GCC 9.3.0. Might be best to go ahead and add this as a test so we can all see it fail the CI.
from manifold.
Interesting. I can try to add this to the tests and reproduce this in the CI. Btw are you compiling a debug version or release version? Can you show me the full cmake command you used?
Regarding the CMakeLists, yes I think it is a bit too complicated and there are a lot of repeated code there. I'm not familiar with cmake so not sure what is the best way to handle that.
from manifold.
I'm just using VSCode's build button as usual, which does this: /usr/local/bin/cmake --build /home/emmett/code/manifold/build --config Release --target all -j 14 --
(I pasted it into a new test so that it's part of the main build).
I'm no CMake expert either; I think you may have written more of it than me at this point. They're always adding features in new versions that make things simpler. Anyway, just something to keep in mind.
from manifold.
OK It turns out that I was using ed272b0 when trying to minimize the test case, and the behavior with the current master is a bit non-deterministic. The error can still be reproduced there, but we need to randomly permute the indices and try for some time... which is not easy to debug. Instead ed272b0 can deterministically fail.
Here is the CI run that failed: pca006132#2
from manifold.
Interesting, any thoughts as to why the lazy boolean would introduce more non-determinism here? Seems like without reordering it should be as deterministic as it was before...
from manifold.
No idea, perhaps we violated const-ness somewhere or the csg_tree implementation is incorrect somewhere?
from manifold.
Thanks, your example seems a bit simpler to look at than mine :)
from manifold.
Ah yes, the joys of precision... I never did do a proper mathematical bounding exercise. Sounds like I need to A) fix the seg fault, and B) probably loosen the precision a bit. Hopefully that's enough 🤞
from manifold.
Related Issues (20)
- Python created object reports as non-manifold. HOT 3
- Watertightness of Mesh with an Edge Shared by 4 Faces
- vertex halfedge iterator
- Manifold 2.4.5 release tar.gz is incomplete HOT 3
- Vec out of Range HOT 8
- Python binding needs two import call HOT 4
- Manifold Decompose doesn't preserve vertex properties HOT 4
- memory leak when TBB and PSTL is enabled HOT 27
- Triangulate bug: Two separate polygons HOT 5
- [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
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.