Blender V4.3
blender::meshintersect::CDT_input< T > Class Template Reference

#include <BLI_delaunay_2d.hh>

Public Attributes

Array< VecBase< T, 2 > > vert
 
Array< std::pair< int, int > > edge
 
Array< Vector< int > > face
 
T epsilon {0}
 
bool need_ids {true}
 

Detailed Description

template<typename T>
class blender::meshintersect::CDT_input< T >

Input to Constrained Delaunay Triangulation. Input vertex coordinates are stored in vert. For the rest of the input, vertices are referred to by indices into that array. Edges and Faces are optional. If provided, they will appear in the output triangulation ("constraints"). One can provide faces and not edges – the edges implied by the faces will be inferred.

The edges are given by pairs of vertex indices. The faces are given as groups of vertex indices, in counterclockwise order.

The edges implied by the faces are automatically added and need not be put in the edges array, which is intended as a way to specify edges that are not part of any face.

Some notes about some special cases and how they are handled:

  • Input faces can have any number of vertices greater than 2. Depending on the output option, ngons may be triangulated or they may remain as ngons.
  • Input faces may have repeated vertices. Output faces will not, except when the CDT_CONSTRAINTS output option is used.
  • Input faces may have edges that self-intersect, but currently the labeling of which output faces have which input faces may not be done correctly, since the labeling relies on the inside being on the left of edges as one traverses the face. Output faces will not self-intersect.
  • Input edges, including those implied by the input faces, may have zero-length or near-zero-length edges (nearness as determined by epsilon), but those edges will not be in the output.
  • Input edges (including face edges) can overlap or nearly overlap each other. The output edges will not overlap, but instead be divided into as many edges as necessary to represent each overlap regime.
  • Input vertices may be coincide with, or nearly coincide with (as determined by epsilon) other input vertices. Only one representative will survive in the output. If an input vertex is within epsilon of an edge (including an added triangulation edge), it will be snapped to that edge, so the output coordinates may not exactly match the input coordinates in all cases.
  • Wire edges (those not part of faces) and isolated vertices are allowed in the input. If they are inside faces, they will be incorporated into the triangulation of those faces.

Epsilon is used for "is it near enough" distance calculations. If zero is supplied for epsilon, an internal value of 1e-8 used instead, since this code will not work correctly if it is not allowed to merge "too near" vertices.

Normally the output will contain mappings from outputs to inputs. If this is not needed, set need_ids to false and the execution may be much faster in some circumstances.

Definition at line 126 of file BLI_delaunay_2d.hh.

Member Data Documentation

◆ edge

template<typename T >
Array<std::pair<int, int> > blender::meshintersect::CDT_input< T >::edge

Definition at line 129 of file BLI_delaunay_2d.hh.

Referenced by blender::meshintersect::fill_input_from_string().

◆ epsilon

template<typename T >
T blender::meshintersect::CDT_input< T >::epsilon {0}

Definition at line 131 of file BLI_delaunay_2d.hh.

Referenced by blender::meshintersect::fill_input_from_string().

◆ face

template<typename T >
Array<Vector<int> > blender::meshintersect::CDT_input< T >::face

Definition at line 130 of file BLI_delaunay_2d.hh.

Referenced by blender::meshintersect::fill_input_from_string().

◆ need_ids

template<typename T >
bool blender::meshintersect::CDT_input< T >::need_ids {true}

◆ vert


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