Easy3D 2.6.1
Loading...
Searching...
No Matches
VoronoiCell3d Class Reference

A data structure for 3D Voronoi cells. More...

#include <easy3d/algo/delaunay_3d.h>

Public Member Functions

 VoronoiCell3d ()
 Default constructor.
 
void clear ()
 Clears the Voronoi cell.
 
unsigned int nb_facets () const
 Returns the number of facets in the Voronoi cell.
 
unsigned int facet_begin (unsigned int f) const
 Returns the starting index of the vertices for facet f.
 
unsigned int facet_end (unsigned int f) const
 Returns the ending index of the vertices for facet f.
 
unsigned int nb_vertices (unsigned int f) const
 Returns the number of vertices in facet f.
 
unsigned int next_around_facet (unsigned int f, unsigned int i) const
 Returns the next vertex index around facet f starting from vertex i.
 
unsigned int prev_around_facet (unsigned int f, unsigned int i) const
 Returns the previous vertex index around facet f starting from vertex i.
 
unsigned int facet_bisector (unsigned int f) const
 Returns the bisector vertex for facet f.
 
int edge_bisector (unsigned int i) const
 Returns the edge bisector for vertex i.
 
const vec3vertex (unsigned int i) const
 Returns the coordinates of vertex i.
 
bool vertex_is_infinite (unsigned int i) const
 Checks if vertex i is at infinity.
 
void begin_facet (unsigned int f_bisector)
 Begins a new facet with the given bisector vertex.
 
void add_to_facet (int e_bisector, const vec3 &v, bool infinite)
 Adds a vertex to the current facet.
 
void add_to_facet (int e_bisector, bool infinite)
 Adds a vertex to the current facet without specifying coordinates.
 
void end_facet ()
 Ends the current facet.
 
unsigned int find_facet (unsigned int bisector) const
 Finds the index of the facet with the given bisector vertex.
 

Detailed Description

A data structure for 3D Voronoi cells.

A 3D Voronoi cell stores the dual facets in a Compressed Row Storage (CRS) array.

  • Each facet knows the bisector it is on, and the list of vertices/edges.
  • Each vertex knows the tet it is dual to.
  • Each edge knows the other bisector it is on (an edge is defined as the intersection between the facet bisector and the edge bisector).

Member Function Documentation

◆ add_to_facet() [1/2]

void add_to_facet ( int e_bisector,
bool infinite )
inline

Adds a vertex to the current facet without specifying coordinates.

Parameters
e_bisectorThe edge bisector for the vertex.
infiniteTrue if the vertex is at infinity, false otherwise.

◆ add_to_facet() [2/2]

void add_to_facet ( int e_bisector,
const vec3 & v,
bool infinite )
inline

Adds a vertex to the current facet.

Parameters
e_bisectorThe edge bisector for the vertex.
vThe coordinates of the vertex.
infiniteTrue if the vertex is at infinity, false otherwise.

◆ begin_facet()

void begin_facet ( unsigned int f_bisector)
inline

Begins a new facet with the given bisector vertex.

Parameters
f_bisectorThe bisector vertex for the new facet.

◆ edge_bisector()

int edge_bisector ( unsigned int i) const
inline

Returns the edge bisector for vertex i.

The vertices of facet(f) are denoted by indices i in the range[facet_begin(f) ... facet_end(f) - 1]. Vertex i is the dual of a tetrahedron t incident to the edge [v1,v2]. edge_bisector(i) returns the vertex of t oriented clockwise relative to the edge [v1,v2].

Note
An infinite facet has two vertices i1 and i2 that are dual to infinite tetrahedra. Supposing the proper ordering of i1 and i2, edge_bisector(i1) returns the vertex of the boundary facet that is incident to [v1,v2], and edge_bisector(i2) returns -1 (infinite vertex). The other vertex of the other boundary facet that is incident to [v1,v2] is encountered when traversing the dual vertex/tetrahedron that precedes v2.
Parameters
iThe index of the vertex.
Returns
The edge bisector.

◆ facet_begin()

unsigned int facet_begin ( unsigned int f) const
inline

Returns the starting index of the vertices for facet f.

Parameters
fThe index of the facet.
Returns
The starting index of the vertices.

◆ facet_bisector()

unsigned int facet_bisector ( unsigned int f) const
inline

Returns the bisector vertex for facet f.

This VoronoiCell3d is the dual of vertex v1, Facet f lies on the bisector plane of [v1,v2], and facet_bisector(f) returns v2.

Parameters
fThe index of the facet.
Returns
The bisector vertex.

◆ facet_end()

unsigned int facet_end ( unsigned int f) const
inline

Returns the ending index of the vertices for facet f.

Parameters
fThe index of the facet.
Returns
The ending index of the vertices.

◆ find_facet()

unsigned int find_facet ( unsigned int bisector) const
inline

Finds the index of the facet with the given bisector vertex.

Parameters
bisectorThe bisector vertex.
Returns
The index of the facet.

◆ nb_facets()

unsigned int nb_facets ( ) const
inline

Returns the number of facets in the Voronoi cell.

Returns
The number of facets.

◆ nb_vertices()

unsigned int nb_vertices ( unsigned int f) const
inline

Returns the number of vertices in facet f.

Parameters
fThe index of the facet.
Returns
The number of vertices.

◆ next_around_facet()

unsigned int next_around_facet ( unsigned int f,
unsigned int i ) const
inline

Returns the next vertex index around facet f starting from vertex i.

Parameters
fThe index of the facet.
iThe index of the current vertex.
Returns
The next vertex index.

◆ prev_around_facet()

unsigned int prev_around_facet ( unsigned int f,
unsigned int i ) const
inline

Returns the previous vertex index around facet f starting from vertex i.

Parameters
fThe index of the facet.
iThe index of the current vertex.
Returns
The previous vertex index.

◆ vertex()

const vec3 & vertex ( unsigned int i) const
inline

Returns the coordinates of vertex i.

For finite dual vertices, returns the Voronoi vertex. For dual vertices at infinity, returns the direction (normal to primal facet on the boundary).

Parameters
iThe index of the vertex.
Returns
The coordinates of the vertex.

◆ vertex_is_infinite()

bool vertex_is_infinite ( unsigned int i) const
inline

Checks if vertex i is at infinity.

Parameters
iThe index of the vertex.
Returns
True if the vertex is at infinity, false otherwise.

The documentation for this class was generated from the following file: