14# define isnan(n) _isnan(n)
17static void veccopy(
float dst[3],
const float src[3])
24#define GET_TRI(_mesh, _n) \
25 (*(DualConTri)(((char *)(_mesh)->corner_tris) + ((_n) * (_mesh)->tri_stride)))
27#define GET_CO(_mesh, _n) (*(DualConCo)(((char *)(_mesh)->co) + ((_n) * (_mesh)->co_stride)))
29#define GET_LOOP(_mesh, _n) \
30 (*(DualConLoop)(((char *)(_mesh)->mloop) + ((_n) * (_mesh)->loop_stride)))
36 float min[3], max[3], maxsize;
49 tottri = input_mesh->
tottri;
55 for (
int i = 0; i < 3; i++) {
56 float d = max[i] -
min[i];
63 for (
int i = 0; i < 3; i++) {
64 min[i] = (max[i] +
min[i]) / 2 - maxsize / 2;
65 max[i] = (max[i] +
min[i]) / 2 + maxsize / 2;
68 for (
int i = 0; i < 3; i++) {
69 min[i] -= maxsize * (1 / scale - 1) / 2;
76 if (curtri == input_mesh->
tottri) {
82 const unsigned int *tr =
GET_TRI(input_mesh, curtri);
90 for (
int i = 0; i < 3; i++) {
91 const float *co = t->
vt[i];
92 if (isnan(co[0]) || isnan(co[1]) || isnan(co[2])) {
103 if (curtri == input_mesh->
tottri) {
107 const unsigned int *tr =
GET_TRI(input_mesh, curtri);
124 return input_mesh->
totco;
146#ifdef WITH_CXX_GUARDEDALLOC
147 MEM_CXX_CLASS_ALLOC_FUNCS(
"DUALCON:DualConInputReader")
165 Octree o(&r, alloc_output, add_vert, add_quad, flags, mode, depth, threshold, hermite_num);
void(* DualConAddQuad)(void *output, const int vert_indices[4])
void(* DualConAddVert)(void *output, const float co[3])
void *(* DualConAllocOutput)(int totvert, int totquad)
void * dualcon(const DualConInput *input_mesh, DualConAllocOutput alloc_output, DualConAddVert add_vert, DualConAddQuad add_quad, DualConFlags flags, DualConMode mode, float threshold, float hermite_num, float scale, int depth)
static void veccopy(float dst[3], const float src[3])
#define GET_LOOP(_mesh, _n)
#define GET_CO(_mesh, _n)
#define GET_TRI(_mesh, _n)