-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Shape_detection: using proper triangulated polygonal faces for linear_least_squares #8314
Shape_detection: using proper triangulated polygonal faces for linear_least_squares #8314
Conversation
Sebastien motivated yesterday having a basic triangulation for exactly cases like this. |
Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h
Outdated
Show resolved
Hide resolved
Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h
Outdated
Show resolved
Hide resolved
runtime error of |
handling of degenerate faces
Successfully tested in CGAL-6.0-Ic-282 |
Can we not identify three points which are maximal un-collinear, by computing Eigen values/vectors ? |
@@ -383,25 +415,6 @@ namespace Polygon_mesh { | |||
return Point_3(x, y, z); | |||
} | |||
|
|||
// Compute normal of the face. | |||
template<typename Face> | |||
Vector_3 get_face_normal(const Face& face) const { |
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 think the issue encountered by @lrineau would be fixed by only fixing this function. We should look for 3 non-collinear vertices to get a normal. I would then skip the proper 2D CDT and keep the centroid triangulation for the plane fitting (only matters for non exactly coplanar points anyway). @afabri what do you think?
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 also thought that for computing a face normal it is enough to find 3 sufficiently non-collinear points, but Sven told me that for non-convex faces he has to compute some weight and for that he needs a triangulation. We have to check with him.
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.
These were two separate problems:
- get_face_normal is used for fitting a plane to a single face and for checking whether a face fits to an adjacent region. This was likely the issue encountered by @lrineau.
- PCA was not using triangulated faces.
This pull-request was previously marked with the label |
Successfully tested in CGAL-6.0-Ic-307 |
Summary of Changes
Polygonal faces are now triangulated and face normals are calculated using PMP::compute_face_normal.
The calculated face normals and triangulations are buffered in Least_squares_plane_fit_region. However, Least_squares_plane_fit_sorting is independent and does not benefit from that buffered data.
Release Management