Blender
V3.3
|
#include <climits>
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "BLI_math.h"
#include "BLI_memarena.h"
#include "BLI_polyfill_2d.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "BKE_customdata.h"
#include "BKE_mesh.h"
#include "BLI_strict_flags.h"
Go to the source code of this file.
Classes | |
struct | TessellationUserData |
struct | TessellationUserTLS |
Macros | |
#define | MESH_FACE_TESSELLATE_THREADED_LIMIT 4096 |
#define | ML_TO_MLT(i1, i2, i3) |
Functions | |
Loop Tessellation | |
Fill in MLoopTri data-structure. | |
BLI_INLINE void | mesh_calc_tessellation_for_face_impl (const MLoop *mloop, const MPoly *mpoly, const MVert *mvert, uint poly_index, MLoopTri *mlt, MemArena **pf_arena_p, const bool face_normal, const float normal_precalc[3]) |
static void | mesh_calc_tessellation_for_face (const MLoop *mloop, const MPoly *mpoly, const MVert *mvert, uint poly_index, MLoopTri *mlt, MemArena **pf_arena_p) |
static void | mesh_calc_tessellation_for_face_with_normal (const MLoop *mloop, const MPoly *mpoly, const MVert *mvert, uint poly_index, MLoopTri *mlt, MemArena **pf_arena_p, const float normal_precalc[3]) |
static void | mesh_recalc_looptri__single_threaded (const MLoop *mloop, const MPoly *mpoly, const MVert *mvert, int totloop, int totpoly, MLoopTri *mlooptri, const float(*poly_normals)[3]) |
static void | mesh_calc_tessellation_for_face_fn (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict tls) |
static void | mesh_calc_tessellation_for_face_with_normal_fn (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict tls) |
static void | mesh_calc_tessellation_for_face_free_fn (const void *__restrict UNUSED(userdata), void *__restrict tls_v) |
static void | mesh_recalc_looptri__multi_threaded (const MLoop *mloop, const MPoly *mpoly, const MVert *mvert, int UNUSED(totloop), int totpoly, MLoopTri *mlooptri, const float(*poly_normals)[3]) |
void | BKE_mesh_recalc_looptri (const MLoop *mloop, const MPoly *mpoly, const MVert *mvert, int totloop, int totpoly, MLoopTri *mlooptri) |
void | BKE_mesh_recalc_looptri_with_normals (const MLoop *mloop, const MPoly *mpoly, const MVert *mvert, int totloop, int totpoly, MLoopTri *mlooptri, const float(*poly_normals)[3]) |
This file contains code for polygon tessellation (creating triangles from polygons).
Definition in file mesh_tessellate.cc.
#define MESH_FACE_TESSELLATE_THREADED_LIMIT 4096 |
Compared against total loops.
Definition at line 32 of file mesh_tessellate.cc.
void BKE_mesh_recalc_looptri | ( | const MLoop * | mloop, |
const MPoly * | mpoly, | ||
const MVert * | mvert, | ||
int | totloop, | ||
int | totpoly, | ||
MLoopTri * | mlooptri | ||
) |
Definition at line 309 of file mesh_tessellate.cc.
References MESH_FACE_TESSELLATE_THREADED_LIMIT, mesh_recalc_looptri__multi_threaded(), and mesh_recalc_looptri__single_threaded().
void BKE_mesh_recalc_looptri_with_normals | ( | const MLoop * | mloop, |
const MPoly * | mpoly, | ||
const MVert * | mvert, | ||
int | totloop, | ||
int | totpoly, | ||
MLoopTri * | mlooptri, | ||
const float(*) | poly_normals[3] | ||
) |
Definition at line 324 of file mesh_tessellate.cc.
References BLI_assert, MESH_FACE_TESSELLATE_THREADED_LIMIT, mesh_recalc_looptri__multi_threaded(), and mesh_recalc_looptri__single_threaded().
|
static |
Definition at line 153 of file mesh_tessellate.cc.
References mesh_calc_tessellation_for_face_impl().
Referenced by mesh_recalc_looptri__single_threaded().
|
static |
Definition at line 232 of file mesh_tessellate.cc.
References data, mesh_calc_tessellation_for_face_impl(), TessellationUserTLS::pf_arena, and poly_to_tri_count().
Referenced by mesh_recalc_looptri__multi_threaded().
|
static |
Definition at line 266 of file mesh_tessellate.cc.
References BLI_memarena_free(), and TessellationUserTLS::pf_arena.
Referenced by mesh_recalc_looptri__multi_threaded().
BLI_INLINE void mesh_calc_tessellation_for_face_impl | ( | const MLoop * | mloop, |
const MPoly * | mpoly, | ||
const MVert * | mvert, | ||
uint | poly_index, | ||
MLoopTri * | mlt, | ||
MemArena ** | pf_arena_p, | ||
const bool | face_normal, | ||
const float | normal_precalc[3] | ||
) |
face_normal | This will be optimized out as a constant. |
Definition at line 43 of file mesh_tessellate.cc.
References add_newell_cross_v3_v3v3(), axis_dominant_v3_to_m3_negate(), BLI_memarena_alloc(), BLI_memarena_clear(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, BLI_polyfill_calc_arena(), MVert::co, float(), is_quad_flip_v3_first_third_fast(), is_quad_flip_v3_first_third_fast_with_normal(), ML_TO_MLT, mul_v2_m3v3(), normal, normalize_v3(), MLoopTri::tri, UNLIKELY, MLoop::v, and zero_v3().
Referenced by mesh_calc_tessellation_for_face(), mesh_calc_tessellation_for_face_fn(), mesh_calc_tessellation_for_face_with_normal(), and mesh_calc_tessellation_for_face_with_normal_fn().
|
static |
Definition at line 164 of file mesh_tessellate.cc.
References mesh_calc_tessellation_for_face_impl().
Referenced by mesh_recalc_looptri__single_threaded().
|
static |
Definition at line 249 of file mesh_tessellate.cc.
References data, mesh_calc_tessellation_for_face_impl(), TessellationUserTLS::pf_arena, and poly_to_tri_count().
Referenced by mesh_recalc_looptri__multi_threaded().
|
static |
Definition at line 275 of file mesh_tessellate.cc.
References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), data, TaskParallelSettings::func_free, mesh_calc_tessellation_for_face_fn(), mesh_calc_tessellation_for_face_free_fn(), mesh_calc_tessellation_for_face_with_normal_fn(), TaskParallelSettings::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.
Referenced by BKE_mesh_recalc_looptri(), and BKE_mesh_recalc_looptri_with_normals().
|
static |
Definition at line 176 of file mesh_tessellate.cc.
References BLI_assert, BLI_memarena_free(), mesh_calc_tessellation_for_face(), mesh_calc_tessellation_for_face_with_normal(), poly_to_tri_count(), MPoly::totloop, and UNUSED_VARS_NDEBUG.
Referenced by BKE_mesh_recalc_looptri(), and BKE_mesh_recalc_looptri_with_normals().