PolyFEM
Loading...
Searching...
No Matches
polyfem::mesh::Polygons Namespace Reference

Typedefs

typedef std::function< void(Eigen::MatrixXd &IV, Eigen::MatrixXd &OV, std::vector< std::vector< int > > &OF)> SplitFunction
 

Functions

void polar_split (const Eigen::MatrixXd &IV, Eigen::MatrixXd &OV, std::vector< std::vector< int > > &OF, double t=0.5)
 Split a polygon using polar refinement.
 
SplitFunction polar_split_func (double t)
 Helper function.
 
void catmul_clark_split (const Eigen::MatrixXd &IV, Eigen::MatrixXd &OV, std::vector< std::vector< int > > &OF)
 Split a polygon using polar refinement.
 
SplitFunction catmul_clark_split_func ()
 
void no_split (const Eigen::MatrixXd &IV, Eigen::MatrixXd &OV, std::vector< std::vector< int > > &OF)
 Don't split polygons.
 
SplitFunction no_split_func ()
 

Typedef Documentation

◆ SplitFunction

typedef std::function<void(Eigen::MatrixXd &IV, Eigen::MatrixXd &OV, std::vector<std::vector<int>> &OF)> polyfem::mesh::Polygons::SplitFunction

Definition at line 69 of file Refinement.hpp.

Function Documentation

◆ catmul_clark_split()

void polyfem::mesh::Polygons::catmul_clark_split ( const Eigen::MatrixXd &  IV,
Eigen::MatrixXd &  OV,
std::vector< std::vector< int > > &  OF 
)

Split a polygon using polar refinement.

A single vertex is inserted at the barycenter of the polygon kernel (the polygon needs to be star-shaped). Contrary to the polar_split function, this function creates quads instead of triangles. The edges of the original polygon are also assumed to be split already, so the input polygon must have an even number of vertices. Radial edges will be inserted every 2 vertices, starting from vertex #1.

Parameters
[in]IV#IV x (2|3) of vertex positions around the polygon
OV#OF v (2|3) output vertex positions
OFlist of output polygonal face indices

Definition at line 583 of file Refinement.cpp.

References polyfem::mesh::is_star_shaped().

Referenced by catmul_clark_split_func().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ catmul_clark_split_func()

SplitFunction polyfem::mesh::Polygons::catmul_clark_split_func ( )
inline

Definition at line 106 of file Refinement.hpp.

References catmul_clark_split().

Referenced by polyfem::mesh::CMesh2D::refine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ no_split()

void polyfem::mesh::Polygons::no_split ( const Eigen::MatrixXd &  IV,
Eigen::MatrixXd &  OV,
std::vector< std::vector< int > > &  OF 
)

Don't split polygons.

Definition at line 609 of file Refinement.cpp.

Referenced by no_split_func().

Here is the caller graph for this function:

◆ no_split_func()

SplitFunction polyfem::mesh::Polygons::no_split_func ( )
inline

Definition at line 113 of file Refinement.hpp.

References no_split().

Referenced by polyfem::mesh::refine_polygonal_mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ polar_split()

void polyfem::mesh::Polygons::polar_split ( const Eigen::MatrixXd &  IV,
Eigen::MatrixXd &  OV,
std::vector< std::vector< int > > &  OF,
double  t = 0.5 
)

Split a polygon using polar refinement.

The input polygon must be star-shaped. A one-ring of quads are create on the outer ring of the polygon, while at the center a new polygonal facet is created around the barycenter of the kernel polygon. If the interpolation parameter t is equal to 0, the central polygon is collapsed into a single vertex, and facets on the ring become triangles.

Parameters
[in]IV#IV x (2|3) of vertex positions around the polygon
[out]OV#OF v (2|3) output vertex positions
[out]OFlist of output polygonal face indices
[in]tInterpolation parameter to place the new vertices on the edge from the barycenter to the outer polygon vertices (0 being at the center, 1 being at the boundary).t should be >= 0.0 and < 1.0 }

Definition at line 534 of file Refinement.cpp.

References polyfem::mesh::is_star_shaped().

Referenced by polar_split_func().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ polar_split_func()

SplitFunction polyfem::mesh::Polygons::polar_split_func ( double  t)
inline

Helper function.

Definition at line 87 of file Refinement.hpp.

References polar_split().

Referenced by polyfem::mesh::CMesh2D::refine(), and polyfem::mesh::refine_polygonal_mesh().

Here is the call graph for this function:
Here is the caller graph for this function: