Apply suggestions from code review

Co-authored-by: Mael <mael.rouxel.labbe@geometryfactory.com>
Co-authored-by: Andreas Fabri <andreas.fabri@geometryfactory.com>
This commit is contained in:
lvalque 2025-09-11 15:20:16 +02:00 committed by GitHub
parent 25aa21635a
commit c8110a71eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 17 additions and 20 deletions

View File

@ -89,9 +89,6 @@ std::string getFileNameWithoutExtension(const std::string& filePath) {
return path.stem().string(); // 'stem' gets the filename without extension
}
// Usage:
// ./command [input] [ratio] [policy] [output]
// policy can be "cp" (classic plane), "ct" (classic triangle), "pp" (probabilistic plane), "pt" (probabilistic triangle)
int main(int argc, char** argv)
{
Surface_mesh mesh;

View File

@ -4,7 +4,7 @@ namespace Surface_mesh_simplification {
/*!
\ingroup PkgSurfaceMeshSimplificationRef
since \cgal 6.2, this class is an alias for the current state of the art of Garland-Heckbert policies
This class is an alias for the current state-of-the-art Garland-Heckbert policies
(Section \ref SurfaceMeshSimplificationGarlandHeckbertStrategy).
It is currently an alias of `GarlandHeckbert_plane_and_line_policies`.

View File

@ -188,11 +188,11 @@ face normals). This variance naturally deteriorates the tightness of the result,
hand it enables creating more uniform triangulations and the approach is more tolerant to noise,
while still maintaining feature sensitivity.
Another extension of the GarlandHeckbert approach was introduced by Liu et al. \cgalCite{10.1111:cgf.70184}, who
proposed the concept of line quadrics. In these quadrics, the cost is defined as the distance to the line passing
through the input vertices and aligned with their normals. These line quadrics are combined with the traditional
plane quadrics, but with a small weight (0.01 by default), producing more uniform triangulations while preserving
the tightness of the approximation.
Another extension of the GarlandHeckbert approach was introduced by Liu et al. \cgalCite{10.1111:cgf.70184},
who enhance the classic plane-based quadric error metrics with line quadrics.
More precisely, line quadrics, which encode the distance to a line, are defined at all input vertices using the supporting lines of the normals.
These quadrics are then combined with the classic plane quadrics, but with a small weight (0.01 by default).
This results in more uniform triangulations, while preserving the tightness of the approximation.
\cgalFigureAnchor{SurfaceMeshSimplification_GH}
<center>
@ -406,7 +406,7 @@ steps of the simplification algorithm.
Each Garland-Heckbert simplification strategy is implemented with a single class that regroups
both the cost and the placement policies, which must be used together as they share vertex quadric data.
The state of the art strategy of using plane-based quadric error metrics plus line-base quadric error metrics is implemented with the class
The state-of-the-art strategy of combining plane and line-based quadric error metrics is implemented with the class
`Surface_mesh_simplification::GarlandHeckbert_policies`.
Although both policies must be used together, it is still possible to wrap either policy
using behavior modifiers such as `Surface_mesh_simplification::Bounded_normal_change_placement`.
@ -426,7 +426,7 @@ The implementation of the Garland-Heckbert simplification policies is the result
of Baskın Şenbaşlar (Google Summer of Code 2019), and Julian Komaromy (Google Summer of Code 2021)
They both were mentored by Mael Rouxel-Labbé, who also contributed to the code and to the documentation.
Léo Valque added the `GarlandHeckbert_plane_and_line_policies` functionality in \cgal 6.2.
Léo Valque added the `Surface_mesh_simplification::GarlandHeckbert_plane_and_line_policies` functionality in \cgal 6.2.
*/
} /* namespace CGAL */

View File

@ -43,7 +43,7 @@ public:
public:
GarlandHeckbert_plane_and_line_policies(TriangleMesh& tmesh,
const FT line_weight=FT(0.01),
const FT line_weight = FT(0.01),
const FT dm = FT(100))
: Base(tmesh, FT(1.)/line_weight, dm)
{ }

View File

@ -280,8 +280,8 @@ construct_optimal_point_singular(const typename GarlandHeckbert_matrix_types<Geo
#else
/*
Note:
A simpler code for the case of an not invertible matrix
Experiments that the results is identical to above in the majority of the cases and nearly identical runtime
A simpler code for the case of a non-invertible matrix
Experiments show that the results are identical to the version above in the majority of the cases, and nearly identical runtime
Therefore old case was kept.
*/
@ -550,9 +550,9 @@ construct_line_quadric_from_normal(const typename GeomTraits::Vector_3& normal,
auto c_point = gt.construct_point_3_object();
auto base= gt.construct_base_vector_3_object();
Vector_3 x=base(plane(c_point(0,0,0),normal), 1);
Vector_3 x = base(plane(c_point(0,0,0),normal), 1);
CGAL::Polygon_mesh_processing::internal::normalize(x, gt);
Vector_3 y=cp(x,normal);
Vector_3 y = cp(x,normal);
return construct_classic_plane_quadric_from_normal(x, point, gt)+construct_classic_plane_quadric_from_normal(y, point, gt);
}