CGAL 6.1 - Dynamic Skeletonization Via Variational Medial Axis Sampling
Loading...
Searching...
No Matches
Reference Manual

Qijia Huang
The package provides an implementation of a dynamic approximation of the medial axis inspired by variational shape approximation
Introduced in: CGAL 6.2
Depends on: 2D and 3D Fast Intersection and Distance Computation
BibTeX: cgal:dsvvmas-h-25b
License: GPL

Classified Reference Pages

Functions

Classes

Modules

 Traits Classes
 

Classes

class  CGAL::Medial_skeleton< TriangleMesh, GeomTraits >
 Class representing the medial skeleton of a shape. More...
 
class  CGAL::Variational_medial_axis_sampling< TriangleMesh, ConcurrencyTag, AccelerationType, GeomTraits, VertexPointMap >
 Algorithm class for extracting a variational medial skeleton from a triangulated surface mesh. More...
 

Functions

template<class TriangleMesh , class NamedParameters = parameters::Default_named_parameters>
CGAL::Medial_skeleton< TriangleMesh > CGAL::extract_variational_medial_skeleton (const TriangleMesh &tmesh, const NamedParameters &np=parameters::default_values())
 extracts a medial skeleton for the triangle mesh tmesh.
 
template<typename TriangleMesh , typename GeomTraits , class NamedParameters = parameters::Default_named_parameters>
bool CGAL::IO::write_PLY (const Medial_skeleton< TriangleMesh, GeomTraits > &skeleton, const std::string &filepath, const NamedParameters &np=parameters::default_values())
 writes the medial skeleton to a PLY file.
 
template<typename TriangleMesh , typename GeomTraits >
bool CGAL::IO::read_PLY (Medial_skeleton< TriangleMesh, GeomTraits > &skeleton, const std::string &filepath)
 loads a medial skeleton from a PLY file.
 

Function Documentation

◆ extract_variational_medial_skeleton()

template<class TriangleMesh , class NamedParameters = parameters::Default_named_parameters>
CGAL::Medial_skeleton< TriangleMesh > CGAL::extract_variational_medial_skeleton ( const TriangleMesh &  tmesh,
const NamedParameters &  np = parameters::default_values() 
)

#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(CGAL::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
TriangleMesha model of FaceListGraph
NamedParametersa sequence of Named Parameters
Parameters
tmeshinput mesh
npan optional sequence of Named Parameters, listed below:
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(10000, 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.

◆ read_PLY()

template<typename TriangleMesh , typename GeomTraits >
bool CGAL::IO::read_PLY ( Medial_skeleton< TriangleMesh, GeomTraits > &  skeleton,
const std::string &  filepath 
)

#include <CGAL/Variational_medial_axis_sampling.h>

loads a medial skeleton from a PLY file.

Parameters
skeletonthe skeleton
filepathFilepath to the PLY file containing the medial skeleton data.
Returns
true if the skeleton was successfully loaded, false otherwise.

Note: The file 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
... // N vertices
xn yn zn rn
vx vy
... // M edges
vz vw
3 v1 v2 v3
... // K faces
3 vx vy vz

◆ write_PLY()

template<typename TriangleMesh , typename GeomTraits , class NamedParameters = parameters::Default_named_parameters>
bool CGAL::IO::write_PLY ( const Medial_skeleton< TriangleMesh, GeomTraits > &  skeleton,
const std::string &  filepath,
const NamedParameters &  np = parameters::default_values() 
)

#include <CGAL/Variational_medial_axis_sampling.h>

writes the medial skeleton to a PLY file.

Template Parameters
TriangleMesha model of FaceListGraph
GeomTraitsa model of Kernel
NamedParametersa sequence of Named Parameters
Parameters
skeletonThe medial skeleton to write.
filepathThe name of the file to write to.
npoptional 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
... //N vertices
xN yN zN rN
v1 v2
... //M edges
vM vN
3 v1 v2 v3
... //K faces
3 vX vY vZ
Returns
true if writing was successful, false otherwise.