Blender
V3.3
|
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "BLI_bitmap.h"
#include "BLI_edgehash.h"
#include "BLI_ghash.h"
#include "BLI_utildefines.h"
#include "BLI_utildefines_stack.h"
#include "BKE_customdata.h"
#include "BKE_lib_id.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
Go to the source code of this file.
Classes | |
struct | PolyKey |
Typedefs | |
typedef struct PolyKey | PolyKey |
Functions | |
static int | cddm_poly_compare (MLoop *mloop_array, MPoly *mpoly_source, MPoly *mpoly_target, const int *vtargetmap, const int direct_reverse) |
static uint | poly_gset_hash_fn (const void *key) |
static bool | poly_gset_compare_fn (const void *k1, const void *k2) |
Mesh * | BKE_mesh_merge_verts (Mesh *mesh, const int *vtargetmap, const int tot_vtargetmap, const int merge_mode) |
Mesh* BKE_mesh_merge_verts | ( | struct Mesh * | mesh, |
const int * | vtargetmap, | ||
int | tot_vtargetmap, | ||
int | merge_mode | ||
) |
Merge Verts
This frees the given mesh and returns a new mesh.
vtargetmap | The table that maps vertices to target vertices. a value of -1 indicates a vertex is a target, and is to be kept. This array is aligned with 'mesh->totvert' |
tot_vtargetmap | The number of non '-1' values in vtargetmap. (not the size) |
merge_mode | enum with two modes.
|
Definition at line 192 of file mesh_merge.c.
References BKE_mesh_vert_poly_map_create(), BLI_assert, BLI_BITMAP_DISABLE, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, BLI_edgehash_ensure_p(), BLI_edgehash_new_ex(), BLI_edgehash_remove(), BLI_gset_flag_set(), BLI_gset_haskey(), BLI_gset_insert(), BLI_gset_new_ex(), Freestyle::c, cddm_poly_compare(), MeshElemMap::count, MLoop::e, ELEM, GHASH_FLAG_ALLOW_DUPES, PolyKey::hash_sum, PolyKey::hash_xor, MeshElemMap::indices, LIKELY, MPoly::loopstart, Mesh::medge, MEM_malloc_arrayN, mesh, MESH_MERGE_VERTS_DUMP_IF_EQUAL, MESH_MERGE_VERTS_DUMP_IF_MAPPED, Mesh::mloop, Mesh::mpoly, Mesh::mvert, NULL, POINTER_AS_INT, POINTER_FROM_INT, poly_gset_compare_fn(), poly_gset_hash_fn(), PolyKey::poly_index, result, STACK_DECLARE, STACK_DISCARD, STACK_INIT, STACK_PUSH, STACK_PUSH_RET_PTR, STACK_SIZE, Mesh::totedge, Mesh::totloop, MPoly::totloop, PolyKey::totloops, Mesh::totpoly, Mesh::totvert, UNLIKELY, MLoop::v, v1, MEdge::v1, v2, and MEdge::v2.
Referenced by arrayModifier_doArray(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), and mesh_remove_doubles_on_axis().
|
static |
Poly compare with vtargetmap Function used by BKE_mesh_merge_verts. The function compares poly_source after applying vtargetmap, with poly_target. The two polys are identical if they share the same vertices in the same order, or in reverse order, but starting position loopstart may be different. The function is called with direct_reverse=1 for same order (i.e. same normal), and may be called again with direct_reverse=-1 for reverse order.
Definition at line 35 of file mesh_merge.c.
References BLI_assert, ELEM, if(), MPoly::loopstart, MPoly::totloop, and MLoop::v.
Referenced by BKE_mesh_merge_verts().
Definition at line 179 of file mesh_merge.c.
References PolyKey::hash_sum, PolyKey::hash_xor, and PolyKey::totloops.
Referenced by BKE_mesh_merge_verts().
Definition at line 173 of file mesh_merge.c.
References PolyKey::hash_sum.
Referenced by BKE_mesh_merge_verts().