Blender V5.3
bmesh_beautify.cc File Reference
#include "BLI_heap.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_polyfill_2d_beautify.hh"
#include "BLI_set.hh"
#include "MEM_guardedalloc.h"
#include "bmesh.hh"
#include "bmesh_beautify.hh"

Go to the source code of this file.

Classes

struct  blender::EdRotState

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define EDGE_ORD(v0, v1)

Functions

static void blender::erot_state_ex (const BMEdge *e, int v_index[2], int f_index[2])
static void blender::erot_state_current (const BMEdge *e, EdRotState *e_state)
static void blender::erot_state_alternate (const BMEdge *e, EdRotState *e_state)
static float blender::bm_edge_calc_rotate_beauty__angle (const float v1[3], const float v2[3], const float v3[3], const float v4[3])
float blender::BM_verts_calc_rotate_beauty (const BMVert *v1, const BMVert *v2, const BMVert *v3, const BMVert *v4, const short flag, const short method)
static float blender::bm_edge_calc_rotate_beauty (const BMEdge *e, const short flag, const short method)
BLI_INLINE bool blender::edge_in_array (const BMEdge *e, const BMEdge **edge_array, const int edge_array_len)
static void blender::bm_edge_update_beauty_cost_single (BMEdge *e, Heap *eheap, HeapNode **eheap_table, const Span< Set< EdRotState > > edge_state_arr, const BMEdge **edge_array, const int edge_array_len, const short flag, const short method)
static void blender::bm_edge_update_beauty_cost (BMEdge *e, Heap *eheap, HeapNode **eheap_table, const Span< Set< EdRotState > > edge_state_arr, const BMEdge **edge_array, const int edge_array_len, const short flag, const short method)
void blender::BM_mesh_beautify_fill (BMesh *bm, BMEdge **edge_array, const int edge_array_len, const short flag, const short method, const short oflag_edge, const short oflag_face)

Detailed Description

Beautify the mesh by rotating edges between triangles to more attractive positions until no more rotations can be made.

In principle this is very simple however there is the possibility of going into an eternal loop where edges keep rotating. To avoid this - each edge stores a set of it previous states so as not to rotate back.

TODO

  • Take face normals into account.

Definition in file bmesh_beautify.cc.

Macro Definition Documentation

◆ EDGE_ORD

#define EDGE_ORD ( v0,
v1 )
Value:
if (v0 > v1) { \
std::swap(v0, v1); \
} \
(void)0

Definition at line 106 of file bmesh_beautify.cc.

Referenced by blender::erot_state_ex().