Qijia Huang
The package provides an implementation of a dynamic approximation of the medial axis inspired by variational shape approximation
Functions
Classes
|
| class | CGAL::Medial_Skeleton< TriangleMesh_, GeomTraits_ > |
| | Class representing the medial skeleton of a shape. More...
|
| |
| class | CGAL::Variational_medial_axis< TriangleMesh_, ConcurrencyTag_, AccelerationType_, GeomTraits_, VertexPointMap_ > |
| | Algorithm class for extracting a variational medial skeleton from a triangulated surface mesh. More...
|
| |
| class | CGAL::Fast_winding_number< TriangleMesh, FaceNormalMap, FaceAreaMap, FaceCentroidMap, Tree, ORDER, GeomTraits, VertexPointMap > |
| | Fast evaluation of the (normalized) winding number of a triangle mesh. More...
|
| |
◆ extract_variational_medial_skeleton()
template<class TriangleMesh , class NamedParameters = parameters::Default_named_parameters>
#include <CGAL/extract_variational_medial_skeleton.h>
extracts a medial skeleton for the triangle mesh tmesh.
This function uses the class CGAL::Variational_medial_axis_sampling with the default parameters.
- Precondition
tmesh is a triangle mesh without borders
-
The specialization
boost::property_map<TriangleMesh, CGAL::vertex_point_t>::const_type and get(vertex_point, tmesh) are defined.
-
The value type of
boost::property_map<TriangleMesh, CGAL::vertex_point_t>::const_type is a point type from a CGAL Kernel.
- Template Parameters
-
- Parameters
-
- Optional Named Parameters
-
The desired number of medial spheres in the resulting skeleton.
-
Type: unsigned int
-
Default: 100
-
Extra: This number should generally not exceed 300, as the method is designed to produce coarse skeletons.
| |
-
The number of samples on the surface mesh to use for the optimization process.
-
Type: unsigned int
-
Default: max(20000, number_of_spheres * 100)
-
Extra: The number of samples should be significantly larger than the number of spheres.(x100 at least)
| |
-
The maximum number of iterations for the optimization process.
-
Type: int
-
Default: 1000
-
Extra: This parameter must be strictly positive; setting it to zero may prevent correct skeleton connectivity construction.
| |
-
A weight balancing the two energy terms (SQEM and Euclidean). Smaller values tend to produce skeletons that follow local features more closely.
-
Type: FT
-
Default: FT(0.2)
-
Extra: The range of this parameter is (0,1].
| |
-
The random seed to sample points on the triangle mesh surface.
-
Type: unsigned int
-
Extra: Fix the random seed so that the result can be reproduced
| |
-
Tag indicating whether the algorithm should run sequentially or in parallel.
-
Type: Concurrency tag type
-
Default:
CGAL::Sequential_tag
-
Extra: Use
CGAL::Parallel_tag for parallel execution (requires TBB).
| |
-
Tag indicating the type of acceleration structure to use.
-
Type: Acceleration structure tag type
-
Default:
CGAL::KD_tree_tag
-
Extra: Use
CGAL::BVH_tag for a bounding volume hierarchy.
| |
◆ write_PLY()
template<typename TriangleMesh , typename GeomTraits , class NamedParameters = parameters::Default_named_parameters>
#include <CGAL/variational_medial_axis_sampling.h>
writes the medial skeleton to a PLY file.
- Template Parameters
-
- Parameters
-
| skeleton | The medial skeleton to write. |
| filepath | The name of the file to write to. |
| np | optional Named Parameters described below |
- Optional Named Parameters
-
a parameter used to set the precision (i.e. how many digits are generated) of the output stream
-
Type: int
-
Default: the precision of the stream
os
| |
Note: This function writes the medial skeleton to a PLY file in ASCII format. The format is :
ply
format ascii 1.0
element vertex N
property float x
property float y
property float z
property float radius
element edge M
property int vertex1
property int vertex2
element face K
property list uchar int vertex_indices
end_header
x1 y1 z1 r1
...
xN yN zN rN
v1 v2
...
vM vN
3 v1 v2 v3
...
3 vX vY vZ
- Returns
true if writing was successful, false otherwise.