Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MinkowskiSum and MinkowskiDifference #666
base: master
Are you sure you want to change the base?
Add MinkowskiSum and MinkowskiDifference #666
Changes from 24 commits
bcd06a4
89a9dea
30be9a0
f1e245f
d51976a
12990f8
5f52540
755a55c
42b8cf6
00d92de
93b6f30
0b7e34d
953eaf3
2d93b10
b668659
847ae97
1587164
ebe2baa
5f20c54
622556e
ca0a35d
807910e
3ba8302
49a50c2
0f840b4
98d9ca9
952a54f
3928719
f5ceb05
84e08f2
8fdf164
48f174a
377d58b
cac0610
1a5611e
038e896
560b3cb
cc6cbd5
6ca9645
418cf1c
8599a82
d87180b
c530b7a
114d2c1
adc1163
922e6b4
3ee19b8
31700fc
baefc51
098d2b1
2dd5b8b
d1f35e2
be0f63b
7dd55dd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 811 in src/manifold/src/manifold.cpp
Codecov / codecov/patch
src/manifold/src/manifold.cpp#L810-L811
Check warning on line 857 in src/manifold/src/manifold.cpp
Codecov / codecov/patch
src/manifold/src/manifold.cpp#L845-L857
Check warning on line 860 in src/manifold/src/manifold.cpp
Codecov / codecov/patch
src/manifold/src/manifold.cpp#L860
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What difference did you find this made? I've been seeing some surprising results between turning this on and off. @pca006132 I can't remember what the tradeoffs are anymore - is there any reason we would ever want to be not deterministic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit paranoid about the non-determinism of the genus etc. that arise from non-determinism in the unit tests... and I think disabling determinism enables some parallel optimizations, which result in the booleans getting added in a random order...
At least, until the precision behavior is found/fixed, it's less stressful on me for the unit tests to have these 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this disables the optimization that allows boolean operations to race against each other, so the result is deterministic (under the exact same condition and under the same binary). I think for reproducing results in the CI, it is fine to force it to be deterministic, but in general this may indicate that there are bugs or the test is testing properties that are too fragile and may break in future modification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm, I'm trying some more robust normal calculation methods for the offset PR, and I'm noticing that the rounding results are still non-deterministic between runs, despite setting the determinism parameter...
In my case, 1-in-10 runs of the test negative offset I'm doing come out without any slivers or genus issues; these runs are marked by executing more quickly (~25%) than the others. Thus, I think whatever non-determinism that is affecting kissing triangles is outside the purview of
ManifoldParams().deterministic = true;
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, we should make normal calculation sequential if we need determinism.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does it happen? I'm having trouble finding it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
impl.cpp
but it is not the only source for nondeterminism, it does not affect genus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, I find that if I make add the determinism check to the two policies on these lines, I get deterministic slivers and execution times: zalo@2bfe002
The real solution for slivers will probably be to make sure that each vertex is extruding along the average of the co-planar faces it's surrounded by.
That way, it will always end up at the same point as the equivalent vertex on the neighboring triangle 🤔
If I had time, I'd write something that traverses the connecting set of neighboring co-planar faces to force all of the faceNormals in a connected set to be identical, so they can't diverge...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I put some effort into making the Boolean not recalculate face normals, but copy them to any triangles that came from them for exactly this reason. However, with all the use of hulls, that may be defeated. Still, my Warp method avoided that pitfall, but still had the problem, so there may be other things going on too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing as much of the computation as possible in
double
space seems to ~halve the floaters when using the triangle warp method zalo@25f3958 😅Unfortunately, it doesn't seem like
glm
has facilities forlong double
math 🙃