Skip to content

Tetrahedral remeshing - make each step optional - #9583

Open
janetournois wants to merge 3 commits into
CGAL:mainfrom
janetournois:Tet_remeshing-make_each_step_optional-jtournois
Open

Tetrahedral remeshing - make each step optional#9583
janetournois wants to merge 3 commits into
CGAL:mainfrom
janetournois:Tet_remeshing-make_each_step_optional-jtournois

Conversation

@janetournois

Copy link
Copy Markdown
Member

Summary of Changes

This PR adds named parameters to make different remeshing steps optional
New named parameters :

  • do_split
  • do_collapse
  • do_flip
  • nb_smoothing_operations

note nb_flip_smooth_operations was already there

Do you @sloriot @MaelRL think they should be documented, maybe in an "Advanced NP" section?

Release Management

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

New named parameters :
do_split
do_collapse
do_flip
nb_smoothing_operations

note nb_flip_smooth_operations was already there
bool do_collapse = true;
bool do_flip = true;
std::size_t nb_smoothing_iterations = 1;
std::size_t nb_flip_smooth_iterations = 3;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now the following code triggers a compilation error:

    CGAL::tetrahedral_isotropic_remeshing(
          cdt,
          3 * bbox_max_span,
          CGAL::parameters::number_of_iterations(1).nb_flip_smooth_iterations(20)
          .remesh_boundaries(false));

include/CGAL/tetrahedral_remeshing.h:585:7: error: non-constant-expression cannot be narrowed from type 'int' to 'std::size_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]

   585 |       choose_parameter(get_parameter(np, internal_np::nb_flip_smooth_iterations), std::size_t{3})};
       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A possible fix is to use 20u (of type unsigned int) instead of 20 (type int) as the value passed to nb_flip_smooth_iterations. I am not sure why. And I do not know why the parameter CGAL::parameters::number_of_iterations(1) is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants