-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Simplified mesh intersection logic #221
Simplified mesh intersection logic #221
Conversation
I know there are merge conflicts but I don;t know if we want to merge to master or to a different branch. So I await further instructions. |
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.
Thank you for this PR! Here is a first round of review, mostly for coding style.
src/transformation/mesh_intersection/triangle_triangle_intersection.rs
Outdated
Show resolved
Hide resolved
@Makogan Yes, we want to merge to |
Merged to master and made sure the current code passes the CI checks |
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.
Thank you for this first round of changes.
I noticed that a few remarks went unnoticed. Don’t forget that github tends to collapse multiple conversations if there are many of them.
Two other remarks:
- The obj test files should be moved to a
assets/tests
directory at the root of the repository. - Please add authoring & licence information as a comment in the
.obj
files.
src/transformation/mesh_intersection/triangle_triangle_intersection.rs
Outdated
Show resolved
Hide resolved
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.
Thank you for this second round of changes.
There are still a few ones left and a couple I haven’t seen the first times.
Regarding the obj files: please move them to assets/tests
instead of test_data
.
src/shape/shape.rs
Outdated
/// Find the index of a vertex in a poly line, such that the two | ||
/// edges incident in that vertex form the angle closest to 90 | ||
/// degrees in the poly line. | ||
#[cfg(feature = "dim3")] | ||
pub(crate) fn angle_closest_to_90(points: &[na::Vector3<Real>]) -> usize { | ||
let n = points.len(); | ||
|
||
let mut best_cos = 2.0; | ||
let mut selected_i = 0; | ||
for i in 0..n { | ||
let d1 = (points[i] - points[(i + 1) % n]).normalize(); | ||
let d2 = (points[(i + 2) % n] - points[(i + 1) % n]).normalize(); | ||
|
||
let cos = d1.dot(&d2); | ||
|
||
let cos_abs = cos.abs(); | ||
if cos_abs < best_cos { | ||
best_cos = cos_abs; | ||
selected_i = i; | ||
} | ||
} | ||
|
||
selected_i | ||
} |
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’d rather have it in triangle.rs
and private since that’s the only place it’s used.
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.
It is also used in the mesh intersection code inside of triangulate_constraints_and_merge_duplicates
, line 407. That's why i had to move it there. So that I had access to it.
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
Co-authored-by: Sébastien Crozet <[email protected]>
…akogan/parry into improve_mesh_intersection_code
Thank you, I took care of the last few details and updated the changelog. |
Change the mesh intersection code to rely on epsilon checks and point insertion to construct the final intersected mesh.