Blender V5.3
polyfill_2d_beautify.cc File Reference

Go to the source code of this file.

Classes

struct  blender::OrderEdge
struct  blender::HalfEdge

Namespaces

namespace  blender
 BMesh Iterators.

Functions

static int blender::oedge_cmp (const void *a1, const void *a2)
BLI_INLINE bool blender::is_boundary_edge (uint i_a, uint i_b, const uint coord_last)
float blender::BLI_polyfill_beautify_quad_rotate_calc_ex (const float v1[2], const float v2[2], const float v3[2], const float v4[2], bool lock_degenerate, float *r_area)
float blender::BLI_polyfill_edge_calc_rotate_beauty__area (const float v1[3], const float v2[3], const float v3[3], const float v4[3], bool lock_degenerate)
static float blender::polyedge_rotate_beauty_calc (const float(*coords)[2], const HalfEdge *edges, const HalfEdge *e_a, float *r_area)
static void blender::polyedge_beauty_cost_update_single (const float(*coords)[2], const HalfEdge *edges, HalfEdge *e, Heap *eheap, HeapNode **eheap_table)
static void blender::polyedge_beauty_cost_update (const float(*coords)[2], HalfEdge *edges, HalfEdge *e, Heap *eheap, HeapNode **eheap_table)
static void blender::polyedge_rotate (HalfEdge *edges, const HalfEdge *e)
void blender::BLI_polyfill_beautify (const float(*coords)[2], unsigned int coords_num, unsigned int(*tris)[3], struct MemArena *arena, struct Heap *eheap)

Detailed Description

This function is to improve the tessellation resulting from polyfill2d, creating optimal topology.

The functionality here matches #BM_mesh_beautify_fill, but its far simpler to perform this operation in 2d, on a simple polygon representation where we know:

  • The polygon is primitive with no holes with a continuous boundary.
  • Triangles have consistent winding.
  • 2d (saves some hassles projecting face pairs on an axis for every edge-rotation) also saves us having to store all previous edge-states (see #EdRotState in bmesh_beautify.cc).
Note

No globals - keep threadsafe.

Definition in file polyfill_2d_beautify.cc.