-
Notifications
You must be signed in to change notification settings - Fork 1.6k
API proposal for 3D mesh smoothing #9576
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
Open
fprotais
wants to merge
85
commits into
CGAL:main
Choose a base branch
from
fprotais:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 84 commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
3bccce8
Initial doc version - compiling
fprotais 59ffb37
Minor changes
fprotais d39cfb0
fix some doc warnings
sloriot 7d2aa30
CGALify
sloriot 0c0923c
Working examples
fprotais 30d445f
Code to latest cgal version
fprotais 2da4b11
New image
fprotais 430677e
First version of user manual vibe-coded
fprotais 9792a23
Initial doc
fprotais 3748179
image scaling in doc
fprotais d456da1
Changes after feedback
fprotais 139c9c6
Change to include only 1 function
fprotais 3467bab
Compiling c3t3 example with new function
fprotais fb234b7
Update Mesh_smoothing_3/include/CGAL/Mesh_smoothing_3/Mesh_smoothing_3.h
fprotais e87fb37
typos and cleanup
afabri 2966fae
fix doc
janetournois f35ab40
fix doc
janetournois a283fe6
Minor text changes from PR
fprotais 6a0abaf
package description correction
fprotais 62d9b63
Update Mesh_smoothing_3/doc/Mesh_smoothing_3/Mesh_smoothing_3.txt
fprotais d3ec736
update license
sloriot f28b21c
tmp license
sloriot 453e0cc
move
sloriot 807f960
public domain
sloriot 6e72c0f
update cmake project name
sloriot 3a83780
missing ID and URL
sloriot 72aaf7f
trailing whitespaces
sloriot d59df6b
New example version not compiling
fprotais 211b0b9
fix reading
sloriot 2f1d79f
fix compilation issues
sloriot d06496d
read_medit crash
fprotais 4a8249e
Cleaning c3t3_smooth
fprotais cd4072c
Working c3t3_smooth.cpp, without feature edges
fprotais 897da28
Switching to cgal predicates
fprotais b7d3795
improve reading
sloriot cae44ee
Minor text fixes
fprotais 492c89c
Removing colorized_print to switch to cgal & moving around files
fprotais 7e82a0f
Correct bunny mesh
fprotais cde843b
Pass warning
fprotais 05ba8bf
Adding property maps for locks, not documented yet
fprotais 66dd9dd
Adding property map with locks documented
fprotais be91ae8
fix doc
sloriot dffa7ff
Wall Warnings in future examples
fprotais 45405c3
updated manual page for c3t3 example
fprotais bdfe8bd
typo
fprotais 50090f7
white spaces
fprotais 80eb5e4
Merge remote-tracking branch 'cgal/main'
sloriot ccdc917
jpg -> png in user manual
fprotais 67c24d1
Adding c3t3projector for projection in Boundary_aware_mesh_smoothing
fprotais 01fe2ba
Fixing doc
fprotais dfafa68
Fixing dependsOn
fprotais b902364
Adding eigen depend
fprotais bde9b9a
Fixing correct input in doxyfile for example to show-up
fprotais 0385457
Improving projection API to converge to MeshDomain
fprotais 68a5085
Compiling fix
fprotais 2c94f6a
Changes after review
fprotais ffdb6fb
minor tweak
fprotais 346f309
Addressing seb's comments
fprotais 0e6a1d5
working around license checker
sloriot bdae338
fix license
sloriot 15af80c
fix license checking
sloriot d64000f
Update Mesh_smoothing_3/doc/Mesh_smoothing_3/Concepts/TangentSpace.h
fprotais c0c65fe
trailing whitespace
janetournois 9538d68
set correct license
sloriot 5dd1a42
trailing white spaces
sloriot 265a183
Compilation fixes
fprotais f63ca47
More compilation fixes for github action
fprotais 596b3a7
add missing dependencies
sloriot 80ba970
Adding return type of function
fprotais 5bedda1
missing license
sloriot 20b04a7
trailing whitespaces
sloriot 1f62116
missing inline
sloriot da699c3
Cleaning documentation and updating file structure
fprotais 93201fe
White spaces
fprotais a7c5b2b
Fixing compilation and relocating heavy definitions to a specific file
fprotais 66042a1
change exact predicate order
fprotais 7cb94d9
Initial test procedure by copilot agent
fprotais d14d89d
Fixed tests and adding warning for untangling
fprotais a47bbf3
Trailing whitespaces
fprotais 394fedc
Updating 0. to be ignored default and improved test
fprotais 4a7b9f7
Fixing tests and not moving fixed points at all.
fprotais ad07588
Improving tests
fprotais 03143aa
Typo
fprotais baff3dc
Trailing whitespaces
fprotais a68d048
fix eigen requirement
sloriot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // Copyright (c) 2016 GeometryFactory SARL (France). | ||
| // All rights reserved. | ||
| // | ||
| // This file is part of CGAL (www.cgal.org) | ||
| // | ||
| // $URL$ | ||
| // $Id$ | ||
| // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial | ||
| // | ||
| // Author(s) : Andreas Fabri | ||
| // | ||
| // Warning: this file is generated, see include/CGAL/license/README.md | ||
|
|
||
| #ifndef CGAL_LICENSE_MESH_SMOOTHING_3_H | ||
| #define CGAL_LICENSE_MESH_SMOOTHING_3_H | ||
|
|
||
| #include <CGAL/config.h> | ||
| #include <CGAL/license.h> | ||
|
|
||
| #ifdef CGAL_MESH_SMOOTHING_3_COMMERCIAL_LICENSE | ||
|
|
||
| # if CGAL_MESH_SMOOTHING_3_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE | ||
|
|
||
| # if defined(CGAL_LICENSE_WARNING) | ||
|
|
||
| CGAL_pragma_warning("Your commercial license for CGAL does not cover " | ||
| "this release of the 3D Mesh Smoothing package.") | ||
| # endif | ||
|
|
||
| # ifdef CGAL_LICENSE_ERROR | ||
| # error "Your commercial license for CGAL does not cover this release \ | ||
| of the 3D Mesh Smoothing package. \ | ||
| You get this error, as you defined CGAL_LICENSE_ERROR." | ||
| # endif // CGAL_LICENSE_ERROR | ||
|
|
||
| # endif // CGAL_MESH_SMOOTHING_3_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE | ||
|
|
||
| #else // no CGAL_MESH_SMOOTHING_3_COMMERCIAL_LICENSE | ||
|
|
||
| # if defined(CGAL_LICENSE_WARNING) | ||
| CGAL_pragma_warning("\nThe macro CGAL_MESH_SMOOTHING_3_COMMERCIAL_LICENSE is not defined." | ||
| "\nYou use the CGAL 3D Mesh Smoothing package under " | ||
| "the terms of the GPLv3+.") | ||
| # endif // CGAL_LICENSE_WARNING | ||
|
|
||
| # ifdef CGAL_LICENSE_ERROR | ||
| # error "The macro CGAL_MESH_SMOOTHING_3_COMMERCIAL_LICENSE is not defined.\ | ||
| You use the CGAL 3D Mesh Smoothing package under the terms of \ | ||
| the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR." | ||
| # endif // CGAL_LICENSE_ERROR | ||
|
|
||
| #endif // no CGAL_MESH_SMOOTHING_3_COMMERCIAL_LICENSE | ||
|
|
||
| #endif // CGAL_LICENSE_MESH_SMOOTHING_3_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
Mesh_smoothing_3/doc/Mesh_smoothing_3/Concepts/ConstructTangentSpace.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /*! | ||
| \ingroup pkgMeshSmoothing3Concepts | ||
| \cgalConcept | ||
|
|
||
| The concept `ConstructTangentSpace` describes projection of mesh facets on target surfaces and | ||
| mesh edge on target feature curves. | ||
|
|
||
| \cgalHasModelsBegin | ||
| \cgalHasModels{CGAL::Mesh_smoothing_3::C3t3_mesh_projector} | ||
| \cgalHasModels{CGAL::Mesh_smoothing_3::C3t3_no_projection} | ||
| \cgalHasModelsEnd | ||
|
|
||
| \sa `CGAL::boundary_aware_mesh_smoothing` | ||
|
|
||
| */ | ||
| class ConstructTangentSpace { | ||
| public: | ||
|
|
||
| /// \name Types | ||
| /// @{ | ||
|
|
||
| /*! | ||
| Model of `MeshComplex_3InTriangulation_3` | ||
| */ | ||
| using C3t3 = unspecified_type; | ||
|
|
||
| /*! | ||
| Geom_traits | ||
| */ | ||
| using Geom_traits = typename C3t3::Triangulation::Geom_traits; | ||
|
|
||
|
|
||
| /*! | ||
| Point type. | ||
| */ | ||
| using Point_3 = Geom_traits::Point_3; | ||
|
|
||
|
|
||
| /*! | ||
| Face associated with a patch | ||
| */ | ||
| using Patch_face = std::pair<C3t3::Surface_patch_index, C3t3::Facet>; | ||
|
|
||
| /*! | ||
| Edge associated with a curve | ||
| */ | ||
| using Curve_edge = std::pair<C3t3::Curve_index, C3t3::Edge>; | ||
|
|
||
| /*! | ||
| Model of `TangentSpace` | ||
| */ | ||
| using Tangent_space = unspecified_type; | ||
|
|
||
|
|
||
| /// @} | ||
|
|
||
|
|
||
| /// \name Operations | ||
| /// The following functions are used to project entities | ||
| /// @{ | ||
|
|
||
| /*! | ||
| returns a plane tangent to the patch to which its facet should align too. | ||
| The list of Point_3 contains its current vertices location. | ||
| */ | ||
| Tangent_space patch_face_projection_plane(Patch_face patch_face, std::vector<Point_3> face_points) const; | ||
|
|
||
|
|
||
| /*! | ||
| returns a line tangent to the curve to which its edge should align too. | ||
| The array contains the two current locations of its vertices. | ||
| */ | ||
| Tangent_space curve_edge_projection_line(Curve_edge curve_edge, std::array<Point_3,2> edge_points) const; | ||
|
|
||
|
|
||
| /// @} | ||
|
|
||
|
|
||
|
|
||
| }; /* end ConstructTangentSpace */ |
80 changes: 80 additions & 0 deletions
80
Mesh_smoothing_3/doc/Mesh_smoothing_3/Concepts/MeshDataStructure.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /*! | ||
| \ingroup pkgMeshSmoothing3Concepts | ||
| \cgalConcept | ||
|
|
||
| The concept `MeshDataStructure` describes the way the tetrahedral mesh will be accessed and modified. | ||
|
|
||
| \sa `CGAL::Mesh_smoothing_3::Mesh_smoother` | ||
|
|
||
| */ | ||
| class MeshDataStructure { | ||
| public: | ||
|
|
||
| /// \name Types | ||
| /// @{ | ||
|
|
||
| /*! | ||
| Descriptor used to access a cell (tetrahedron) information | ||
| */ | ||
| using Cell_descriptor = unspecified_type; | ||
|
|
||
|
|
||
| /*! | ||
| Descriptor used to access a vertex information | ||
| */ | ||
| using Vertex_descriptor = unspecified_type; | ||
|
|
||
|
|
||
| /*! | ||
| Point type. | ||
| */ | ||
| using Point_3 = unspecified_type; | ||
|
|
||
| /// @} | ||
|
|
||
| /// \name Operations | ||
| /// The following functions are used to access and modify the mesh data: | ||
| /// @{ | ||
|
|
||
| /*! | ||
| std::size_t is optional but will avoid warnings. | ||
| */ | ||
| std::size_t nb_cells() const; | ||
|
|
||
| /*! | ||
|
|
||
| */ | ||
| std::size_t nb_vertices() const; | ||
|
|
||
| /*! | ||
| Access the coordinates of a vertex. | ||
| */ | ||
| Point_3 vertex_coordinates(Vertex_descriptor vertex) const; | ||
|
|
||
| /*! | ||
| Change the coordinates of a vertex. | ||
| */ | ||
| void set_vertex_coordinates(Vertex_descriptor vertex, Point_3 coord); | ||
|
|
||
| /*! | ||
| Provide an iterable range over the Cell_descriptors of the mesh | ||
| */ | ||
| unspecified_type cell_range() const; | ||
|
|
||
| /*! | ||
| Access the 4 vertices of a cell. | ||
| Returns container behaving like std::array<Vertex_descriptor, 4> | ||
| */ | ||
| unspecified_type cell_vertices(Cell_descriptor cell) const; | ||
|
|
||
| /*! | ||
| Optimal shape of the given cell. | ||
| Returns container behaving like std::array<Point_3, 4> | ||
| */ | ||
| unspecified_type cell_reference_shape(Cell_descriptor cell) const; | ||
|
|
||
| /// @} | ||
|
|
||
|
|
||
|
|
||
| }; /* end MeshDataStructure */ |
63 changes: 63 additions & 0 deletions
63
Mesh_smoothing_3/doc/Mesh_smoothing_3/Concepts/PolylinesDataStructure.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| /*! | ||
| \ingroup pkgMeshSmoothing3Concepts | ||
| \cgalConcept | ||
|
|
||
| The concept `PolylinesDataStructure` describes the way the curves on the mesh will be accessed. | ||
|
|
||
| \sa `CGAL::Mesh_smoothing_3::Mesh_smoother` | ||
| \sa `MeshDataStructure` | ||
| \sa `SurfaceDataStructure` | ||
|
|
||
| */ | ||
| class PolylinesDataStructure { | ||
| public: | ||
|
|
||
| /// \name Types | ||
| /// @{ | ||
|
|
||
| /*! | ||
| Descriptor used to access a edge information | ||
| */ | ||
| using Edge_descriptor = unspecified_type; | ||
|
|
||
| /*! | ||
| Index associated with an edge to identify the curve it belongs to. This is used to query the curve information from the user. | ||
| */ | ||
| using Curve_index = unspecified_type; | ||
|
|
||
| /*! | ||
| Descriptor used to access a vertex information. Must be compatible with the one used in MeshDataStructure. | ||
| */ | ||
| using Vertex_descriptor = unspecified_type; | ||
|
|
||
|
|
||
| /// @} | ||
|
|
||
| /// \name Operations | ||
| /// The following functions are used to access surface data: | ||
| /// @{ | ||
|
|
||
| /*! | ||
| std::size_t is optional but will avoid warnings. | ||
| */ | ||
| std::size_t nb_edges() const; | ||
|
|
||
| /*! | ||
| Provides an iterable range over the Edge_descriptor of the mesh | ||
| */ | ||
| unspecified_type edge_range() const; | ||
|
|
||
| /*! | ||
| Returns an identifier (curve id, segment id, ...) related to an edge. | ||
| */ | ||
| Curve_index curve_id(Edge_descriptor edge) const; | ||
|
|
||
| /*! | ||
| Return the ith vertex of an edge (max 2). | ||
| */ | ||
| Vertex_descriptor edge_vertex(Edge_descriptor edge, unsigned i) const; | ||
|
|
||
| /// @} | ||
|
|
||
|
|
||
| }; /* end PolylinesDataStructure */ |
68 changes: 68 additions & 0 deletions
68
Mesh_smoothing_3/doc/Mesh_smoothing_3/Concepts/SurfaceDataStructure.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /*! | ||
| \ingroup pkgMeshSmoothing3Concepts | ||
| \cgalConcept | ||
|
|
||
| The concept `SurfaceDataStructure` describes the way the surface mesh will be accessed. | ||
|
|
||
| \sa `CGAL::Mesh_smoothing_3::Mesh_smoother` | ||
| \sa `MeshDataStructure` | ||
|
|
||
| */ | ||
| class SurfaceDataStructure { | ||
| public: | ||
|
|
||
| /// \name Types | ||
| /// @{ | ||
|
|
||
| /*! | ||
| Descriptor used to access face information | ||
| */ | ||
| using Face_descriptor = unspecified_type; | ||
|
|
||
|
|
||
| /*! | ||
| Vector type. | ||
| */ | ||
| using Normal_3 = unspecified_type; | ||
|
|
||
| /*! | ||
| Index associated with a surface patch to identify the patch it belongs to. This is used to query the patch information from the user. | ||
| */ | ||
| using Surface_patch_index = unspecified_type; | ||
|
|
||
| /// @} | ||
|
|
||
| /// \name Operations | ||
| /// The following functions are used to access surface data: | ||
| /// @{ | ||
|
|
||
| /*! | ||
| std::size_t is optional but will avoid warnings. | ||
| */ | ||
| std::size_t nb_faces() const; | ||
|
|
||
| /*! | ||
| Provides an iterable range over the Face_descriptor of the mesh | ||
| */ | ||
| unspecified_type face_range() const; | ||
|
|
||
| /*! | ||
| Returns the number of vertices of a face. std::size_t is optional but will avoid warnings. | ||
| */ | ||
| std::size_t nb_face_vertices(Face_descriptor face) const; | ||
|
|
||
| /*! | ||
| Returns an identifier (patch id, face id, ...) related to a face. | ||
| */ | ||
| Surface_patch_index patch_id(Face_descriptor face) const; | ||
|
|
||
| /*! | ||
| Provides an iterable range of Vertex_descriptor as defined in `MeshDataStructure` to iterate over the vertices of a face. | ||
| */ | ||
| unspecified_type face_vertices(Face_descriptor face) const; | ||
|
|
||
| /// @} | ||
|
|
||
|
|
||
|
|
||
| }; /* end SurfaceDataStructure */ | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
std::size_t must be backticked.
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.
What do you mean with "optional" ? That it may also be
intor evenvoid?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.
What would be the "less wordy" way to have a "size_type" instead of std::size_t? Triangulation_3 use its own typedef, but here I would see it as unecessary. Do I just use std::size_t?
(Regarding the backticked, I didn't find another example, it would just be
std::size_t?)