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

#include <BLI_delaunay_2d.hh>

Public Attributes

Span< VecBase< T, 2 > > vert
Span< int2 > edge
OffsetIndices< int > face_offsets
Span< int > face_vert_indices
T epsilon {0}
CDT_ids_needed_type needed_ids {CDT_NO_ORIG_IDS}

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 when original face ids are required (CDT_ORIG_FACES) or for CDT_CONSTRAINTS_VALID_BMESH. *_NONZERO outputs use the orientation as the winding, even-odd filling ignores it.

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 not contain mappings from outputs to inputs, which leads to faster execution. If some output mappings are needed, set the need_ids mask to the OR of the required CDT_ids_needed_type values.

Definition at line 175 of file BLI_delaunay_2d.hh.

Member Data Documentation

◆ edge

◆ epsilon

◆ face_offsets

◆ face_vert_indices

◆ needed_ids

◆ vert


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