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

Tet remeshing - add sizing field #7830

Merged

Conversation

janetournois
Copy link
Member

@janetournois janetournois commented Oct 26, 2023

Summary of Changes

This PR adds a sizing field as input for CGAL::tetrahedral_isotropic_remeshing(), that can be passed as second parameter, instead of target_edge_length.

Release Management

Todo

  • use Mesh_sizing_field like the optimizers do (adapt it to be a MeshDomainField_3) and find an API for it
  • write a new adaptive sizing field that keeps the same mesh density after remeshing
  • options in the demo
  • example
  • documentation (depends on Mesh_3 for MeshDomainField_3)
  • small feature
  • check size (for @sloriot)

@janetournois
Copy link
Member Author

janetournois commented Oct 26, 2023

At this point, remeshing can use the same sizing field as the one given to Mesh_3 for cell_size or facet_size, and it is used in a naive manner.
It looks like this
image

@janetournois janetournois added this to the 6.0-beta milestone Oct 26, 2023
janetournois and others added 25 commits November 3, 2023 16:08
…ithub.com/janetournois/cgal into Tet_remeshing-with_sizing_field-jtournois

# Conflicts:
#	Tetrahedral_remeshing/examples/Tetrahedral_remeshing/mesh_and_remesh_with_sizing.cpp
#	Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_adaptive_remeshing_impl.h
#	Tetrahedral_remeshing/include/CGAL/tetrahedral_remeshing.h
weights are 1/squared_distance_to(query point)
…zing_field-jtournois

# Conflicts:
#	Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_adaptive_remeshing_impl.h
@janetournois
Copy link
Member Author

janetournois commented May 6, 2024

The full ctest of examples and tests for the Tetrahedral_remeshing package passes on my machine, far below the 1200 sec timeout.
Ready to be tested :-)

typename Gt::Construct_cross_product_vector_3 cross_product =
gt.construct_cross_product_vector_3_object();
typename Gt::Compute_scalar_product_3 scalar_product =
gt.compute_scalar_product_3_object();

typedef typename Gt::FT FT;
typedef typename Gt::Vector_3 Vector_3;
const Vector_3 ij = vector(i, j);
const Vector_3 ik = vector(i, k);
const Vector_3 ij(i, j);
Copy link
Member

Choose a reason for hiding this comment

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

Important

vector was the function object Construct_vector_3 from the kernel.

Was there really a copy? That might be important to understand, and fix, for all the other implementation all over CGAL, which might use similar ways to initialize kernel objects.

@@ -319,34 +319,101 @@ Dihedral_angle_cosine cos_dihedral_angle(const typename Gt::Point_3& i,
return Dihedral_angle_cosine(CGAL::sign(num), CGAL::square(num), sqden);
}

// cosine of dihedral angle, computed from pre-computed and non-zero normals
template<typename Gt>
Dihedral_angle_cosine cos_dihedral_angle(const typename Gt::Vector_3& n1,
Copy link
Member

Choose a reason for hiding this comment

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

Dihedral_angle_cosine might be useful for other tet-related packages. Do you plan to make it more official one way or another?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree it could be useful elsewhere, for example in perturb_mesh_3() and exude_mesh_3().
I had not planned to document it but we should do it once this PR is merged

@sloriot
Copy link
Member

sloriot commented May 10, 2024

Successfully tested in CGAL-6.0-Ic-237 (only two timeout, well done!)

Copy link

This pull-request was previously marked with the label Tested, but has been modified with new commits. That label has been removed.

@github-actions github-actions bot removed the Tested label May 10, 2024
@janetournois
Copy link
Member Author

/force-build:v2

Copy link

There was an error while building the doc:

/home/runner/work/cgal/cgal/Tetrahedral_remeshing/doc/Tetrahedral_remeshing/Tetrahedral_remeshing.txt:71: warning: explicit link request to 'params' could not be resolved

https://github.com/CGAL/cgal/actions/runs/9029612547

@janetournois
Copy link
Member Author

/force-build:v2

Copy link

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/7830/v2/Manual/index.html

@sloriot sloriot force-pushed the Tet_remeshing-with_sizing_field-jtournois branch from 89328b0 to d257b65 Compare May 10, 2024 13:36
@sloriot sloriot added the Tested label May 10, 2024
@lrineau lrineau added the rm only: ready for master For the release team only: that indicates that a PR is about to be merged in 'master' label May 13, 2024
@lrineau lrineau self-assigned this May 13, 2024
@lrineau lrineau merged commit 5ca5d9c into CGAL:master May 15, 2024
9 checks passed
@lrineau lrineau removed the rm only: ready for master For the release team only: that indicates that a PR is about to be merged in 'master' label May 16, 2024
@lrineau lrineau deleted the Tet_remeshing-with_sizing_field-jtournois branch May 16, 2024 10:26
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.

5 participants