Blender V5.0
bmesh_decimate_unsubdivide.cc File Reference
#include "MEM_guardedalloc.h"
#include "bmesh.hh"
#include "bmesh_decimate.hh"

Go to the source code of this file.

Enumerations

enum  { VERT_INDEX_DO_COLLAPSE = -1 , VERT_INDEX_INIT = 0 , VERT_INDEX_IGNORE = 1 }

Functions

static bool bm_vert_dissolve_fan_test (BMVert *v)
static bool bm_vert_dissolve_fan (BMesh *bm, BMVert *v)
static void bm_tag_untagged_neighbors (BMVert *verts_start[], const uint verts_start_num, const int desired_tag, BMVert *r_verts_tagged[], uint &r_verts_tagged_num)
void BM_mesh_decimate_unsubdivide_ex (BMesh *bm, const int iterations, const bool tag_only)
void BM_mesh_decimate_unsubdivide (BMesh *bm, const int iterations)

Detailed Description

BMesh decimator that uses a grid un-subdivide method.

Definition in file bmesh_decimate_unsubdivide.cc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Note that bm_tag_untagged_neighbors requires VERT_INDEX_DO_COLLAPSE & VERT_INDEX_IGNORE are equal magnitude, opposite sign.

Enumerator
VERT_INDEX_DO_COLLAPSE 
VERT_INDEX_INIT 
VERT_INDEX_IGNORE 

Definition at line 150 of file bmesh_decimate_unsubdivide.cc.

Function Documentation

◆ BM_mesh_decimate_unsubdivide()

void BM_mesh_decimate_unsubdivide ( BMesh * bm,
const int iterations )

Definition at line 298 of file bmesh_decimate_unsubdivide.cc.

References bm, and BM_mesh_decimate_unsubdivide_ex().

Referenced by modify_mesh().

◆ BM_mesh_decimate_unsubdivide_ex()

◆ bm_tag_untagged_neighbors()

void bm_tag_untagged_neighbors ( BMVert * verts_start[],
const uint verts_start_num,
const int desired_tag,
BMVert * r_verts_tagged[],
uint & r_verts_tagged_num )
static

Given a set of starting verts, find all the currently-untagged neighbors of those verts, tag them with the specified value, and return an array specifying all the newly-tagged verts.

By using two arrays and two tag values, repeated alternating calls will expand the selection in an alternating tagging pattern. Dissolving one of the two tags will then reduce the density of the mesh, by half, in a regular diamond pattern.

Parameters
verts_startThe array of starting verts whose neighbors should be tagged.
verts_start_numThe number of verts in the verts_start array.
desired_tagThe value to set as a tag, on any currently-untagged neighbors.
r_verts_taggedReturned array of all the verts which were tagged in this call.
r_verts_tagged_numReturned number of verts in the r_verts_tagged array.

Definition at line 170 of file bmesh_decimate_unsubdivide.cc.

References BLI_assert, BM_edge_other_vert(), BM_EDGES_OF_VERT, BM_elem_index_get, BM_elem_index_set, BM_ITER_ELEM, e, i, v, and VERT_INDEX_INIT.

Referenced by BM_mesh_decimate_unsubdivide_ex().

◆ bm_vert_dissolve_fan()

◆ bm_vert_dissolve_fan_test()