Blender  V3.3
Classes | Macros
mesh_tessellate.cc File Reference
#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])
 

Detailed Description

This file contains code for polygon tessellation (creating triangles from polygons).

See also
bmesh_mesh_tessellate.c for the BMesh equivalent of this file.

Definition in file mesh_tessellate.cc.

Macro Definition Documentation

◆ MESH_FACE_TESSELLATE_THREADED_LIMIT

#define MESH_FACE_TESSELLATE_THREADED_LIMIT   4096

Compared against total loops.

Definition at line 32 of file mesh_tessellate.cc.

◆ ML_TO_MLT

#define ML_TO_MLT (   i1,
  i2,
  i3 
)
Value:
{ \
ARRAY_SET_ITEMS(mlt->tri, mp_loopstart + i1, mp_loopstart + i2, mp_loopstart + i3); \
mlt->poly = poly_index; \
} \
((void)0)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint i1
SyclQueue void void size_t num_bytes void

Function Documentation

◆ BKE_mesh_recalc_looptri()

void BKE_mesh_recalc_looptri ( const MLoop mloop,
const MPoly mpoly,
const MVert mvert,
int  totloop,
int  totpoly,
MLoopTri mlooptri 
)

◆ BKE_mesh_recalc_looptri_with_normals()

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] 
)

◆ mesh_calc_tessellation_for_face()

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

◆ mesh_calc_tessellation_for_face_fn()

static void mesh_calc_tessellation_for_face_fn ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict  tls 
)
static

◆ mesh_calc_tessellation_for_face_free_fn()

static void mesh_calc_tessellation_for_face_free_fn ( const void *__restrict   UNUSEDuserdata,
void *__restrict  tls_v 
)
static

◆ mesh_calc_tessellation_for_face_impl()

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] 
)

◆ mesh_calc_tessellation_for_face_with_normal()

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

◆ mesh_calc_tessellation_for_face_with_normal_fn()

static void mesh_calc_tessellation_for_face_with_normal_fn ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict  tls 
)
static

◆ mesh_recalc_looptri__multi_threaded()

static void mesh_recalc_looptri__multi_threaded ( const MLoop mloop,
const MPoly mpoly,
const MVert mvert,
int   UNUSEDtotloop,
int  totpoly,
MLoopTri mlooptri,
const float(*)  poly_normals[3] 
)
static

◆ mesh_recalc_looptri__single_threaded()

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