-
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
52
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 all commits
Commits
Show all changes
52 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 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
| 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
93 changes: 93 additions & 0 deletions
93
Mesh_smoothing_3/doc/Mesh_smoothing_3/Concepts/C3t3Projector.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,93 @@ | ||
| /*! | ||
| \ingroup pkgMeshSmoothing3Concepts | ||
| \cgalConcept | ||
|
|
||
| The concept `C3t3Projector` 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 C3t3Projector { | ||
| public: | ||
|
|
||
| /// \name Types | ||
| /// @{ | ||
|
|
||
| /*! | ||
| Point type. | ||
| */ | ||
| using Point_3 = unspecified_type; | ||
|
|
||
|
|
||
| /*! | ||
| Vector type. | ||
| */ | ||
| using Vector_3 = unspecified_type; | ||
|
|
||
| /*! | ||
| Surface patch index | ||
| */ | ||
| using Surface_patch_index = unspecified_type; | ||
|
|
||
| /*! | ||
| Face descriptor | ||
| */ | ||
| using Facet = unspecified_type; | ||
|
|
||
| /*! | ||
| Face associated with a patch | ||
| */ | ||
| using Patch_face = std::pair<Surface_patch_index, Facet>; | ||
|
|
||
|
|
||
| /*! | ||
| Curve index | ||
| */ | ||
| using Curve_index = unspecified_type; | ||
|
|
||
| /*! | ||
| Edge descriptor | ||
| */ | ||
| using Edge = unspecified_type; | ||
|
|
||
| /*! | ||
| Edge associated with a curve | ||
| */ | ||
| using Curve_edge = `std::pair<Curve_index, Edge>`; | ||
|
|
||
|
|
||
| /// @} | ||
|
|
||
| /*! | ||
| Return the plane the patch face should align to. | ||
| */ | ||
| `std::pair<Point_3, Vector_3>` patch_projection_plane(Patch_face patch_face, Point_3 face_center, double face_radius) const; | ||
|
|
||
| /*! | ||
| Return if a patch face should be projected or not. | ||
| */ | ||
| bool project_patch_face(Patch_face patch_face) const; | ||
|
|
||
|
|
||
| /*! | ||
| Return the line the curve edge should align to. | ||
| */ | ||
| std::pair<Point_3, Vector_3> curve_projection_tangent(Curve_edge curve_edge, Point_3 edge_center, double segment_size) const; | ||
|
|
||
| /*! | ||
| Return if a curve edge should be projected or not. | ||
| */ | ||
| bool project_curve_edge(Curve_edge curve_edge) const, | ||
|
|
||
|
|
||
| /// @} | ||
|
|
||
|
|
||
|
|
||
| }; /* end MeshDataStructure */ |
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 */ | ||
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,10 @@ | ||
| @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} | ||
|
|
||
| PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Smoothing" | ||
|
|
||
| HIDE_UNDOC_MEMBERS = true | ||
| HIDE_UNDOC_CLASSES = true | ||
|
|
||
| INPUT = ${CGAL_PACKAGE_DOC_DIR}/PackageDescription.txt | ||
| INPUT += ${CGAL_PACKAGE_DOC_DIR}/Concepts/C3t3Projector.h | ||
| INPUT += ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_smoothing_3/boundary_aware_mesh_smoothing.h |
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?)