24 #define param_assert(condition) \
28 #define param_warning(message) \
119 #define PEDGE_VERTEX_FLAGS (PEDGE_PIN)
201 1, 3, 5, 11, 17, 37, 67, 131, 257, 521,
202 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309,
203 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459,
206 #define PHASH_hash(ph, item) (((uintptr_t)(item)) % ((uint)(ph)->cursize))
207 #define PHASH_edge(v1, v2) (((v1) < (v2)) ? ((v1)*39) ^ ((v2)*31) : ((v1)*31) ^ ((v2)*39))
266 for (link = first; link; link =
next) {
279 if (link->
key == key) {
294 for (link = link->
next; link; link = link->
next) {
295 if (link->
key == key) {
317 const float v1[3],
const float v2[3],
const float v3[3],
float *r_a1,
float *r_a2,
float *r_a3)
342 return 0.5f * (((
v2[0] -
v1[0]) * (v3[1] -
v1[1])) - ((v3[0] -
v1[0]) * (
v2[1] -
v1[1])));
350 return 0.5f * (((
v2->uv[0] -
v1->uv[0]) * (v3->uv[1] -
v1->uv[1])) -
351 ((v3->uv[0] -
v1->uv[0]) * (
v2->uv[1] -
v1->uv[1])));
361 return len_v2v2(
e->vert->uv,
e->next->vert->uv);
370 for (
v = chart->
verts;
v;
v =
v->nextlink) {
390 for (
v = chart->
verts;
v;
v =
v->nextlink) {
400 for (
v = chart->
verts;
v;
v =
v->nextlink) {
410 for (
v = chart->
verts;
v;
v =
v->nextlink) {
411 v->uv[0] += trans[0];
412 v->uv[1] += trans[1];
420 for (
v = chart->
verts;
v;
v =
v->nextlink) {
430 for (
v = chart->
verts;
v;
v =
v->nextlink) {
443 div = dir2[0] * dir1[1] - dir2[1] * dir1[0];
449 lmbda = ((
v1[1] -
v2[1]) * dir1[0] - (
v1[0] -
v2[0]) * dir1[1]) / div;
450 r_isect[0] =
v1[0] + lmbda * dir2[0];
451 r_isect[1] =
v1[1] + lmbda * dir2[1];
460 return e->next->next->pair;
465 return (
e->pair) ?
e->pair->next :
NULL;
470 return e->next->vert->edge;
480 }
while (we && (we !=
e));
482 return last->next->next;
487 return v->edge->pair;
494 int f1 = e1->
flag, f2 = e2->flag, f3 = e3->flag;
495 float *orig_uv1 = e1->
orig_uv, *orig_uv2 = e2->orig_uv, *orig_uv3 = e3->orig_uv;
509 e3->orig_uv = orig_uv1;
514 static void p_chart_topological_sanity_check(
PChart *chart)
519 for (
v = chart->
verts;
v;
v =
v->nextlink) {
520 GEO_uv_parametrizer_test_equals_ptr(
"v->edge->vert",
v,
v->edge->vert);
523 for (
e = chart->
edges;
e;
e =
e->nextlink) {
525 GEO_uv_parametrizer_test_equals_ptr(
"e->pair->pair",
e,
e->pair->pair);
526 GEO_uv_parametrizer_test_equals_ptr(
"pair->vert",
e->vert,
e->pair->next->vert);
527 GEO_uv_parametrizer_test_equals_ptr(
"pair->next->vert",
e->next->vert,
e->pair->vert);
538 int nedges = 0, npins = 0;
541 v->uv[0] =
v->uv[1] = 0.0f;
542 pinuv[0] = pinuv[1] = 0.0f;
551 pinuv[0] +=
e->orig_uv[0] * handle->
aspx;
552 pinuv[1] +=
e->orig_uv[1] * handle->
aspy;
556 v->uv[0] +=
e->orig_uv[0] * handle->
aspx;
557 v->uv[1] +=
e->orig_uv[1] * handle->
aspy;
564 }
while (
e &&
e != (
v->edge));
567 v->uv[0] = pinuv[0] / npins;
568 v->uv[1] = pinuv[1] / npins;
571 else if (nedges > 0) {
581 for (
e = chart->
edges;
e;
e =
e->nextlink) {
583 e->orig_uv[0] =
e->vert->uv[0] / handle->
aspx;
584 e->orig_uv[1] =
e->vert->uv[1] / handle->
aspy;
592 float invblend = 1.0f -
blend;
594 for (
e = chart->
edges;
e;
e =
e->nextlink) {
596 e->orig_uv[0] =
blend *
e->old_uv[0] + invblend *
e->vert->uv[0] / handle->
aspx;
597 e->orig_uv[1] =
blend *
e->old_uv[1] + invblend *
e->vert->uv[1] / handle->
aspy;
611 e2->old_uv[0] = e2->orig_uv[0];
612 e2->old_uv[1] = e2->orig_uv[1];
615 e3->old_uv[0] = e3->orig_uv[0];
616 e3->old_uv[1] = e3->orig_uv[1];
629 e2->orig_uv[0] = e2->old_uv[0];
630 e2->orig_uv[1] = e2->old_uv[1];
633 e3->orig_uv[0] = e3->old_uv[0];
634 e3->orig_uv[1] = e3->old_uv[1];
648 for (
int i = 0; i < 3; i++) {
678 nv->
uv[0] =
v->uv[0];
679 nv->
uv[1] =
v->uv[1];
680 nv->
u.
key =
v->u.key;
693 if ((
e->vert->u.key == vkeys[0]) && (
e->next->vert->u.key == vkeys[1])) {
696 if ((
e->vert->u.key == vkeys[1]) && (
e->next->vert->u.key == vkeys[0])) {
713 if ((
e->vert->u.key == vkeys[
i1]) && (
e->next->vert->u.key == vkeys[i2])) {
714 if (
e->next->next->vert->u.key == vkeys[i3]) {
718 else if ((
e->vert->u.key == vkeys[i2]) && (
e->next->vert->u.key == vkeys[
i1])) {
719 if (
e->next->next->vert->u.key == vkeys[i3]) {
746 float *uv1, *uv2, *uvp1, *uvp2;
753 uv2 =
e->next->orig_uv;
764 if ((
fabsf(uv1[0] - uvp1[0]) > limit[0]) || (
fabsf(uv1[1] - uvp1[1]) > limit[1])) {
769 if ((
fabsf(uv2[0] - uvp2[0]) > limit[0]) || (
fabsf(uv2[1] - uvp2[1]) > limit[1])) {
799 if (((
v1->u.key == key1) && (
v2->u.key == key2)) ||
800 ((
v1->u.key == key2) && (
v2->u.key == key1))) {
816 if (*r_pair && (
e->vert == (*r_pair)->vert)) {
817 if ((*r_pair)->next->pair || (*r_pair)->next->next->pair) {
824 return (*r_pair !=
NULL);
829 bool topology_from_uvs,
835 if (
e->vert == pair->
vert) {
848 return (
e->pair !=
NULL);
855 PEdge **stack = stackbase;
867 *stack = first->
edge;
870 while (stack != stackbase) {
932 v->nextlink = chart->
verts;
944 v->nextlink = chart->
verts;
954 }
while (we && (we != lastwe));
964 for (i = 0; i < ncharts; i++) {
973 nchart = charts[f->
u.
chart];
1000 PEdge *e1, *e2, *e3;
1048 e2->orig_uv = uv[i2];
1049 e3->orig_uv = uv[i3];
1079 e2->u.key =
PHASH_edge(vkeys[i2], vkeys[i3]);
1120 float bias = 1.0f + 1e-6f;
1122 bool dir = (fac <= 0.0f);
1146 float len, maxlen = -1.0;
1153 for (
e = chart->
edges;
e;
e =
e->nextlink) {
1169 if (r_outer && (
len > maxlen)) {
1175 for (
e = chart->
edges;
e;
e =
e->nextlink) {
1200 }
while (we && (we !=
v->edge));
1231 while (nedges > 2) {
1232 PEdge *ne, *ne1, *ne2;
1261 ne1->
vert =
e->vert;
1287 for (
e = chart->
edges;
e;
e =
e->nextlink) {
1311 static int p_polygon_point_in(
const float cp1[2],
const float cp2[2],
const float p[2])
1313 if ((cp1[0] == p[0]) && (cp1[1] == p[1])) {
1316 else if ((cp2[0] == p[0]) && (cp2[1] == p[1])) {
1324 static void p_polygon_kernel_clip(
float (*oldpoints)[2],
1326 float (*newpoints)[2],
1331 float *p2, *p1, isect[2];
1334 p1 = oldpoints[noldpoints - 1];
1335 p1in = p_polygon_point_in(cp1, cp2, p1);
1338 for (i = 0; i < noldpoints; i++) {
1340 p2in = p_polygon_point_in(cp1, cp2, p2);
1342 if ((p2in >= 2) || (p1in && p2in)) {
1343 newpoints[*r_nnewpoints][0] = p2[0];
1344 newpoints[*r_nnewpoints][1] = p2[1];
1347 else if (p1in && !p2in) {
1349 p_intersect_line_2d(p1, p2, cp1, cp2, isect);
1350 newpoints[*r_nnewpoints][0] = isect[0];
1351 newpoints[*r_nnewpoints][1] = isect[1];
1355 else if (!p1in && p2in) {
1356 p_intersect_line_2d(p1, p2, cp1, cp2, isect);
1357 newpoints[*r_nnewpoints][0] = isect[0];
1358 newpoints[*r_nnewpoints][1] = isect[1];
1361 newpoints[*r_nnewpoints][0] = p2[0];
1362 newpoints[*r_nnewpoints][1] = p2[1];
1371 static void p_polygon_kernel_center(
float (*points)[2],
int npoints,
float *
center)
1373 int i,
size, nnewpoints = npoints;
1374 float(*oldpoints)[2], (*newpoints)[2], *p1, *p2;
1377 oldpoints =
MEM_mallocN(
sizeof(
float[2]) *
size,
"PPolygonOldPoints");
1378 newpoints =
MEM_mallocN(
sizeof(
float[2]) *
size,
"PPolygonNewPoints");
1380 memcpy(oldpoints, points,
sizeof(
float[2]) * npoints);
1382 for (i = 0; i < npoints; i++) {
1384 p2 = points[(i + 1) % npoints];
1385 p_polygon_kernel_clip(oldpoints, nnewpoints, newpoints, &nnewpoints, p1, p2);
1387 if (nnewpoints == 0) {
1389 memcpy(oldpoints, points,
sizeof(
float[2]) * npoints);
1390 nnewpoints = npoints;
1393 else if (nnewpoints == 1) {
1395 center[0] = newpoints[0][0];
1396 center[1] = newpoints[0][1];
1404 if (nnewpoints * 2 >
size) {
1408 memcpy(oldpoints, newpoints,
sizeof(
float[2]) * nnewpoints);
1413 float(*sw_points)[2] = oldpoints;
1414 oldpoints = newpoints;
1415 newpoints = sw_points;
1421 for (i = 0; i < nnewpoints; i++) {
1422 center[0] += oldpoints[i][0];
1423 center[1] += oldpoints[i][1];
1440 static float p_vert_cotan(
const float v1[3],
const float v2[3],
const float v3[3])
1442 float a[3],
b[3],
c[3], clen;
1457 static bool p_vert_flipped_wheel_triangle(
PVert *
v)
1467 }
while (
e && (
e !=
v->edge));
1472 static bool p_vert_map_harmonic_weights(
PVert *
v)
1474 float weightsum, positionsum[2], olduv[2];
1477 positionsum[0] = positionsum[1] = 0.0f;
1483 float t1, t2, weight;
1487 v2 =
e->next->next->vert;
1488 t1 = p_vert_cotan(
v2->
co,
e->vert->
co,
v1->co);
1490 v1 =
e->pair->next->vert;
1491 v2 =
e->pair->next->next->vert;
1492 t2 = p_vert_cotan(
v2->
co,
e->pair->vert->
co,
v1->co);
1494 weight = 0.5f * (t1 + t2);
1495 weightsum += weight;
1496 positionsum[0] += weight *
e->pair->vert->uv[0];
1497 positionsum[1] += weight *
e->pair->vert->uv[1];
1500 }
while (
e && (
e !=
v->edge));
1510 v1 =
e->next->next->vert;
1512 t1 = p_vert_cotan(
v1->co,
v->
co,
v2->
co);
1513 t2 = p_vert_cotan(
v2->
co,
v->
co,
v1->co);
1515 weightsum += t1 + t2;
1516 positionsum[0] += (
v2->uv[1] -
v1->uv[1]) + (t1 *
v2->uv[0] + t2 *
v1->uv[0]);
1517 positionsum[1] += (
v1->uv[0] -
v2->uv[0]) + (t1 *
v2->uv[1] + t2 *
v1->uv[1]);
1520 }
while (
e && (
e !=
v->edge));
1523 if (weightsum != 0.0f) {
1524 weightsum = 1.0f / weightsum;
1525 positionsum[0] *= weightsum;
1526 positionsum[1] *= weightsum;
1529 olduv[0] =
v->uv[0];
1530 olduv[1] =
v->uv[1];
1531 v->uv[0] = positionsum[0];
1532 v->uv[1] = positionsum[1];
1534 if (p_vert_flipped_wheel_triangle(
v)) {
1535 v->uv[0] = olduv[0];
1536 v->uv[1] = olduv[1];
1544 static void p_vert_harmonic_insert(
PVert *
v)
1548 if (!p_vert_map_harmonic_weights(
v)) {
1560 }
while (
e && (
e !=
v->edge));
1566 points =
MEM_mallocN(
sizeof(
float[2]) * npoints,
"PHarmonicPoints");
1573 points[i][0] =
e->next->vert->uv[0];
1574 points[i][1] =
e->next->vert->uv[1];
1576 if (nexte ==
NULL) {
1578 points[i][0] =
e->next->next->vert->uv[0];
1579 points[i][1] =
e->next->next->vert->uv[1];
1585 }
while (
e !=
v->edge);
1587 p_polygon_kernel_center(points, npoints,
v->uv);
1595 p_vert_map_harmonic_weights(
e->next->vert);
1598 }
while (
e && (
e !=
v->edge));
1600 p_vert_map_harmonic_weights(
v);
1603 static void p_vert_fix_edge_pointer(
PVert *
v)
1608 while (
v->edge->pair) {
1611 if (
v->edge == start) {
1621 *r_newv =
edge->vert;
1622 *r_keepv =
edge->next->vert;
1626 *r_keepv = pair->
vert;
1630 static void p_collapse_edge(
PEdge *edge,
PEdge *pair)
1632 PVert *oldv, *keepv;
1635 p_collapsing_verts(edge, pair, &oldv, &keepv);
1640 if ((
e != edge) && !(pair && pair->
next ==
e)) {
1645 }
while (
e && (
e != oldv->
edge));
1648 if ((edge && (keepv->
edge ==
edge->next)) || (keepv->
edge == pair)) {
1649 if (edge &&
edge->next->pair) {
1650 keepv->
edge =
edge->next->pair->next;
1655 else if (edge &&
edge->next->next->pair) {
1656 keepv->
edge =
edge->next->next->pair;
1679 p_vert_fix_edge_pointer(e2->vert);
1697 p_vert_fix_edge_pointer(e2->vert);
1700 p_vert_fix_edge_pointer(keepv);
1726 static void p_split_vertex(
PEdge *edge,
PEdge *pair)
1728 PVert *newv, *keepv;
1731 p_collapsing_verts(edge, pair, &newv, &keepv);
1745 p_vert_fix_edge_pointer(e2->vert);
1760 p_vert_fix_edge_pointer(e2->vert);
1764 p_vert_fix_edge_pointer(keepv);
1771 }
while (
e && (
e != newv->
edge));
1774 static bool p_collapse_allowed_topologic(
PEdge *edge,
PEdge *pair)
1776 PVert *oldv, *keepv;
1778 p_collapsing_verts(edge, pair, &oldv, &keepv);
1781 if (!edge || !pair) {
1783 if (edge && !
edge->next->pair && !
edge->next->next->pair) {
1799 static bool p_collapse_normal_flipped(
float *
v1,
float *
v2,
float *vold,
float *vnew)
1801 float nold[3], nnew[3], sub1[3], sub2[3];
1811 return (
dot_v3v3(nold, nnew) <= 0.0f);
1814 static bool p_collapse_allowed_geometric(
PEdge *edge,
PEdge *pair)
1816 PVert *oldv, *keepv;
1818 float angulardefect,
angle;
1820 p_collapsing_verts(edge, pair, &oldv, &keepv);
1822 angulardefect = 2 *
M_PI;
1826 float a[3],
b[3], minangle, maxangle;
1832 angulardefect -=
angle;
1835 if (
v1 == keepv ||
v2 == keepv) {
1840 if (p_collapse_normal_flipped(
v1->co,
v2->
co, oldv->
co, keepv->
co)) {
1853 minangle = 15.0f *
M_PI / 180.0f;
1854 maxangle =
M_PI - minangle;
1856 for (i = 0; i < 3; i++) {
1857 if ((
b[i] <
a[i]) && (
b[i] < minangle)) {
1860 else if ((
b[i] >
a[i]) && (
b[i] > maxangle)) {
1866 }
while (
e && (
e != oldv->
edge));
1870 if (
fabsf(angulardefect) > (
float)(
M_PI * 30.0 / 180.0)) {
1893 static bool p_collapse_allowed(
PEdge *edge,
PEdge *pair)
1895 PVert *oldv, *keepv;
1897 p_collapsing_verts(edge, pair, &oldv, &keepv);
1903 return (p_collapse_allowed_topologic(edge, pair) && p_collapse_allowed_geometric(edge, pair));
1906 static float p_collapse_cost(
PEdge *edge,
PEdge *pair)
1911 PVert *oldv, *keepv;
1913 PFace *oldf1, *oldf2;
1914 float volumecost = 0.0f, areacost = 0.0f, edgevec[3], cost, weight, elen;
1915 float shapecost = 0.0f;
1916 float shapeold = 0.0f, shapenew = 0.0f;
1917 int nshapeold = 0, nshapenew = 0;
1919 p_collapsing_verts(edge, pair, &oldv, &keepv);
1921 oldf2 = (pair) ? pair->
face :
NULL;
1928 float *co1 =
e->next->vert->
co;
1929 float *co2 =
e->next->next->vert->
co;
1931 if (!
ELEM(
e->face, oldf1, oldf2)) {
1932 float tetrav2[3], tetrav3[3];
1948 a1 = a1 -
M_PI / 3.0;
1949 a2 = a2 -
M_PI / 3.0;
1950 a3 = a3 -
M_PI / 3.0;
1951 shapeold = (a1 * a1 + a2 * a2 + a3 * a3) / (
M_PI_2 *
M_PI_2);
1957 a1 = a1 -
M_PI / 3.0;
1958 a2 = a2 -
M_PI / 3.0;
1959 a3 = a3 -
M_PI / 3.0;
1960 shapenew = (a1 * a1 + a2 * a2 + a3 * a3) / (
M_PI_2 *
M_PI_2);
1966 }
while (
e && (
e != oldv->
edge));
1977 cost = weight * volumecost * volumecost + elen * elen * areacost * areacost;
1981 shapeold /= nshapeold;
1982 shapenew /= nshapenew;
1983 shapecost = (shapeold + 0.00001) / (shapenew + 0.00001);
1991 static void p_collapse_cost_vertex(
PVert *vert,
float *r_mincost,
PEdge **r_mine)
1999 if (p_collapse_allowed(
e,
e->pair)) {
2000 float cost = p_collapse_cost(
e,
e->pair);
2002 if ((*r_mine ==
NULL) || (cost < *r_mincost)) {
2010 if (enext ==
NULL) {
2012 pair =
e->next->next;
2014 if (p_collapse_allowed(
NULL, pair)) {
2015 float cost = p_collapse_cost(
NULL, pair);
2017 if ((*r_mine ==
NULL) || (cost < *r_mincost)) {
2027 }
while (
e != vert->
edge);
2030 static void p_chart_post_collapse_flush(
PChart *chart,
PEdge *collapsed)
2045 nextv =
v->nextlink;
2052 v->nextlink = chart->
verts;
2058 for (
e = edges;
e;
e = nexte) {
2059 nexte =
e->nextlink;
2067 e->nextlink = chart->
edges;
2076 for (
e = collapsed;
e;
e =
e->nextlink) {
2077 e->nextlink =
e->u.nextcollapse;
2085 for (f =
faces; f; f = nextf) {
2100 static void p_chart_post_split_flush(
PChart *chart)
2109 nextv =
v->nextlink;
2110 v->nextlink = chart->
verts;
2116 nexte =
e->nextlink;
2117 e->nextlink = chart->
edges;
2134 static void p_chart_simplify_compute(
PChart *chart)
2144 int nwheelverts, i, ncollapsed = 0;
2149 for (
v = chart->
verts;
v;
v =
v->nextlink) {
2153 p_collapse_cost_vertex(
v, &cost, &
e);
2159 v->u.heaplink =
NULL;
2163 for (
e = chart->
edges;
e;
e =
e->nextlink) {
2164 e->u.nextcollapse =
NULL;
2169 if (ncollapsed == NCOLLAPSE) {
2175 PVert *oldv, *keepv;
2176 PEdge *wheele, *nexte;
2179 edge->u.nextcollapse = collapsededges;
2180 collapsededges =
edge;
2182 if (
edge->vert->u.heaplink != link) {
2184 edge->next->vert->u.heaplink =
NULL;
2192 p_collapsing_verts(edge, pair, &oldv, &keepv);
2196 wheele = oldv->
edge;
2199 wheelverts[nwheelverts++] = wheele->
next->
vert;
2202 if (nexte ==
NULL) {
2207 }
while (wheele && (wheele != oldv->
edge));
2210 p_collapse_edge(edge, pair);
2212 for (i = 0; i < nwheelverts; i++) {
2218 if (
v->u.heaplink) {
2220 v->u.heaplink =
NULL;
2223 p_collapse_cost_vertex(
v, &cost, &collapse);
2236 p_chart_post_collapse_flush(chart, collapsededges);
2239 static void p_chart_complexify(
PChart *chart)
2242 PVert *newv, *keepv;
2257 p_split_vertex(edge, pair);
2258 p_collapsing_verts(edge, pair, &newv, &keepv);
2260 if (
x >= NCOLLAPSEX) {
2261 newv->
uv[0] = keepv->
uv[0];
2262 newv->
uv[1] = keepv->
uv[1];
2265 p_vert_harmonic_insert(newv);
2270 p_chart_post_split_flush(chart);
2274 static void p_chart_simplify(
PChart *chart)
2283 #define ABF_MAX_ITER 20
2347 for (i = 0; i < sys->
nangles; i++, sine++, cosine++, alpha++) {
2348 *sine =
sinf(*alpha);
2349 *cosine =
cosf(*alpha);
2365 if (aid == e1->
u.
id) {
2375 if (aid == e2->
u.
id) {
2384 e =
e->next->next->pair;
2385 }
while (
e && (
e !=
v->edge));
2387 return (sin1 - sin2);
2392 PVert *
v =
e->vert, *
v1 =
e->next->vert, *
v2 =
e->next->next->vert;
2424 float gtriangle, galpha1, galpha2, galpha3;
2431 sys->
bAlpha[e2->u.id] = -galpha2;
2432 sys->
bAlpha[e3->u.id] = -galpha3;
2434 norm += galpha1 * galpha1 + galpha2 * galpha2 + galpha3 * galpha3;
2438 norm += gtriangle * gtriangle;
2441 for (
v = chart->
verts;
v;
v =
v->nextlink) {
2443 float gplanar = -2 *
M_PI, glength;
2447 gplanar += sys->
alpha[
e->u.id];
2448 e =
e->next->next->pair;
2449 }
while (
e && (
e !=
v->edge));
2452 norm += gplanar * gplanar;
2456 norm += glength * glength;
2466 int nvar = 2 * ninterior;
2469 for (
int i = 0; i < nvar; i++) {
2474 float wi1, wi2, wi3,
b, si,
beta[3], j2[3][3], W[3][3];
2475 float row1[6], row2[6], row3[6];
2481 wi2 = 1.0f / sys->
weight[e2->u.id];
2482 wi3 = 1.0f / sys->
weight[e3->u.id];
2486 b += sys->
bAlpha[e2->u.id] * wi2;
2487 b += sys->
bAlpha[e3->u.id] * wi3;
2491 si = 1.0f / (wi1 + wi2 + wi3);
2507 W[1][1] = si - sys->
weight[e2->u.id];
2511 W[2][2] = si - sys->
weight[e3->u.id];
2513 vid[0] = vid[1] = vid[2] = vid[3] = vid[4] = vid[5] = -1;
2517 vid[3] = ninterior +
v1->u.id;
2519 sys->
J2dt[e1->
u.
id][0] = j2[0][0] = 1.0f * wi1;
2527 row1[0] = j2[0][0] * W[0][0];
2528 row2[0] = j2[0][0] * W[1][0];
2529 row3[0] = j2[0][0] * W[2][0];
2531 row1[3] = j2[1][0] * W[0][1] + j2[2][0] * W[0][2];
2532 row2[3] = j2[1][0] * W[1][1] + j2[2][0] * W[1][2];
2533 row3[3] = j2[1][0] * W[2][1] + j2[2][0] * W[2][2];
2538 vid[4] = ninterior +
v2->u.id;
2541 sys->
J2dt[e2->u.id][1] = j2[1][1] = 1.0f * wi2;
2548 row1[1] = j2[1][1] * W[0][1];
2549 row2[1] = j2[1][1] * W[1][1];
2550 row3[1] = j2[1][1] * W[2][1];
2552 row1[4] = j2[0][1] * W[0][0] + j2[2][1] * W[0][2];
2553 row2[4] = j2[0][1] * W[1][0] + j2[2][1] * W[1][2];
2554 row3[4] = j2[0][1] * W[2][0] + j2[2][1] * W[2][2];
2559 vid[5] = ninterior + v3->u.id;
2563 sys->
J2dt[e3->u.id][2] = j2[2][2] = 1.0f * wi3;
2567 context, 0, ninterior + v3->u.id, j2[0][2] *
beta[0] + j2[1][2] *
beta[1]);
2569 row1[2] = j2[2][2] * W[0][2];
2570 row2[2] = j2[2][2] * W[1][2];
2571 row3[2] = j2[2][2] * W[2][2];
2573 row1[5] = j2[0][2] * W[0][0] + j2[1][2] * W[0][1];
2574 row2[5] = j2[0][2] * W[1][0] + j2[1][2] * W[1][1];
2575 row3[5] = j2[0][2] * W[2][0] + j2[1][2] * W[2][1];
2578 for (
int i = 0; i < 3; i++) {
2585 for (
int j = 0; j < 6; j++) {
2620 float dlambda1, pre[3], dalpha;
2624 pre[0] = pre[1] = pre[2] = 0.0;
2629 pre[0] += sys->
J2dt[e1->
u.
id][0] *
x;
2630 pre[1] += sys->
J2dt[e2->u.id][0] *
x2;
2631 pre[2] += sys->
J2dt[e3->u.id][0] *
x2;
2638 pre[1] += sys->
J2dt[e2->u.id][1] *
x;
2639 pre[2] += sys->
J2dt[e3->u.id][1] *
x2;
2646 pre[1] += sys->
J2dt[e2->u.id][2] *
x2;
2647 pre[2] += sys->
J2dt[e3->u.id][2] *
x;
2650 dlambda1 = pre[0] + pre[1] + pre[2];
2655 dalpha = (sys->
bAlpha[e1->
u.
id] - dlambda1);
2658 dalpha = (sys->
bAlpha[e2->u.id] - dlambda1);
2659 sys->
alpha[e2->u.id] += dalpha / sys->
weight[e2->u.id] - pre[1];
2661 dalpha = (sys->
bAlpha[e3->u.id] - dlambda1);
2662 sys->
alpha[e3->u.id] += dalpha / sys->
weight[e3->u.id] - pre[2];
2670 else if (sys->
alpha[
e->u.id] < 0.0f) {
2671 sys->
alpha[
e->u.id] = 0.0f;
2673 }
while (
e != f->
edge);
2676 for (
int i = 0; i < ninterior; i++) {
2694 float limit = (chart->
nfaces > 100) ? 1.0f : 0.001f;
2699 for (
v = chart->
verts;
v;
v =
v->nextlink) {
2755 sys.
weight[e1->
u.
id] = 2.0f / (a1 * a1);
2756 sys.
weight[e2->
u.
id] = 2.0f / (a2 * a2);
2757 sys.
weight[e3->
u.
id] = 2.0f / (a3 * a3);
2760 for (
v = chart->
verts;
v;
v =
v->nextlink) {
2762 float anglesum = 0.0, scale;
2766 anglesum += sys.
beta[
e->u.id];
2767 e =
e->next->next->pair;
2768 }
while (
e && (
e !=
v->edge));
2770 scale = (anglesum == 0.0f) ? 0.0f : 2.0f * (
float)
M_PI / anglesum;
2775 e =
e->next->next->pair;
2776 }
while (
e && (
e !=
v->edge));
2821 if (!*pin1 || !*pin2 || *pin1 == *pin2) {
2827 (*pin1)->
uv[0] = 0.0f;
2828 (*pin1)->uv[1] = 0.5f;
2829 (*pin2)->uv[0] = 1.0f;
2830 (*pin2)->uv[1] = 0.5f;
2833 int diru, dirv, dirx, diry;
2837 sub[0] =
fabsf(sub[0]);
2838 sub[1] =
fabsf(sub[1]);
2839 sub[2] =
fabsf(sub[2]);
2841 if ((sub[0] > sub[1]) && (sub[0] > sub[2])) {
2843 diry = (sub[1] > sub[2]) ? 1 : 2;
2845 else if ((sub[1] > sub[0]) && (sub[1] > sub[2])) {
2847 diry = (sub[0] > sub[2]) ? 0 : 2;
2851 diry = (sub[0] > sub[1]) ? 0 : 1;
2863 (*pin1)->uv[diru] = (*pin1)->co[dirx];
2864 (*pin1)->uv[dirv] = (*pin1)->co[diry];
2865 (*pin2)->uv[diru] = (*pin2)->co[dirx];
2866 (*pin2)->uv[dirv] = (*pin2)->co[diry];
2874 float maxlen = 0.0f, curlen = 0.0f, totlen = 0.0f, firstlen = 0.0f;
2900 if (curlen > maxlen) {
2906 if (firste1 == cure) {
2917 }
while (be != outer);
2920 if (cure && (cure != outer)) {
2923 if (firstlen > maxlen) {
2930 if (!maxe1 || !maxe2 || (maxlen < 0.5f * totlen)) {
2949 }
while (be1 != be2);
2968 }
while (be1 != be2);
2979 float minv[3], maxv[3], dirlen;
2980 PVert *
v, *minvert[3], *maxvert[3];
2984 minv[0] = minv[1] = minv[2] = 1e20;
2985 maxv[0] = maxv[1] = maxv[2] = -1e20;
2987 minvert[0] = minvert[1] = minvert[2] =
NULL;
2988 maxvert[0] = maxvert[1] = maxvert[2] =
NULL;
2990 for (
v = chart->
verts;
v;
v =
v->nextlink) {
2991 for (i = 0; i < 3; i++) {
2992 if (
v->
co[i] < minv[i]) {
2996 if (
v->
co[i] > maxv[i]) {
3007 for (i = 0; i < 3; i++) {
3008 if (maxv[i] - minv[i] > dirlen) {
3010 dirlen = maxv[i] - minv[i];
3014 *pin1 = minvert[dir];
3015 *pin2 = maxvert[dir];
3025 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3034 bool select =
false, deselect =
false;
3035 int npins = 0,
id = 0;
3038 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3051 if ((live && (!
select || !deselect))) {
3056 p_chart_simplify_compute(chart);
3057 p_chart_topological_sanity_check(chart);
3062 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3072 param_warning(
"ABF solving failed: falling back to LSCM.\n");
3091 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3106 float area_pinned_up, area_pinned_down;
3114 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3138 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3150 area_pinned_up = 0.0f;
3151 area_pinned_down = 0.0f;
3161 area_pinned_up +=
area;
3164 area_pinned_down -=
area;
3169 flip_faces = (area_pinned_down > area_pinned_up);
3177 float a1, a2, a3, ratio, cosine, sine;
3178 float sina1, sina2, sina3, sinmax;
3191 SWAP(
float, a2, a3);
3200 sinmax =
max_fff(sina1, sina2, sina3);
3203 if (sina3 != sinmax) {
3205 SHIFT3(
float, a1, a2, a3);
3206 SHIFT3(
float, sina1, sina2, sina3);
3208 if (sina2 == sinmax) {
3210 SHIFT3(
float, a1, a2, a3);
3211 SHIFT3(
float, sina1, sina2, sina3);
3216 ratio = (sina3 == 0.0f) ? 1.0f : sina2 / sina3;
3217 cosine =
cosf(a1) * ratio;
3218 sine = sina1 * ratio;
3240 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3254 if (new_area > 0.0f) {
3284 #define P_STRETCH_ITER 20
3290 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3291 if (
v->edge->pair ==
NULL) {
3316 w = 1.0f / (2.0f *
area);
3365 }
while (
e &&
e != (
v->edge));
3375 float orig_stretch,
low, stretch_low,
high, stretch_high, mid, stretch;
3376 float orig_uv[2], dir[2], random_angle, trusted_radius;
3378 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3384 orig_uv[0] =
v->uv[0];
3385 orig_uv[1] =
v->uv[1];
3388 trusted_radius = 0.0f;
3397 }
while (
e &&
e != (
v->edge));
3399 trusted_radius /= 2 * nedges;
3402 dir[0] = trusted_radius *
cosf(random_angle);
3403 dir[1] = trusted_radius *
sinf(random_angle);
3407 stretch_low = orig_stretch;
3416 v->uv[0] = orig_uv[0] + mid * dir[0];
3417 v->uv[1] = orig_uv[1] + mid * dir[1];
3420 if (stretch_low < stretch_high) {
3422 stretch_high = stretch;
3426 stretch_low = stretch;
3431 if (stretch >= orig_stretch) {
3444 if (
v1->uv[0] <
v2->uv[0]) {
3447 if (
v1->uv[0] ==
v2->uv[0]) {
3448 if (
v1->uv[1] <
v2->uv[1]) {
3451 if (
v1->uv[1] ==
v2->uv[1]) {
3465 int npoints = 0, i, ulen, llen;
3466 PVert **
U, **
L, **points, **p;
3494 for (p = points, i = 0; i < npoints; i++, p++) {
3495 while ((ulen > 1) && (
p_area_signed(
U[ulen - 2]->uv, (*p)->uv,
U[ulen - 1]->uv) <= 0)) {
3498 while ((llen > 1) && (
p_area_signed(
L[llen - 2]->uv, (*p)->uv,
L[llen - 1]->uv) >= 0)) {
3509 for (p = points, i = 0; i < ulen; i++, p++, npoints++) {
3514 for (i = llen - 2; i > 0; i--, p++, npoints++) {
3519 *r_nverts = npoints;
3520 *r_right = ulen - 1;
3535 orthodir[0] = dir[1];
3536 orthodir[1] = -dir[0];
3558 float rotated, minarea, minangle,
area,
len;
3559 float *angles, miny, maxy,
v[2],
a[4], mina;
3560 int npoints,
right, i_min, i_max, i, idx[4], nextidx;
3561 PVert **points, *p1, *p2, *p3, *p4, *p1n;
3569 angles =
MEM_mallocN(
sizeof(
float) * npoints,
"PMinAreaAngles");
3575 for (i = 0; i < npoints; i++) {
3576 p1 = (i == 0) ? points[npoints - 1] : points[i - 1];
3578 p3 = (i == npoints - 1) ? points[0] : points[i + 1];
3582 if (points[i]->uv[1] < miny) {
3583 miny = points[i]->
uv[1];
3586 if (points[i]->uv[1] > maxy) {
3587 maxy = points[i]->
uv[1];
3598 v[0] = points[idx[0]]->
uv[0];
3599 v[1] = points[idx[0]]->
uv[1] + 1.0f;
3600 a[0] =
p_vec2_angle(points[(idx[0] + 1) % npoints]->uv, points[idx[0]]->uv,
v);
3602 v[0] = points[idx[1]]->
uv[0] + 1.0f;
3603 v[1] = points[idx[1]]->
uv[1];
3604 a[1] =
p_vec2_angle(points[(idx[1] + 1) % npoints]->uv, points[idx[1]]->uv,
v);
3606 v[0] = points[idx[2]]->
uv[0];
3607 v[1] = points[idx[2]]->
uv[1] - 1.0f;
3608 a[2] =
p_vec2_angle(points[(idx[2] + 1) % npoints]->uv, points[idx[2]]->uv,
v);
3610 v[0] = points[idx[3]]->
uv[0] - 1.0f;
3611 v[1] = points[idx[3]]->
uv[1];
3612 a[3] =
p_vec2_angle(points[(idx[3] + 1) % npoints]->uv, points[idx[3]]->uv,
v);
3620 while (rotated <= (
float)
M_PI_2) {
3625 for (i = 0; i < 4; i++) {
3633 nextidx = (idx[i_min] + 1) % npoints;
3635 a[i_min] = angles[nextidx];
3636 a[(i_min + 1) % 4] =
a[(i_min + 1) % 4] - mina;
3637 a[(i_min + 2) % 4] =
a[(i_min + 2) % 4] - mina;
3638 a[(i_min + 3) % 4] =
a[(i_min + 3) % 4] - mina;
3641 p1 = points[idx[i_min]];
3642 p1n = points[nextidx];
3643 p2 = points[idx[(i_min + 1) % 4]];
3644 p3 = points[idx[(i_min + 2) % 4]];
3645 p4 = points[idx[(i_min + 3) % 4]];
3651 v[0] = (p1n->
uv[0] - p1->
uv[0]) *
len;
3652 v[1] = (p1n->
uv[1] - p1->
uv[1]) *
len;
3657 if (
area < minarea) {
3663 idx[i_min] = nextidx;
3667 if (minangle > (
float)
M_PI_4) {
3684 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3685 float oldu =
v->uv[0], oldv =
v->uv[1];
3686 v->uv[0] = cosine * oldu - sine * oldv;
3687 v->uv[1] = sine * oldu + cosine * oldv;
3701 if (
angle != 0.0f) {
3718 handle->
aspx = 1.0f;
3719 handle->
aspy = 1.0f;
3730 phandle->
aspx = aspx;
3731 phandle->
aspy = aspy;
3740 for (i = 0; i < phandle->
ncharts; i++) {
3793 pinuvlist = pinuvlist->
next;
3796 if (bestdistsquared > distsquared) {
3797 bestdistsquared = distsquared;
3800 pinuvlist = pinuvlist->
next;
3831 if (!pinuvlist->
next) {
3835 pinuvlist = pinuvlist->
next;
3851 uint nfilltri = nverts - 2;
3859 const float *co_curr, *co_prev = co[nverts - 1];
3860 for (
int j = 0; j < nverts; j++) {
3870 float axis_mat[3][3];
3872 for (
int j = 0; j < nverts; j++) {
3882 for (
int j = 0; j < nfilltri; j++) {
3883 uint *tri = tris[j];
3888 const ParamKey tri_vkeys[3] = {vkeys[v0], vkeys[
v1], vkeys[
v2]};
3889 const float *tri_co[3] = {co[v0], co[
v1], co[
v2]};
3891 bool tri_pin[3] = {pin[v0], pin[
v1], pin[
v2]};
3917 else if (nverts == 4) {
3948 bool topology_from_uvs,
3968 for (i = j = 0; i < phandle->
ncharts; i++) {
3970 chart = phandle->
charts[i];
3974 if (!topology_from_uvs && chart->
nboundaries == 0) {
3976 if (count_fail !=
NULL) {
3982 phandle->
charts[j] = chart;
3989 for (
v = chart->
verts;
v;
v =
v->nextlink) {
4007 for (i = 0; i < phandle->
ncharts; i++) {
4022 for (i = 0; i < phandle->
ncharts; i++) {
4023 chart = phandle->
charts[i];
4041 if (count_changed !=
NULL) {
4042 *count_changed += 1;
4046 if (count_failed !=
NULL) {
4060 for (i = 0; i < phandle->
ncharts; i++) {
4063 p_chart_complexify(phandle->
charts[i]);
4081 phandle->
blend = 0.0f;
4083 for (i = 0; i < phandle->
ncharts; i++) {
4084 chart = phandle->
charts[i];
4086 for (
v = chart->
verts;
v;
v =
v->nextlink) {
4112 for (i = 0; i < phandle->
ncharts; i++) {
4113 chart = phandle->
charts[i];
4133 for (i = 0; i < phandle->
ncharts; i++) {
4134 chart = phandle->
charts[i];
4151 float tot_width, tot_height, scale;
4154 int i, unpacked = 0;
4167 if (handle->
aspx != handle->
aspy) {
4174 for (i = 0; i < handle->
ncharts; i++) {
4175 chart = handle->
charts[i];
4182 box = boxarray + (i - unpacked);
4186 trans[0] = -trans[0];
4187 trans[1] = -trans[1];
4195 if (margin > 0.0f) {
4200 if (margin > 0.0f) {
4207 for (i = 0; i < handle->
ncharts; i++) {
4208 chart = handle->
charts[i];
4215 box = boxarray + (i - unpacked);
4219 box->
w += margin * 2;
4220 box->
h += margin * 2;
4226 if (tot_height > tot_width) {
4227 scale = tot_height != 0.0f ? (1.0f / tot_height) : 1.0f;
4230 scale = tot_width != 0.0f ? (1.0f / tot_width) : 1.0f;
4233 for (i = 0; i < handle->
ncharts - unpacked; i++) {
4244 if (handle->
aspx != handle->
aspy) {
4256 float tot_uvarea = 0.0f, tot_facearea = 0.0f;
4258 float minv[2], maxv[2], trans[2];
4264 for (i = 0; i < phandle->
ncharts; i++) {
4265 chart = phandle->
charts[i];
4274 if (scale_uv || shear) {
4279 for (
int j = 0; j < max_iter; j++) {
4283 double scale_cou = 0;
4284 double scale_cov = 0;
4285 double scale_cross = 0;
4286 double weight_sum = 0;
4288 float m[2][2], s[2][2];
4292 s[0][0] = va->
uv[0] - vc->
uv[0];
4293 s[0][1] = va->
uv[1] - vc->
uv[1];
4294 s[1][0] = vb->
uv[0] - vc->
uv[0];
4295 s[1][1] = vb->
uv[1] - vc->
uv[1];
4301 float cou[3], cov[3];
4302 for (
int k = 0; k < 3; k++) {
4303 cou[k] = m[0][0] * (va->
co[k] - vc->
co[k]) + m[0][1] * (vb->
co[k] - vc->
co[k]);
4304 cov[k] = m[1][0] * (va->
co[k] - vc->
co[k]) + m[1][1] * (vb->
co[k] - vc->
co[k]);
4307 scale_cou +=
len_v3(cou) * weight;
4308 scale_cov +=
len_v3(cov) * weight;
4317 scale_cross +=
dot_v3v3(cou, cov) * weight;
4319 weight_sum += weight;
4321 if (scale_cou * scale_cov < 1e-10f) {
4324 const float scale_factor_u = scale_uv ?
sqrtf(scale_cou / scale_cov) : 1.0f;
4328 t[0][0] = scale_factor_u;
4329 t[1][0] =
clamp_f((
float)(scale_cross / weight_sum), -0.5f, 0.5f);
4331 t[1][1] = 1.0f / scale_factor_u;
4340 const float tolerance = 1e-6f;
4341 if (
err < tolerance) {
4360 if (tot_facearea == tot_uvarea || tot_facearea == 0.0f || tot_uvarea == 0.0f) {
4365 tot_fac = tot_facearea / tot_uvarea;
4367 for (i = 0; i < phandle->
ncharts; i++) {
4368 chart = phandle->
charts[i];
4397 for (i = 0; i < phandle->
ncharts; i++) {
4398 chart = phandle->
charts[i];
4408 for (i = 0; i < phandle->
ncharts; i++) {
4409 chart = phandle->
charts[i];
4415 if (phandle->
blend == 0.0f) {
4430 for (i = 0; i < phandle->
ncharts; i++) {
4431 chart = phandle->
charts[i];
typedef float(TangentPoint)[2]
void BLI_box_pack_2d(BoxPack *boxarray, unsigned int len, float *r_tot_x, float *r_tot_y)
float BLI_convexhull_aabb_fit_points_2d(const float(*points)[2], unsigned int n)
GHash * BLI_ghash_int_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
A min-heap / priority queue ADT.
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1)
void void bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1)
void * BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1)
Heap * BLI_heap_new_ex(unsigned int reserve_num) ATTR_WARN_UNUSED_RESULT
HeapNode * BLI_heap_insert(Heap *heap, float value, void *ptr) ATTR_NONNULL(1)
HeapNode * BLI_heap_top(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Heap * BLI_heap_new(void) ATTR_WARN_UNUSED_RESULT
void void BLI_heap_remove(Heap *heap, HeapNode *node) ATTR_NONNULL(1
MINLINE float max_fff(float a, float b, float c)
MINLINE float clamp_f(float value, float min, float max)
float volume_tri_tetrahedron_signed_v3(const float v1[3], const float v2[3], const float v3[3])
void axis_dominant_v3_to_m3_negate(float r_mat[3][3], const float normal[3])
float area_tri_v3(const float v1[3], const float v2[3], const float v3[3])
bool invert_m2_m2(float R[2][2], const float A[2][2])
void mul_v2_m3v3(float r[2], const float M[3][3], const float a[3])
void mul_m2_v2(const float M[2][2], float v[2])
void angle_to_mat2(float R[2][2], float angle)
float angle_v2v2v2(const float a[2], const float b[2], const float c[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void add_newell_cross_v3_v3v3(float n[3], const float v_prev[3], const float v_curr[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void negate_v2(float r[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
void mid_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE bool equals_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void BLI_memarena_free(struct MemArena *ma) ATTR_NONNULL(1)
struct MemArena * BLI_memarena_new(size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(2) ATTR_MALLOC
#define BLI_MEMARENA_STD_BUFSIZE
void * BLI_memarena_alloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
void void BLI_memarena_clear(MemArena *ma) ATTR_NONNULL(1)
void BLI_polyfill_calc_arena(const float(*coords)[2], unsigned int coords_num, int coords_sign, unsigned int(*r_tris)[3], struct MemArena *arena)
#define BLI_POLYFILL_ALLOC_NGON_RESERVE
void BLI_polyfill_beautify(const float(*coords)[2], unsigned int coords_num, unsigned int(*tris)[3], struct MemArena *arena, struct Heap *eheap)
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
struct RNG * BLI_rng_new(unsigned int seed)
float BLI_rng_get_float(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define INIT_MINMAX2(min, max)
#define POINTER_FROM_INT(i)
#define SHIFT3(type, a, b, c)
typedef double(DMatrix)[4][4]
NSNotificationCenter * center
_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 GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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 y
_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 GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_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 GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble right
_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
_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 GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_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 GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
#define MEM_SIZE_OPTIMAL(size)
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
__forceinline ssef low(const avxf &a)
__forceinline ssef high(const avxf &a)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static T sum(const btAlignedObjectArray< T > &items)
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
IconTextureDrawCall normal
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void EIG_linear_solver_variable_set(LinearSolver *solver, int rhs, int index, double value)
LinearSolver * EIG_linear_solver_new(int num_rows, int num_columns, int num_rhs)
void EIG_linear_solver_right_hand_side_add(LinearSolver *solver, int rhs, int index, double value)
LinearSolver * EIG_linear_least_squares_solver_new(int num_rows, int num_columns, int num_rhs)
void EIG_linear_solver_delete(LinearSolver *solver)
double EIG_linear_solver_variable_get(LinearSolver *solver, int rhs, int index)
void EIG_linear_solver_matrix_add(LinearSolver *solver, int row, int col, double value)
bool EIG_linear_solver_solve(LinearSolver *solver)
void EIG_linear_solver_variable_lock(LinearSolver *solver, int index)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
GAttributeReader lookup(const void *owner, const AttributeIDRef &attribute_id)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
_W64 unsigned int uintptr_t
struct GeoUVPinIndex * next
union PChart::PChartUnion u
union PEdge::PEdgeUnion u
union PFace::PFaceUnion u
union PVert::PVertUnion u
MemArena * polyfill_arena
PChart * construction_chart
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)
struct PChart::PChartUnion::PChartLscm lscm
struct PChart::PChartUnion::PChartPack pack
struct PEdge * nextcollapse
ccl_device_inline float beta(float x, float y)
static void phash_insert(PHash *ph, PHashLink *link)
static float p_face_stretch(PFace *f)
static void p_triangle_angles(const float v1[3], const float v2[3], const float v3[3], float *r_a1, float *r_a2, float *r_a3)
void GEO_uv_parametrizer_flush_restore(ParamHandle *phandle)
static PChart * p_chart_new(ParamHandle *handle)
void GEO_uv_parametrizer_construct_end(ParamHandle *phandle, bool fill, bool topology_from_uvs, int *count_fail)
static PEdge * p_edge_lookup(ParamHandle *handle, const PHashKey *vkeys)
static float p_abf_compute_grad_alpha(PAbfSystem *sys, PFace *f, PEdge *e)
static bool p_chart_symmetry_pins(PChart *chart, PEdge *outer, PVert **pin1, PVert **pin2)
static GeoUVPinIndex * new_geo_uv_pinindex(ParamHandle *handle, const float uv[2])
static void p_split_vert(PChart *chart, PEdge *e)
void GEO_uv_parametrizer_lscm_end(ParamHandle *phandle)
#define PHASH_hash(ph, item)
static float p_edge_boundary_angle(PEdge *e)
static bool p_abf_matrix_invert(PAbfSystem *sys, PChart *chart)
static void p_chart_lscm_load_solution(PChart *chart)
static void p_chart_fill_boundaries(PChart *chart, PEdge *outer)
static void p_add_ngon(ParamHandle *handle, const ParamKey key, const int nverts, const ParamKey *vkeys, const float **co, float **uv, const bool *pin, const bool *select)
static void p_chart_uv_to_array(PChart *chart, float(*points)[2])
static void p_abf_setup_system(PAbfSystem *sys)
static PFace * p_face_add(ParamHandle *handle)
static float p_abf_compute_sin_product(PAbfSystem *sys, PVert *v, int aid)
static float p_edge_length(PEdge *e)
static PEdge * p_wheel_edge_next(PEdge *e)
static bool p_chart_abf_solve(PChart *chart)
static void p_chart_rotate_fit_aabb(PChart *chart)
static void p_stretch_pin_boundary(PChart *chart)
static bool p_edge_implicit_seam(PEdge *e, PEdge *ep)
ParamHandle * GEO_uv_parametrizer_construct_begin(void)
void GEO_uv_prepare_pin_index(ParamHandle *handle, const int bmvertindex, const float uv[2])
static float p_area_signed(const float v1[2], const float v2[2], const float v3[2])
static PHash * phash_new(PHashLink **list, int sizehint)
static bool p_edge_has_pair(ParamHandle *handle, PEdge *e, bool topology_from_uvs, PEdge **r_pair)
static void GEO_uv_parametrizer_pack_rotate(ParamHandle *phandle, bool ignore_pinned)
void GEO_uv_parametrizer_edge_set_seam(ParamHandle *phandle, ParamKey *vkeys)
static bool p_chart_convex_hull(PChart *chart, PVert ***r_verts, int *r_nverts, int *r_right)
void GEO_uv_parametrizer_lscm_begin(ParamHandle *phandle, bool live, bool abf)
static bool p_intersect_line_2d_dir(const float v1[2], const float dir1[2], const float v2[2], const float dir2[2], float r_isect[2])
void GEO_uv_parametrizer_flush(ParamHandle *phandle)
#define param_assert(condition)
static void p_chart_boundaries(PChart *chart, PEdge **r_outer)
#define PHASH_edge(v1, v2)
struct PAbfSystem PAbfSystem
static void p_chart_lscm_end(PChart *chart)
static void p_chart_extrema_verts(PChart *chart, PVert **pin1, PVert **pin2)
static float p_face_uv_area_signed(PFace *f)
static void p_chart_uv_translate(PChart *chart, const float trans[2])
void GEO_uv_parametrizer_stretch_iter(ParamHandle *phandle)
#define PEDGE_VERTEX_FLAGS
void GEO_uv_parametrizer_pack(ParamHandle *handle, float margin, bool do_rotate, bool ignore_pinned)
static void p_abf_compute_sines(PAbfSystem *sys)
struct ParamHandle ParamHandle
static void p_flush_uvs_blend(ParamHandle *handle, PChart *chart, float blend)
static void p_chart_pin_positions(PChart *chart, PVert **pin1, PVert **pin2)
static void phash_delete(PHash *ph)
static float p_chart_uv_area(PChart *chart)
static PVert * p_vert_copy(PChart *chart, PVert *v)
void GEO_uv_parametrizer_face_add(ParamHandle *phandle, const ParamKey key, const int nverts, const ParamKey *vkeys, const float **co, float **uv, const bool *pin, const bool *select)
static float p_vec2_angle(const float v1[2], const float v2[2], const float v3[2])
static int p_connect_pairs(ParamHandle *handle, bool topology_from_uvs)
static PHashLink * phash_next(PHash *ph, PHashKey key, PHashLink *link)
static PEdge * p_boundary_edge_prev(PEdge *e)
static void p_chart_lscm_begin(PChart *chart, bool live, bool abf)
static bool p_vert_interior(PVert *v)
static PVert * p_vert_lookup(ParamHandle *handle, PHashKey key, const float co[3], PEdge *e)
static void p_chart_uv_transform(PChart *chart, const float mat[2][2])
void GEO_uv_parametrizer_stretch_end(ParamHandle *phandle)
void GEO_uv_parametrizer_stretch_begin(ParamHandle *phandle)
static PFace * p_face_add_fill(PChart *chart, PVert *v1, PVert *v2, PVert *v3)
static void p_abf_free_system(PAbfSystem *sys)
static void p_chart_rotate_minimum_area(PChart *chart)
static float p_rectangle_area(float *p1, float *dir, float *p2, float *p3, float *p4)
static PEdge * p_boundary_edge_next(PEdge *e)
static void p_chart_stretch_minimize(PChart *chart, RNG *rng)
static void p_chart_uv_scale(PChart *chart, float scale)
static void p_chart_delete(PChart *chart)
static void p_face_backup_uvs(PFace *f)
static int p_compare_geometric_uv(const void *a, const void *b)
static void p_chart_uv_bbox(PChart *chart, float minv[2], float maxv[2])
void GEO_uv_parametrizer_scale(ParamHandle *phandle, float x, float y)
void GEO_uv_parametrizer_lscm_solve(ParamHandle *phandle, int *count_changed, int *count_failed)
static void p_face_flip(PFace *f)
struct PHashLink PHashLink
static float p_stretch_compute_vertex(PVert *v)
static float p_chart_minimum_area_angle(PChart *chart)
void GEO_uv_parametrizer_average(ParamHandle *phandle, bool ignore_pinned, bool scale_uv, bool shear)
static bool p_edge_connect_pair(ParamHandle *handle, PEdge *e, bool topology_from_uvs, PEdge ***stack)
static int p_face_exists(ParamHandle *handle, const ParamKey *pvkeys, int i1, int i2, int i3)
ParamKey GEO_uv_find_pin_index(ParamHandle *handle, const int bmvertindex, const float uv[2])
static PEdge * p_wheel_edge_prev(PEdge *e)
void GEO_uv_parametrizer_delete(ParamHandle *phandle)
#define param_warning(message)
void GEO_uv_parametrizer_aspect_ratio(ParamHandle *phandle, float aspx, float aspy)
static void p_flush_uvs(ParamHandle *handle, PChart *chart)
static float p_edge_uv_length(PEdge *e)
static int phash_size(PHash *ph)
static void p_vert_load_pin_select_uvs(ParamHandle *handle, PVert *v)
static float p_face_area(PFace *f)
static void p_chart_fill_boundary(PChart *chart, PEdge *be, int nedges)
static PHashLink * phash_lookup(PHash *ph, PHashKey key)
static void p_chart_uv_scale_xy(PChart *chart, float x, float y)
static bool p_chart_lscm_solve(ParamHandle *handle, PChart *chart)
static void p_face_restore_uvs(PFace *f)
@ PHANDLE_STATE_ALLOCATED
@ PHANDLE_STATE_CONSTRUCTED
static void p_face_angles(PFace *f, float *r_a1, float *r_a2, float *r_a3)
struct GeoUVPinIndex GeoUVPinIndex
static float p_vec_angle(const float v1[3], const float v2[3], const float v3[3])
void GEO_uv_parametrizer_stretch_blend(ParamHandle *phandle, float blend)
static PVert * p_vert_add(ParamHandle *handle, PHashKey key, const float co[3], PEdge *e)
static bool p_quad_split_direction(ParamHandle *handle, const float **co, const ParamKey *vkeys)
static PFace * p_face_add_construct(ParamHandle *handle, ParamKey key, const ParamKey *vkeys, const float **co, float **uv, int i1, int i2, int i3, const bool *pin, const bool *select)
static float p_abf_compute_gradient(PAbfSystem *sys, PChart *chart)
static void p_chart_lscm_transform_single_pin(PChart *chart)
static PChart ** p_split_charts(ParamHandle *handle, PChart *chart, int ncharts)