Blender V4.5
blender::geometry::deduplication Namespace Reference

Functions

static GroupedSpan< int > build_vert_to_tri_map (const int verts_num, const Span< int3 > vert_tris, Array< int > &r_offsets, Array< int > &r_indices)
 
static IndexMask calc_unselected_faces (const Mesh &mesh, const OffsetIndices< int > src_faces, const Span< int > src_corner_verts, const IndexMask &selection, const Span< int3 > corner_tris, IndexMaskMemory &memory)
 
static std::optional< int > find_edge_duplicate (const GroupedSpan< int > vert_to_edge_map, const Span< int2 > edges, const OrderedEdge edge)
 
static int calc_new_edges (const Mesh &src_mesh, const Span< int2 > src_edges, const IndexRange new_edges_range, MutableSpan< int2 > edges, MutableSpan< int > corner_edges)
 

Function Documentation

◆ build_vert_to_tri_map()

◆ calc_new_edges()

static int blender::geometry::deduplication::calc_new_edges ( const Mesh & src_mesh,
const Span< int2 > src_edges,
const IndexRange new_edges_range,
MutableSpan< int2 > edges,
MutableSpan< int > corner_edges )
static

Given all the edges on the new mesh, find new edges that are duplicates of existing edges. If there are any, remove them and references to them in the corner edge array.

Returns
The final number of edges in the mesh.

Definition at line 628 of file mesh_triangulate.cc.

References calc_new_edges(), blender::Span< T >::index_range(), range, blender::MutableSpan< T >::size(), blender::Span< T >::size(), blender::MutableSpan< T >::slice(), and Mesh::verts_num.

Referenced by calc_new_edges().

◆ calc_unselected_faces()

static IndexMask blender::geometry::deduplication::calc_unselected_faces ( const Mesh & mesh,
const OffsetIndices< int > src_faces,
const Span< int > src_corner_verts,
const IndexMask & selection,
const Span< int3 > corner_tris,
IndexMaskMemory & memory )
static

To avoid adding duplicate faces to the mesh without complicating the triangulation code to support that unlikely case, check if triangles (which are all unselected) have an equivalent newly created triangle, and don't copy them to the result mesh if so.

Definition at line 538 of file mesh_triangulate.cc.

References blender::IndexRangesBuilder< T >::add(), blender::OffsetSpan< T, BaseT >::base_span(), blender::index_mask::IndexMask::complement(), blender::index_mask::IndexMask::from_batch_predicate(), blender::offset_indices::OffsetIndices< T >::index_range(), mesh, blender::unique_sorted_indices::non_empty_is_range(), blender::OffsetSpan< T, BaseT >::offset(), and size().

◆ find_edge_duplicate()

static std::optional< int > blender::geometry::deduplication::find_edge_duplicate ( const GroupedSpan< int > vert_to_edge_map,
const Span< int2 > edges,
const OrderedEdge edge )
static