A polyhedral surface Polyhedron_3<Traits,HDS> in three dimensions consists of vertices , edges , facets and an incidence relation on them. Each edge is represented by two halfedges with opposite orientations.
Vertices represent points in space. Edges are straight line segments between two endpoints. Facets are planar polygons without holes defined by the circular sequence of halfedges along their boundary. The polyhedral surface itself is allowed to have holes. The halfedges along the boundary of a hole are called border halfedges and have no incident facets. An edge is a border edge if one of its halfedges is a border halfedge. A surface is closed if it contains no border halfedges. A closed surface is a boundary representation for polyhedra in three dimensions. The convention is that the halfedges are oriented counterclockwise around facets as seen from the outside of the polyhedron. An implication is that the halfedges are oriented clockwise around the vertices. The notion of the solid side of a facet as defined by the halfedge orientation extends to polyhedral surfaces with border edges although they do not define a closed object. If normal vectors are considered for the facets, normals point outwards (following the right hand rule).
One implication of the definition is that the polyhedral surface is always an orientable and oriented 2-manifold with border edges, i.e. the neighborhood of each point on the polyhedral surface is either homeomorphic to a disc or to a half disc, except for vertices where many holes and surfaces can meet. Another implication is that the smallest representable surface is a triangle (for polyhedral surfaces with border edges) or a tetrahedron (for polyhedra). Boundary representations of orientable 2-manifolds are closed under Euler operations. They are extended with operations that create or close holes in the surface.
Other intersections besides the incidence relation are not allowed, although they are not automatically handled, since self intersections are not easy to check efficiently. Polyhedron_3<Traits,HDS> does only maintain the combinatorial integrity of the polyhedral surface (using Euler operations) and does not consider the coordinates of the points or any geometric information.
The class Polyhedron_3<Traits,HDS> can represent polyhedral surfaces as well as polyhedra. The interface is designed in such a way that it is easy to ignore border edges and work only with polyhedra.
The sequence of edges can be ordered in the data structure on request such that the sequence starts with the non-border edges and ends with the border edges. Border edges are then itself ordered such that the halfedge which is incident to the facet came first and the halfedge incident to the hole came thereafter. This normalization step counts simultaneously the number of border edges. This number is zero if and only if the surface is a closed polyhedron. Note that this class does not maintain this counter during further modifications. There is no automatic caching done for auxiliary information.
The class Polyhedron_3<Traits,HDS> expects a model of the
Polyhedron_traits concept from Section
as a first template argument, and a model of the
Halfedge_data_structure concept from Section
with the additional requirements from Section
as a second
template argument.
#include <CGAL/Polyhedron_3.h>
| |
traits class.
| |
| |
halfedge data structure HDS.
| |
| |
vertex type.
| |
| |
halfedge type.
| |
| |
facet type.
| |
| |
type for size values.
| |
| |
type for difference values.
|
Types for the (optionally) associated geometry. If the specific item is not supported the type is void*.
| |
point stored in vertices.
| |
| |
plane equation stored in facets.
| |
| |
normal vector stored in facets.
|
The following handles, iterators and circulators have appropriate non-mutable counterparts. The mutable types are assignable to their non-mutable counterparts. Both circulators are assignable to the Halfedge_iterator. The iterators are assignable to the respective handle types. Wherever the handles appear in function parameter lists, the appropriate iterator can be used as well.
The iterator category is defined through the polyhedron traits class for all iterators. The circulators are bidirectional if the halfedge in the polyhedron traits class provides a member function prev(), otherwise they are of the forward category.
| |
handle to vertex.
| |
| |
handle to halfedge.
| |
| |
handle to facet.
| |
| |
iterator over all vertices.
| |
| |
iterator over all halfedges.
| |
| |
iterator over all facets.
| |
| |
circulator of
halfedges around a vertex.
| |
| |
circulator of
halfedges around a facet.
| |
| |
iterator category of all the iterators.
| |
| |
circulator category of all the circulators.
|
| |||
| |||
a polyhedron P with storage reserved
for vertices, halfedges, and facets. The
reservation sizes are a hint for optimizing storage
allocation.
|
|
| |||
reserves storage for vertices, halfedges, and facets. The reservation sizes are a hint for optimizing storage allocation. If the capacity is already greater than the requested size nothing happens. If the capacity changes all iterators and circulators might invalidate. | ||||
|
| |||
adds a new tetrahedron to the polyhedral surface. Returns an arbitrary halfedge of the tetrahedron. | ||||
|
| |||
adds a new tetrahedron to the polyhedral surface with its vertices initialized with and . Returns that halfedge of the tetrahedron which incident vertex is initialized with , the incident vertex of the next halfedge with , and the vertex thereafter with . The remaining fourth vertex is initialized with | ||||
|
| adds a new triangle with border edges to the polyhedral surface. Returns an arbitrary, non-border halfedge of the triangle. | ||
|
| |||
adds a new triangle with border edges to the polyhedral surface with its vertices initialized with and . Returns that non-border halfedge of the triangle which incident vertex is initialized with , the incident vertex of the next halfedge with , and the vertex thereafter with . |
|
| |
number of vertices. | ||
|
| |
number of halfedges (incl. border halfedges). | ||
|
| |
number of facets. | ||
|
| |
space reserved for vertices. | ||
|
| |
space reserved for halfedges. | ||
|
| |
space reserved for facets. | ||
|
| bytes used for the polyhedron. |
|
| |
bytes reserved for the polyhedron. | ||
|
| |
iterator over all vertices. | ||
|
| past-the-end iterator and null-handle. |
|
| |
iterator over all halfedges. | ||
|
| past-the-end iterator and null-handle. |
|
| iterator over all facets (excluding holes). |
|
| past-the-end iterator and null-handle. |
|
| returns the traits class. |
|
| |
true iff the connected component denoted by is a triangle. | ||
|
| |
true iff the connected component denoted by is a tetrahedron. |
The following Euler operations modify consistently the combinatorial structure of the polyhedral surface. The geometry remains unchanged.
|
| |
splits the facet incident to h and g into two facets
with a new diagonal between the two vertices denoted by h and
g respectively. The second (new) facet is a copy of the
first facet. It returns the new diagonal. The time is
proportional to the distance from h to g around the facet. Precondition: h and g are incident to the same facet. h != g (no loops). h->next() != g and g->next() != h (no multi-edges). | ||
|
| |
joins the two facets incident to . The facet incident to
h->opposite() gets removed. Both facets might be
holes. Returns the predecessor of around the facet. The invariant
join_facet( split_facet( h, g)) returns and keeps
the polyhedron unchanged. The time is proportional to the size of the
facet removed and the time to compute h->prev(). Precondition: HDS supports removal of halfedges and facets. The degree of both vertices incident to is at least three (no antennas). |
|
| |
splits the vertex incident to h and g into two vertices
and connects them with a new edge. The second (new) vertex is a
copy of the first vertex. It returns the new edge. The time is
proportional to the distance from h to g around the vertex. Precondition: h and g are incident to the same vertex. h != g (no antennas). | ||
|
| |
joins the two vertices incident to . The vertex denoted by
h->opposite() gets removed. Returns the predecessor of
around the vertex. The invariant
join_vertex( split_vertex( h, g)) returns
and keeps the polyhedron unchanged.
The time is proportional to the degree of the vertex removed and
the time to compute h->prev(). Precondition: HDS supports removal of vertices and halfedges. The size of both facets incident to is at least four (no multi-edges). |
|
| |||
cuts the polyhedron into two parts along the cycle .
Three new vertices (one copy for each vertex in the cycle) and
three new halfedges (one copy for each halfedge in the cycle), and
two new triangles will be
created. will be incident to the first new triangle.
The return value will be a halfedge iterator denoting the
new halfedge of the second new triangle which was h->opposite()
beforehand. Precondition: are distinct, consecutive halfedges of the polyhedron and form a cycle: i.e. h->vertex() == i->opposite()->vertex(), ..., j->vertex() == h->opposite()->vertex(). The six facets incident to are all distinct. | ||||
|
| |||
glues the boundary of two facets together.
Both facets and the vertices of the facet loop gets removed.
Returns . Both facets might be holes.
The invariant join_loop( h, split_loop( h, i, j))
returns and keeps the polyhedron unchanged. Precondition: HDS supports removal of vertices, halfedges, and facets. The facets denoted by and are different and have an equal degree (i.e. number of edges) . |
|
| |
removes the incident facet of and changes all halfedges incident
to the facet into border edges. Returns .
See erase_facet(h) for a more generalized variant. Precondition: HDS supports removal of facets. None of the incident halfedges of the facet is a border edge. | ||
|
| |
fills a hole with a newly created facet. Makes all border halfedges
of the hole denoted by incident to the new facet. Returns . Precondition: h.is_border(). |
|
| |||
creates a new facet within the hole incident to
and by connecting the tip of with the tip of
with two new halfedges and a new vertex and filling this separated
part of the hole with a new facet, such that the new facet is
incident to . Returns the halfedge of the new edge that is
incident to the new facet and the new vertex. Precondition: h->is_border(), g->is_border(), h != g, and can be reached along the same hole starting with . |
|
| |||
creates a new facet within the hole incident to
and by connecting the tip of with the tip of
with a new halfedge and filling this separated part
of the hole with a new facet, such that the new
facet is incident to . Returns the halfedge of the new edge that
is incident to the new facet. Precondition: h->is_border(), g->is_border(), h != g, h->next() != g, and can be reached along the same hole starting with . |
|
| |
removes the incident facet of and changes all halfedges incident
to the facet into border edges or removes them from the
polyhedral surface if they were already border edges.
See make_hole(h) for a more specialized variant. Precondition: HDS supports removal. | ||
|
| |
removes the vertices, halfedges, and facets that belong to the
connected component of . Precondition: HDS supports removal. | ||
|
| removes all vertices, halfedges, and facets. |
Halfedges incident to an hole are called border halfedges. An edge is a border edge if one of its two halfedges is a border halfedges. The only requirement to work with border halfedges is that the Halfedge class provides a member function is_border() returning a bool. Usually, the halfedge data structure supports facets and a NULL facet pointer will indicate a border halfedge, but this is not the only possibility. The is_border() predicate divides the edges into two classes, the border edges and the non-border edges. The following normalization reorganizes the sequential storage of the edges such that the non-border edges precedes the border edges, and that for each border edge the latter one of the two halfedges is a border halfedge (the first one is a non-border halfedge in conformance with the polyhedral surface definition). The normalization stores the number of border halfedges and the halfedge iterator the border edges start at within the data structure. Halfedge insertion or removal and changing the border status of a halfedge may invalidate these values, which are not automatically updated.
|
| |
sorts halfedges such that the non-border edges precedes the border edges. For each border edge the halfedge iterator will reference the halfedge incident to the facet right before the halfedge incident to the hole. | ||
|
| |
number of border halfedges. Precondition: normalize_border() has been called and no halfedge insertion or removal and no change in border status of the halfedges have occurred since then. | ||
|
| |
number of border edges. Since each border edge of a polyhedral
surface has exactly one border halfedge,
this number is equal to size_of_border_halfedges(). Precondition: normalize_border() has been called and no halfedge insertion or removal and no change in border status of the halfedges have occurred since then. | ||
|
| |
halfedge iterator starting with the border edges. The range
[halfedges_begin(), border_halfedges_begin()) denotes
all non-border edges. The range
[border_halfedges_begin(), halfedges_end()) denotes all
border edges. Precondition: normalize_border() has been called and no halfedge insertion or removal and no change in border status of the halfedges have occurred since then. |
|
| reverses facet orientation (incl. normal or plane equations). |
|
| |
calls the operator() of the modifier . See
Modifier_base in the Support Library Manual for a
description of modifier design and its usage. Precondition: The polyhedral surface must be valid when the modifier returns from execution. |
|
| |||
returns true if the polyhedral surface is combinatorially
consistent. If verbose is true, statistics are
printed to std::cerr. For level == 1 the normalization of the
border edges is checked too. This method checks in particular level 3 of
Halfedge_data_structure_decorator::is_valid from
Section ![]() | ||||
|
| |||
returns true if the border halfedges are in normalized representation, which is when enumerating all halfedges with the iterator: The non-border edges precedes the border edges and for border edges, the second halfedge is the border halfedge. The halfedge iterator border_halfedges_begin() denotes the first border edge. If verbose is true, statistics are printed to std::cerr. |
The following types are equal to either Tag_true or Tag_false, depending on whether the named feature is supported or not.
| |
Vertex::halfedge().
| |
| |
Vertex::point().
| |
| |
Halfedge::prev().
| |
| |
Halfedge::vertex().
| |
| |
Halfedge::facet().
| |
| |
Facet::halfedge().
| |
| |
Facet::plane().
| |
| |
Facet::normal().
| |
| |
supports the
removal of individual elements of a surface.
|