pmp-library  1.0
SurfaceMesh Class Reference

A halfedge data structure for polygonal meshes. More...

#include <pmp/SurfaceMesh.h>

Inheritance diagram for SurfaceMesh:
SurfaceMeshGL

Classes

class  EdgeContainer
 helper class for iterating through all edges using range-based for-loops. More...
 
class  EdgeIterator
 this class iterates linearly over all edges More...
 
class  FaceAroundVertexCirculator
 this class circulates through all incident faces of a vertex. More...
 
class  FaceContainer
 helper class for iterating through all faces using range-based for-loops. More...
 
class  FaceIterator
 this class iterates linearly over all faces More...
 
class  HalfedgeAroundFaceCirculator
 this class circulates through all halfedges of a face. More...
 
class  HalfedgeAroundVertexCirculator
 this class circulates through all outgoing halfedges of a vertex. More...
 
class  HalfedgeContainer
 helper class for iterating through all halfedges using range-based for-loops. More...
 
class  HalfedgeIterator
 this class iterates linearly over all halfedges More...
 
class  VertexAroundFaceCirculator
 this class circulates through the vertices of a face. More...
 
class  VertexAroundVertexCirculator
 this class circulates through all one-ring neighbors of a vertex. More...
 
class  VertexContainer
 helper class for iterating through all vertices using range-based for-loops. More...
 
class  VertexIterator
 An iterator class to iterate linearly over all vertices. More...
 

Public Member Functions

Construction, destruction, assignment
 SurfaceMesh ()
 default constructor
 
 ~SurfaceMesh ()
 destructor
 
 SurfaceMesh (const SurfaceMesh &rhs)
 copy constructor: copies rhs to *this. More...
 
SurfaceMeshoperator= (const SurfaceMesh &rhs)
 assign rhs to *this. performs a deep copy of all properties.
 
SurfaceMeshassign (const SurfaceMesh &rhs)
 assign rhs to *this. does not copy custom properties.
 
File IO
bool read (const std::string &filename, const IOFlags &flags=IOFlags())
 Read mesh from file filename controlled by flags. More...
 
bool write (const std::string &filename, const IOFlags &flags=IOFlags()) const
 Write mesh to file filename controlled by flags. More...
 
Add new elements by hand
Vertex add_vertex (const Point &p)
 add a new vertex with position p
 
Face add_face (const std::vector< Vertex > &vertices)
 add a new face with vertex list vertices More...
 
Face add_triangle (Vertex v0, Vertex v1, Vertex v2)
 add a new triangle connecting vertices v0, v1, v2 More...
 
Face add_quad (Vertex v0, Vertex v1, Vertex v2, Vertex v3)
 add a new quad connecting vertices v0, v1, v2, v3 More...
 
Memory Management
size_t vertices_size () const
 returns number of (deleted and valid) vertices in the mesh
 
size_t halfedges_size () const
 returns number of (deleted and valid)halfedge in the mesh
 
size_t edges_size () const
 returns number of (deleted and valid)edges in the mesh
 
size_t faces_size () const
 returns number of (deleted and valid)faces in the mesh
 
size_t n_vertices () const
 returns number of vertices in the mesh
 
size_t n_halfedges () const
 returns number of halfedge in the mesh
 
size_t n_edges () const
 returns number of edges in the mesh
 
size_t n_faces () const
 returns number of faces in the mesh
 
bool is_empty () const
 returns true iff the mesh is empty, i.e., has no vertices
 
void clear ()
 clear mesh: remove all vertices, edges, faces
 
void free_memory ()
 remove unused memory from vectors
 
void reserve (size_t nvertices, size_t nedges, size_t nfaces)
 reserve memory (mainly used in file readers)
 
void garbage_collection ()
 remove deleted elements
 
bool is_deleted (Vertex v) const
 returns whether vertex v is deleted More...
 
bool is_deleted (Halfedge h) const
 returns whether halfedge h is deleted More...
 
bool is_deleted (Edge e) const
 returns whether edge e is deleted More...
 
bool is_deleted (Face f) const
 returns whether face f is deleted More...
 
bool is_valid (Vertex v) const
 return whether vertex v is valid, i.e. More...
 
bool is_valid (Halfedge h) const
 return whether halfedge h is valid, i.e. More...
 
bool is_valid (Edge e) const
 return whether edge e is valid, i.e. the index is stores it within the array bounds.
 
bool is_valid (Face f) const
 returns whether the face f is valid.
 
Low-level connectivity
Halfedge halfedge (Vertex v) const
 returns an outgoing halfedge of vertex v. More...
 
void set_halfedge (Vertex v, Halfedge h)
 set the outgoing halfedge of vertex v to h
 
bool is_boundary (Vertex v) const
 returns whether v is a boundary vertex
 
bool is_isolated (Vertex v) const
 returns whether v is isolated, i.e., not incident to any edge
 
bool is_manifold (Vertex v) const
 returns whether v is a manifold vertex (not incident to several patches)
 
Vertex to_vertex (Halfedge h) const
 returns the vertex the halfedge h points to
 
Vertex from_vertex (Halfedge h) const
 returns the vertex the halfedge h emanates from
 
void set_vertex (Halfedge h, Vertex v)
 sets the vertex the halfedge h points to to v
 
Face face (Halfedge h) const
 returns the face incident to halfedge h
 
void set_face (Halfedge h, Face f)
 sets the incident face to halfedge h to f
 
Halfedge next_halfedge (Halfedge h) const
 returns the next halfedge within the incident face
 
void set_next_halfedge (Halfedge h, Halfedge nh)
 sets the next halfedge of h within the face to nh
 
void set_prev_halfedge (Halfedge h, Halfedge ph)
 sets the previous halfedge of h and the next halfedge of ph to nh
 
Halfedge prev_halfedge (Halfedge h) const
 returns the previous halfedge within the incident face
 
Halfedge opposite_halfedge (Halfedge h) const
 returns the opposite halfedge of h
 
Halfedge ccw_rotated_halfedge (Halfedge h) const
 returns the halfedge that is rotated counter-clockwise around the start vertex of h. More...
 
Halfedge cw_rotated_halfedge (Halfedge h) const
 returns the halfedge that is rotated clockwise around the start vertex of h. More...
 
Edge edge (Halfedge h) const
 return the edge that contains halfedge h as one of its two halfedges. More...
 
bool is_boundary (Halfedge h) const
 returns whether h is a boundary halfege, i.e., if its face does not exist.
 
Halfedge halfedge (Edge e, unsigned int i) const
 returns the i'th halfedge of edge e. i has to be 0 or 1.
 
Vertex vertex (Edge e, unsigned int i) const
 returns the i'th vertex of edge e. i has to be 0 or 1.
 
Face face (Edge e, unsigned int i) const
 returns the face incident to the i'th halfedge of edge e. i has to be 0 or 1.
 
bool is_boundary (Edge e) const
 returns whether e is a boundary edge, i.e., if one of its halfedges is a boundary halfedge. More...
 
Halfedge halfedge (Face f) const
 returns a halfedge of face f
 
void set_halfedge (Face f, Halfedge h)
 sets the halfedge of face f to h
 
bool is_boundary (Face f) const
 returns whether f is a boundary face, i.e., it one of its edges is a boundary edge.
 
Property handling
template<class T >
ObjectProperty< T > add_object_property (const std::string &name, const T t=T())
 add a object property of type T with name name and default value t. More...
 
template<class T >
ObjectProperty< T > get_object_property (const std::string &name) const
 get the object property named name of type T. More...
 
template<class T >
ObjectProperty< T > object_property (const std::string &name, const T t=T())
 if a object property of type T with name name exists, it is returned. More...
 
template<class T >
void remove_object_property (ObjectProperty< T > &p)
 remove the object property p
 
const std::type_info & get_object_propertyType (const std::string &name)
 get the type_info T of face property named name. More...
 
std::vector< std::string > object_properties () const
 returns the names of all face properties
 
template<class T >
VertexProperty< T > add_vertex_property (const std::string &name, const T t=T())
 add a vertex property of type T with name name and default value t. More...
 
template<class T >
VertexProperty< T > get_vertex_property (const std::string &name) const
 get the vertex property named name of type T. More...
 
template<class T >
VertexProperty< T > vertex_property (const std::string &name, const T t=T())
 if a vertex property of type T with name name exists, it is returned. More...
 
template<class T >
void remove_vertex_property (VertexProperty< T > &p)
 remove the vertex property p
 
bool has_vertex_property (const std::string &name) const
 does the mesh have a vertex property with name name?
 
template<class T >
HalfedgeProperty< T > add_halfedge_property (const std::string &name, const T t=T())
 add a halfedge property of type T with name name and default value t. More...
 
template<class T >
EdgeProperty< T > add_edge_property (const std::string &name, const T t=T())
 add a edge property of type T with name name and default value t. More...
 
template<class T >
HalfedgeProperty< T > get_halfedge_property (const std::string &name) const
 get the halfedge property named name of type T. More...
 
template<class T >
EdgeProperty< T > get_edge_property (const std::string &name) const
 get the edge property named name of type T. More...
 
template<class T >
HalfedgeProperty< T > halfedge_property (const std::string &name, const T t=T())
 if a halfedge property of type T with name name exists, it is returned. More...
 
template<class T >
EdgeProperty< T > edge_property (const std::string &name, const T t=T())
 if an edge property of type T with name name exists, it is returned. More...
 
template<class T >
void remove_halfedge_property (HalfedgeProperty< T > &p)
 remove the halfedge property p
 
bool has_halfedge_property (const std::string &name) const
 does the mesh have a halfedge property with name name?
 
template<class T >
void remove_edge_property (EdgeProperty< T > &p)
 remove the edge property p
 
bool has_edge_property (const std::string &name) const
 does the mesh have an edge property with name name?
 
const std::type_info & get_halfedge_property_type (const std::string &name)
 get the type_info T of halfedge property named name. More...
 
const std::type_info & get_vertex_property_type (const std::string &name)
 get the type_info T of vertex property named name. More...
 
const std::type_info & get_edge_property_type (const std::string &name)
 get the type_info T of edge property named name. More...
 
std::vector< std::string > vertex_properties () const
 returns the names of all vertex properties
 
std::vector< std::string > halfedge_properties () const
 returns the names of all halfedge properties
 
std::vector< std::string > edge_properties () const
 returns the names of all edge properties
 
template<class T >
FaceProperty< T > add_face_property (const std::string &name, const T t=T())
 add a face property of type T with name name and default value t. More...
 
template<class T >
FaceProperty< T > get_face_property (const std::string &name) const
 get the face property named name of type T. More...
 
template<class T >
FaceProperty< T > face_property (const std::string &name, const T t=T())
 if a face property of type T with name name exists, it is returned. More...
 
template<class T >
void remove_face_property (FaceProperty< T > &p)
 remove the face property p
 
bool has_face_property (const std::string &name) const
 does the mesh have a face property with name name?
 
const std::type_info & get_face_property_type (const std::string &name)
 get the type_info T of face property named name . More...
 
std::vector< std::string > face_properties () const
 returns the names of all face properties
 
void property_stats () const
 prints the names of all properties
 
Iterators and circulators
VertexIterator vertices_begin () const
 returns start iterator for vertices
 
VertexIterator vertices_end () const
 returns end iterator for vertices
 
VertexContainer vertices () const
 returns vertex container for C++11 range-based for-loops
 
HalfedgeIterator halfedges_begin () const
 returns start iterator for halfedges
 
HalfedgeIterator halfedges_end () const
 returns end iterator for halfedges
 
HalfedgeContainer halfedges () const
 returns halfedge container for C++11 range-based for-loops
 
EdgeIterator edges_begin () const
 returns start iterator for edges
 
EdgeIterator edges_end () const
 returns end iterator for edges
 
EdgeContainer edges () const
 returns edge container for C++11 range-based for-loops
 
VertexAroundVertexCirculator vertices (Vertex v) const
 returns circulator for vertices around vertex v
 
HalfedgeAroundVertexCirculator halfedges (Vertex v) const
 returns circulator for outgoing halfedges around vertex v
 
FaceIterator faces_begin () const
 returns start iterator for faces
 
FaceIterator faces_end () const
 returns end iterator for faces
 
FaceContainer faces () const
 returns face container for C++11 range-based for-loops
 
FaceAroundVertexCirculator faces (Vertex v) const
 returns circulator for faces around vertex v
 
VertexAroundFaceCirculator vertices (Face f) const
 returns circulator for vertices of face f
 
HalfedgeAroundFaceCirculator halfedges (Face f) const
 returns circulator for halfedges of face f
 
Higher-level Topological Operations
Halfedge insert_vertex (Edge e, const Point &p)
 Subdivide the edge e = (v0,v1) by splitting it into the two edge (v0,p) and (p,v1). More...
 
Halfedge insert_vertex (Edge e, Vertex v)
 Subdivide the edge e = (v0,v1) by splitting it into the two edge (v0,v) and (v,v1). More...
 
Halfedge insert_vertex (Halfedge h0, Vertex v)
 Subdivide the edge e = (v0,v1) by splitting it into the two edge (v0,v) and (v,v1). More...
 
Halfedge find_halfedge (Vertex start, Vertex end) const
 find the halfedge from start to end
 
Edge find_edge (Vertex a, Vertex b) const
 find the edge (a,b)
 
bool is_triangle_mesh () const
 returns whether the mesh a triangle mesh. More...
 
bool is_quad_mesh () const
 returns whether the mesh a quad mesh. More...
 
void triangulate ()
 triangulate the entire mesh, by calling triangulate(Face) for each face. More...
 
void triangulate (Face f)
 triangulate the face f. More...
 
bool is_collapse_ok (Halfedge v0v1)
 returns whether collapsing the halfedge v0v1 is topologically legal. More...
 
void collapse (Halfedge h)
 Collapse the halfedge h by moving its start vertex into its target vertex. More...
 
Vertex split (Face f, const Point &p)
 Split the face f by first adding point p to the mesh and then inserting edges between p and the vertices of f. More...
 
void split (Face f, Vertex v)
 Split the face f by inserting edges between p and the vertices of f. More...
 
Halfedge split (Edge e, const Point &p)
 Split the edge e by first adding point p to the mesh and then connecting it to the two vertices of the adjacent triangles that are opposite to edge e. More...
 
Halfedge split (Edge e, Vertex v)
 Split the edge e by connecting vertex v it to the two vertices of the adjacent triangles that are opposite to edge e. More...
 
Halfedge insert_edge (Halfedge h0, Halfedge h1)
 insert edge between the to-vertices v0 of h0 and v1 of h1. More...
 
bool is_flip_ok (Edge e) const
 Check whether flipping edge e is topologically. More...
 
void flip (Edge e)
 Flip the edge e . More...
 
size_t valence (Vertex v) const
 returns the valence (number of incident edges or neighboring vertices) of vertex v. More...
 
size_t valence (Face f) const
 returns the valence of face f (its number of vertices)
 
void delete_vertex (Vertex v)
 deletes the vertex v from the mesh
 
void delete_edge (Edge e)
 deletes the edge e from the mesh
 
void delete_face (Face f)
 deletes the face f from the mesh
 
Geometry-related Functions
const Pointposition (Vertex v) const
 position of a vertex (read only)
 
Pointposition (Vertex v)
 position of a vertex
 
std::vector< Point > & positions ()
 vector of point positions, re-implemented from GeometryObject
 
BoundingBox bounds ()
 compute the bounding box of the object
 
Scalar edge_length (Edge e) const
 compute the length of edge e.
 

Detailed Description

A halfedge data structure for polygonal meshes.

Constructor & Destructor Documentation

SurfaceMesh ( const SurfaceMesh rhs)
inline

copy constructor: copies rhs to *this.

performs a deep copy of all properties.

Member Function Documentation

EdgeProperty<T> add_edge_property ( const std::string &  name,
const T  t = T() 
)
inline

add a edge property of type T with name name and default value t.

fails if a property named name exists already, since the name has to be unique. in this case it returns an invalid property.

Face add_face ( const std::vector< Vertex > &  vertices)

add a new face with vertex list vertices

See also
add_triangle, add_quad
FaceProperty<T> add_face_property ( const std::string &  name,
const T  t = T() 
)
inline

add a face property of type T with name name and default value t.

fails if a property named name exists already, since the name has to be unique. in this case it returns an invalid property

HalfedgeProperty<T> add_halfedge_property ( const std::string &  name,
const T  t = T() 
)
inline

add a halfedge property of type T with name name and default value t.

fails if a property named name exists already, since the name has to be unique. in this case it returns an invalid property.

ObjectProperty<T> add_object_property ( const std::string &  name,
const T  t = T() 
)
inline

add a object property of type T with name name and default value t.

fails if a property named name exists already, since the name has to be unique. in this case it returns an invalid property

Face add_quad ( Vertex  v0,
Vertex  v1,
Vertex  v2,
Vertex  v3 
)

add a new quad connecting vertices v0, v1, v2, v3

See also
add_triangle, add_face
Face add_triangle ( Vertex  v0,
Vertex  v1,
Vertex  v2 
)

add a new triangle connecting vertices v0, v1, v2

See also
add_face, add_quad
VertexProperty<T> add_vertex_property ( const std::string &  name,
const T  t = T() 
)
inline

add a vertex property of type T with name name and default value t.

fails if a property named name exists already, since the name has to be unique. in this case it returns an invalid property

Halfedge ccw_rotated_halfedge ( Halfedge  h) const
inline

returns the halfedge that is rotated counter-clockwise around the start vertex of h.

it is the opposite halfedge of the previous halfedge of h.

void collapse ( Halfedge  h)

Collapse the halfedge h by moving its start vertex into its target vertex.

For non-boundary halfedges this function removes one vertex, three edges, and two faces. For boundary halfedges it removes one vertex, two edges and one face.

Attention
This function is only valid for triangle meshes.
Halfedge collapses might lead to invalid faces. Call is_collapse_ok(Halfedge) to be sure the collapse is legal.
The removed items are only marked as deleted. You have to call garbage_collection() to finally remove them.
Halfedge cw_rotated_halfedge ( Halfedge  h) const
inline

returns the halfedge that is rotated clockwise around the start vertex of h.

it is the next halfedge of the opposite halfedge of h.

Edge edge ( Halfedge  h) const
inline

return the edge that contains halfedge h as one of its two halfedges.

EdgeProperty<T> edge_property ( const std::string &  name,
const T  t = T() 
)
inline

if an edge property of type T with name name exists, it is returned.

otherwise this property is added (with default value t)

FaceProperty<T> face_property ( const std::string &  name,
const T  t = T() 
)
inline

if a face property of type T with name name exists, it is returned.

otherwise this property is added (with default value t)

void flip ( Edge  e)

Flip the edge e .

Removes the edge e and add an edge between the two vertices opposite to edge e of the two incident triangles.

Attention
This function is only valid for triangle meshes.
Flipping an edge may result in a non-manifold mesh, hence check for yourself whether this operation is allowed or not!
See also
is_flip_ok()
EdgeProperty<T> get_edge_property ( const std::string &  name) const
inline

get the edge property named name of type T.

returns an invalid VertexProperty if the property does not exist or if the type does not match.

const std::type_info& get_edge_property_type ( const std::string &  name)
inline

get the type_info T of edge property named name.

returns an typeid(void) if the property does not exist or if the type does not match.

FaceProperty<T> get_face_property ( const std::string &  name) const
inline

get the face property named name of type T.

returns an invalid VertexProperty if the property does not exist or if the type does not match.

const std::type_info& get_face_property_type ( const std::string &  name)
inline

get the type_info T of face property named name .

returns an typeid(void) if the property does not exist or if the type does not match.

HalfedgeProperty<T> get_halfedge_property ( const std::string &  name) const
inline

get the halfedge property named name of type T.

returns an invalid VertexProperty if the property does not exist or if the type does not match.

const std::type_info& get_halfedge_property_type ( const std::string &  name)
inline

get the type_info T of halfedge property named name.

returns an typeid(void) if the property does not exist or if the type does not match.

ObjectProperty<T> get_object_property ( const std::string &  name) const
inline

get the object property named name of type T.

returns an invalid ObjectProperty if the property does not exist or if the type does not match.

const std::type_info& get_object_propertyType ( const std::string &  name)
inline

get the type_info T of face property named name.

returns an typeid(void) if the property does not exist or if the type does not match.

VertexProperty<T> get_vertex_property ( const std::string &  name) const
inline

get the vertex property named name of type T.

returns an invalid VertexProperty if the property does not exist or if the type does not match.

const std::type_info& get_vertex_property_type ( const std::string &  name)
inline

get the type_info T of vertex property named name.

returns an typeid(void) if the property does not exist or if the type does not match.

Halfedge halfedge ( Vertex  v) const
inline

returns an outgoing halfedge of vertex v.

if v is a boundary vertex this will be a boundary halfedge.

HalfedgeProperty<T> halfedge_property ( const std::string &  name,
const T  t = T() 
)
inline

if a halfedge property of type T with name name exists, it is returned.

otherwise this property is added (with default value t)

Halfedge insert_edge ( Halfedge  h0,
Halfedge  h1 
)

insert edge between the to-vertices v0 of h0 and v1 of h1.

returns the new halfedge from v0 to v1.

Attention
h0 and h1 have to belong to the same face
Halfedge insert_vertex ( Edge  e,
const Point p 
)
inline

Subdivide the edge e = (v0,v1) by splitting it into the two edge (v0,p) and (p,v1).

Note that this function does not introduce any other edge or faces. It simply splits the edge. Returns halfedge that points to p.

See also
insert_vertex(Edge, Vertex)
insert_vertex(Halfedge, Vertex)
Halfedge insert_vertex ( Edge  e,
Vertex  v 
)
inline

Subdivide the edge e = (v0,v1) by splitting it into the two edge (v0,v) and (v,v1).

Note that this function does not introduce any other edge or faces. It simply splits the edge. Returns halfedge that points to p.

See also
insert_vertex(Edge, Point)
insert_vertex(Halfedge, Vertex)
Halfedge insert_vertex ( Halfedge  h0,
Vertex  v 
)

Subdivide the edge e = (v0,v1) by splitting it into the two edge (v0,v) and (v,v1).

Note that this function does not introduce any other edge or faces. It simply splits the edge. Returns halfedge that points to p.

See also
insert_vertex(Edge, Point)
insert_vertex(Edge, Vertex)
bool is_boundary ( Edge  e) const
inline

returns whether e is a boundary edge, i.e., if one of its halfedges is a boundary halfedge.

bool is_collapse_ok ( Halfedge  v0v1)

returns whether collapsing the halfedge v0v1 is topologically legal.

Attention
This function is only valid for triangle meshes.
bool is_deleted ( Vertex  v) const
inline

returns whether vertex v is deleted

See also
garbage_collection()
bool is_deleted ( Halfedge  h) const
inline

returns whether halfedge h is deleted

See also
garbage_collection()
bool is_deleted ( Edge  e) const
inline

returns whether edge e is deleted

See also
garbage_collection()
bool is_deleted ( Face  f) const
inline

returns whether face f is deleted

See also
garbage_collection()
bool is_flip_ok ( Edge  e) const

Check whether flipping edge e is topologically.

Attention
This function is only valid for triangle meshes.
See also
flip(Edge)
bool is_quad_mesh ( ) const

returns whether the mesh a quad mesh.

this function simply tests each face, and therefore is not very efficient.

bool is_triangle_mesh ( ) const

returns whether the mesh a triangle mesh.

this function simply tests each face, and therefore is not very efficient.

See also
trianglate(), triangulate(Face)
bool is_valid ( Vertex  v) const
inline

return whether vertex v is valid, i.e.

the index is stores it within the array bounds.

bool is_valid ( Halfedge  h) const
inline

return whether halfedge h is valid, i.e.

the index is stores it within the array bounds.

ObjectProperty<T> object_property ( const std::string &  name,
const T  t = T() 
)
inline

if a object property of type T with name name exists, it is returned.

otherwise this property is added (with default value t)

bool read ( const std::string &  filename,
const IOFlags flags = IOFlags() 
)

Read mesh from file filename controlled by flags.

File extension determines file type. Supported formats and vertex attributes (a=ASCII, b=binary):

Format ASCII Binary Normals Colors Texcoords
OFF yes yes a / b a a / b
OBJ yes no a no no
STL yes yes no no no
PLY yes yes no no no
PMP no yes no no no
XYZ yes no a no no
AGI yes no a a no

In addition, the OBJ and PMP formats support reading per-halfedge texture coordinates.

Vertex split ( Face  f,
const Point p 
)
inline

Split the face f by first adding point p to the mesh and then inserting edges between p and the vertices of f.

For a triangle this is a standard one-to-three split.

See also
split(Face, Vertex)
void split ( Face  f,
Vertex  v 
)

Split the face f by inserting edges between p and the vertices of f.

For a triangle this is a standard one-to-three split.

See also
split(Face, const Point&)
Halfedge split ( Edge  e,
const Point p 
)
inline

Split the edge e by first adding point p to the mesh and then connecting it to the two vertices of the adjacent triangles that are opposite to edge e.

Returns the halfedge pointing to p that is created by splitting the existing edge e.

Attention
This function is only valid for triangle meshes.
See also
split(Edge, Vertex)
Halfedge split ( Edge  e,
Vertex  v 
)

Split the edge e by connecting vertex v it to the two vertices of the adjacent triangles that are opposite to edge e.

Returns the halfedge pointing to p that is created by splitting the existing edge e.

Attention
This function is only valid for triangle meshes.
See also
split(Edge, Point)
void triangulate ( )

triangulate the entire mesh, by calling triangulate(Face) for each face.

See also
triangulate(Face)
void triangulate ( Face  f)

triangulate the face f.

See also
triangulate()
size_t valence ( Vertex  v) const

returns the valence (number of incident edges or neighboring vertices) of vertex v.

VertexProperty<T> vertex_property ( const std::string &  name,
const T  t = T() 
)
inline

if a vertex property of type T with name name exists, it is returned.

otherwise this property is added (with default value t)

bool write ( const std::string &  filename,
const IOFlags flags = IOFlags() 
) const

Write mesh to file filename controlled by flags.

File extension determines file type. Supported formats and vertex attributes (a=ASCII, b=binary):

Format ASCII Binary Normals Colors Texcoords
OFF yes yes a a a
OBJ yes no a no no
STL yes yes no no no
PLY yes yes no no no
PMP no yes no no no
XYZ yes no a no no

In addition, the OBJ and PMP formats support writing per-halfedge texture coordinates.