Skip to content
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 do_snap parameter to PMP::autorefine_triangle_soup #8744

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

LeoValque
Copy link
Contributor

@LeoValque LeoValque commented Feb 17, 2025

Summary of Changes

The PR adds the do_snap parameter to autorefine_triangle_soup(). When set to true, the coordinates are rounded to fit in double with additional subdivisions, preventing any self-intersections from occurring.

Todo

  • Add to change log

Release Management

  • Affected package(s): PMP
  • Issue(s) solved (if any):
  • Feature/Small Feature (if any): link
  • Link to compiled documentation (obligatory for small feature) wrong link name to be changed
  • License and copyright ownership: GeometryFactory

Sorry, something went wrong.

@sloriot
Copy link
Member

sloriot commented Feb 17, 2025

What do you think of apply_iterative_snap_rounding() ? cc @MaelRL

@LeoValque
Copy link
Contributor Author

do you suggest to create a new function apply_iterative_snap_rounding() or simply to rename the parameter do_snap to apply_iterative_snap_rounding ?

@sloriot
Copy link
Member

sloriot commented Feb 17, 2025

do you suggest to create a new function apply_iterative_snap_rounding() or simply to rename the parameter do_snap to apply_iterative_snap_rounding ?

renaming the named parameter, provided Mael thinks it is a better name too.

@afabri
Copy link
Member

afabri commented Feb 17, 2025

What do you think of apply_iterative_snap_rounding() ? cc @MaelRL

I do not like an apply_ prefix. Did you have a look at the existing function for 2D

@sloriot
Copy link
Member

sloriot commented Feb 17, 2025

What do you think of apply_iterative_snap_rounding() ? cc @MaelRL

I do not like an apply_ prefix. Did you have a look at the existing function for 2D

note that's a named parameter, not a free function

@sloriot
Copy link
Member

sloriot commented Feb 17, 2025

What do you think of apply_iterative_snap_rounding() ? cc @MaelRL

I do not like an apply_ prefix. Did you have a look at the existing function for 2D

note that's a named parameter, not a free function

there is already the named parameter : apply_per_connected_component()

@MaelRL
Copy link
Member

MaelRL commented Feb 18, 2025

What do you think of apply_iterative_snap_rounding() ? cc @MaelRL

OK, but I also meant the function snap_polygon_soup(): even if it's internal, best to still avoid naming similarities.

@MaelRL MaelRL added Not yet approved The feature or pull-request has not yet been approved. Small feature labels Feb 18, 2025
@MaelRL MaelRL added this to the 6.1-beta milestone Feb 18, 2025
@sloriot
Copy link
Member

sloriot commented Feb 18, 2025

What do you think of apply_iterative_snap_rounding() ? cc @MaelRL

OK, but I also meant the function snap_polygon_soup(): even if it's internal, best to still avoid naming similarities.

for that one it could be internal::polygon_soup_snap_rounding()

@sloriot
Copy link
Member

sloriot commented Feb 19, 2025

/Users/magritte/cgal_root/CGAL-6.1-Ic-91/include/CGAL/Polygon_mesh_processing/internal/snap_polygon_soup.h:138:13: warning: unused variable 'pm' [-Wunused-variable]
/Users/magritte/cgal_root/CGAL-6.1-Ic-91/include/CGAL/Polygon_mesh_processing/internal/snap_polygon_soup.h:136:9: warning: unused type alias 'GT' [-Wunused-local-typedef]
/mnt/testsuite/include/CGAL/Polygon_mesh_processing/internal/snap_polygon_soup.h:223:5: warning: this 'else' clause does not guard... [-Wmisleading-indentation]

and PMP examples fully red https://cgal.geometryfactory.com/CGAL/testsuite/summary-6.1-Ic-91.html?package=Polygon_mesh_processing_Examples

…n snap_polygon_soup.cpp
@LeoValque LeoValque force-pushed the PMP_triangle_soup_rounding-GF branch from 1a54759 to 3b29156 Compare February 25, 2025 08:42
LeoValque and others added 6 commits February 28, 2025 11:44
Co-authored-by: Sebastien Loriot <sloriot.ml@gmail.com>
Co-authored-by: Sebastien Loriot <sloriot.ml@gmail.com>
Co-authored-by: Sebastien Loriot <sloriot.ml@gmail.com>
…to the voxel center instead of the voxel center
…utorefinement.h

Co-authored-by: Andreas Fabri <andreas.fabri@geometryfactory.com>
@LeoValque LeoValque closed this Mar 18, 2025
@LeoValque LeoValque force-pushed the PMP_triangle_soup_rounding-GF branch from a8c3c28 to ab56f76 Compare March 18, 2025 14:54
@sloriot sloriot reopened this Mar 18, 2025
void autorefine_triangle_soup(PointRange& soup_points,
TriangleRange& soup_triangles,
const NamedParameters& np = parameters::default_values())
bool autorefine_triangle_soup_(PointRange& soup_points,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the function name end with an underscore ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to find another name; I did that temporarily. I added a front function, autorefine_triangle_soup, that dispatches execution between this function and snap_triangle_soup because the mutual calling between them posed difficulties. Is autorefine_triangle_soup_internal a good name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting it in an internal namespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already the case

}
};

CGAL_MUTEX map_mutex;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we really have such a global variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it inside the class that is using it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CHANGES.md not updated Not yet approved The feature or pull-request has not yet been approved. Pkg::PMP Small feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants