46 #define param_assert(condition) \
50 #define param_warning(message) \
152 #define PEDGE_VERTEX_FLAGS (PEDGE_PIN)
230 1, 3, 5, 11, 17, 37, 67, 131, 257, 521,
231 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309,
232 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459,
235 #define PHASH_hash(ph, item) (((uintptr_t)(item)) % ((uint)(ph)->cursize))
236 #define PHASH_edge(v1, v2) (((v1) < (v2)) ? ((v1)*39) ^ ((v2)*31) : ((v1)*31) ^ ((v2)*39))
272 if (lookup ==
NULL) {
295 for (link = first; link; link =
next) {
308 if (link->
key == key) {
323 for (link = link->
next; link; link = link->
next) {
324 if (link->
key == key) {
341 d1[0] =
v1[0] -
v2[0];
342 d1[1] =
v1[1] -
v2[1];
343 d1[2] =
v1[2] -
v2[2];
345 d2[0] = v3[0] -
v2[0];
346 d2[1] = v3[1] -
v2[1];
347 d2[2] = v3[2] -
v2[2];
352 return d1[0] * d2[0] + d1[1] * d2[1] + d1[2] * d2[2];
370 float u1[3],
u2[3], u3[3];
386 const float v1[3],
const float v2[3],
const float v3[3],
float *r_a1,
float *r_a2,
float *r_a3)
411 return 0.5f * (((
v2[0] -
v1[0]) * (v3[1] -
v1[1])) - ((v3[0] -
v1[0]) * (
v2[1] -
v1[1])));
419 return 0.5f * (((
v2->uv[0] -
v1->uv[0]) * (v3->uv[1] -
v1->uv[1])) -
420 ((v3->uv[0] -
v1->uv[0]) * (
v2->uv[1] -
v1->uv[1])));
428 d[0] =
v2->
co[0] -
v1->co[0];
429 d[1] =
v2->
co[1] -
v1->co[1];
430 d[2] =
v2->
co[2] -
v1->co[2];
432 return sqrtf(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
440 d[0] =
v2->uv[0] -
v1->uv[0];
441 d[1] =
v2->uv[1] -
v1->uv[1];
443 return sqrtf(d[0] * d[0] + d[1] * d[1]);
452 for (
v = chart->
verts;
v;
v =
v->nextlink) {
472 for (
v = chart->
verts;
v;
v =
v->nextlink) {
482 for (
v = chart->
verts;
v;
v =
v->nextlink) {
492 for (
v = chart->
verts;
v;
v =
v->nextlink) {
493 v->uv[0] += trans[0];
494 v->uv[1] += trans[1];
502 for (
v = chart->
verts;
v;
v =
v->nextlink) {
512 for (
v = chart->
verts;
v;
v =
v->nextlink) {
522 for (
v = chart->
verts;
v;
v =
v->nextlink) {
535 div = dir2[0] * dir1[1] - dir2[1] * dir1[0];
541 lmbda = ((
v1[1] -
v2[1]) * dir1[0] - (
v1[0] -
v2[0]) * dir1[1]) / div;
542 r_isect[0] =
v1[0] + lmbda * dir2[0];
543 r_isect[1] =
v1[1] + lmbda * dir2[1];
549 static PBool p_intersect_line_2d(
const float v1[2],
553 const float r_isect[2])
555 float dir1[2], dir2[2];
557 dir1[0] = v4[0] - v3[0];
558 dir1[1] = v4[1] - v3[1];
560 dir2[0] =
v2[0] -
v1[0];
561 dir2[1] =
v2[1] -
v1[1];
566 isect[0] = (
v1[0] +
v2[0]) * 0.5f;
567 isect[1] = (
v1[1] +
v2[1]) * 0.5f;
579 return e->next->next->pair;
584 return (
e->pair) ?
e->pair->next :
NULL;
589 return e->next->vert->edge;
599 }
while (we && (we !=
e));
601 return last->next->next;
606 return (
v->edge->pair !=
NULL);
613 int f1 = e1->
flag, f2 = e2->flag, f3 = e3->flag;
614 float *orig_uv1 = e1->
orig_uv, *orig_uv2 = e2->orig_uv, *orig_uv3 = e3->orig_uv;
628 e3->orig_uv = orig_uv1;
633 static void p_chart_topological_sanity_check(
PChart *chart)
638 for (
v = chart->
verts;
v;
v =
v->nextlink) {
639 param_test_equals_ptr(
"v->edge->vert",
v,
v->edge->vert);
642 for (
e = chart->
edges;
e;
e =
e->nextlink) {
644 param_test_equals_ptr(
"e->pair->pair",
e,
e->pair->pair);
645 param_test_equals_ptr(
"pair->vert",
e->vert,
e->pair->next->vert);
646 param_test_equals_ptr(
"pair->next->vert",
e->next->vert,
e->pair->vert);
657 int nedges = 0, npins = 0;
660 v->uv[0] =
v->uv[1] = 0.0f;
661 pinuv[0] = pinuv[1] = 0.0f;
670 pinuv[0] +=
e->orig_uv[0] * handle->
aspx;
671 pinuv[1] +=
e->orig_uv[1] * handle->
aspy;
675 v->uv[0] +=
e->orig_uv[0] * handle->
aspx;
676 v->uv[1] +=
e->orig_uv[1] * handle->
aspy;
683 }
while (
e &&
e != (
v->edge));
686 v->uv[0] = pinuv[0] / npins;
687 v->uv[1] = pinuv[1] / npins;
690 else if (nedges > 0) {
700 for (
e = chart->
edges;
e;
e =
e->nextlink) {
702 e->orig_uv[0] =
e->vert->uv[0] / handle->
aspx;
703 e->orig_uv[1] =
e->vert->uv[1] / handle->
aspy;
711 float invblend = 1.0f -
blend;
713 for (
e = chart->
edges;
e;
e =
e->nextlink) {
715 e->orig_uv[0] =
blend *
e->old_uv[0] + invblend *
e->vert->uv[0] / handle->
aspx;
716 e->orig_uv[1] =
blend *
e->old_uv[1] + invblend *
e->vert->uv[1] / handle->
aspy;
730 e2->old_uv[0] = e2->orig_uv[0];
731 e2->old_uv[1] = e2->orig_uv[1];
734 e3->old_uv[0] = e3->orig_uv[0];
735 e3->old_uv[1] = e3->orig_uv[1];
748 e2->orig_uv[0] = e2->old_uv[0];
749 e2->orig_uv[1] = e2->old_uv[1];
752 e3->orig_uv[0] = e3->old_uv[0];
753 e3->orig_uv[1] = e3->old_uv[1];
767 for (
int i = 0; i < 3; i++) {
797 nv->
uv[0] =
v->uv[0];
798 nv->
uv[1] =
v->uv[1];
799 nv->
u.
key =
v->u.key;
812 if ((
e->vert->u.key == vkeys[0]) && (
e->next->vert->u.key == vkeys[1])) {
815 if ((
e->vert->u.key == vkeys[1]) && (
e->next->vert->u.key == vkeys[0])) {
833 if ((
e->vert->u.key == vkeys[
i1]) && (
e->next->vert->u.key == vkeys[i2])) {
834 if (
e->next->next->vert->u.key == vkeys[i3]) {
838 else if ((
e->vert->u.key == vkeys[i2]) && (
e->next->vert->u.key == vkeys[
i1])) {
839 if (
e->next->next->vert->u.key == vkeys[i3]) {
866 float *uv1, *uv2, *uvp1, *uvp2;
873 uv2 =
e->next->orig_uv;
884 if ((
fabsf(uv1[0] - uvp1[0]) > limit[0]) || (
fabsf(uv1[1] - uvp1[1]) > limit[1])) {
889 if ((
fabsf(uv2[0] - uvp2[0]) > limit[0]) || (
fabsf(uv2[1] - uvp2[1]) > limit[1])) {
919 if (((
v1->u.key == key1) && (
v2->u.key == key2)) ||
920 ((
v1->u.key == key2) && (
v2->u.key == key1))) {
936 if (*r_pair && (
e->vert == (*r_pair)->vert)) {
937 if ((*r_pair)->next->pair || (*r_pair)->next->next->pair) {
944 return (*r_pair !=
NULL);
949 PBool topology_from_uvs,
955 if (
e->vert == pair->
vert) {
968 return (
e->pair !=
NULL);
975 PEdge **stack = stackbase;
987 *stack = first->
edge;
990 while (stack != stackbase) {
1049 if (we ==
v->edge) {
1052 v->nextlink = chart->
verts;
1064 v->nextlink = chart->
verts;
1074 }
while (we && (we != lastwe));
1084 for (i = 0; i < ncharts; i++) {
1093 nchart = charts[f->
u.
chart];
1105 nchart->nedges += 3;
1120 PEdge *e1, *e2, *e3;
1168 e2->orig_uv = uv[i2];
1169 e3->orig_uv = uv[i3];
1200 e2->u.key =
PHASH_edge(vkeys[i2], vkeys[i3]);
1241 float bias = 1.0f + 1e-6f;
1243 PBool dir = (fac <= 0.0f);
1267 float len, maxlen = -1.0;
1269 if (r_nboundaries) {
1276 for (
e = chart->
edges;
e;
e =
e->nextlink) {
1281 if (r_nboundaries) {
1294 if (r_outer && (
len > maxlen)) {
1300 for (
e = chart->
edges;
e;
e =
e->nextlink) {
1325 }
while (we && (we !=
v->edge));
1356 while (nedges > 2) {
1357 PEdge *ne, *ne1, *ne2;
1386 ne1->
vert =
e->vert;
1412 for (
e = chart->
edges;
e;
e =
e->nextlink) {
1436 static int p_polygon_point_in(
const float cp1[2],
const float cp2[2],
const float p[2])
1438 if ((cp1[0] == p[0]) && (cp1[1] == p[1])) {
1441 else if ((cp2[0] == p[0]) && (cp2[1] == p[1])) {
1449 static void p_polygon_kernel_clip(
float (*oldpoints)[2],
1451 float (*newpoints)[2],
1456 float *p2, *p1, isect[2];
1459 p1 = oldpoints[noldpoints - 1];
1460 p1in = p_polygon_point_in(cp1, cp2, p1);
1463 for (i = 0; i < noldpoints; i++) {
1465 p2in = p_polygon_point_in(cp1, cp2, p2);
1467 if ((p2in >= 2) || (p1in && p2in)) {
1468 newpoints[*r_nnewpoints][0] = p2[0];
1469 newpoints[*r_nnewpoints][1] = p2[1];
1472 else if (p1in && !p2in) {
1474 p_intersect_line_2d(p1, p2, cp1, cp2, isect);
1475 newpoints[*r_nnewpoints][0] = isect[0];
1476 newpoints[*r_nnewpoints][1] = isect[1];
1480 else if (!p1in && p2in) {
1481 p_intersect_line_2d(p1, p2, cp1, cp2, isect);
1482 newpoints[*r_nnewpoints][0] = isect[0];
1483 newpoints[*r_nnewpoints][1] = isect[1];
1486 newpoints[*r_nnewpoints][0] = p2[0];
1487 newpoints[*r_nnewpoints][1] = p2[1];
1496 static void p_polygon_kernel_center(
float (*points)[2],
int npoints,
float *
center)
1498 int i,
size, nnewpoints = npoints;
1499 float(*oldpoints)[2], (*newpoints)[2], *p1, *p2;
1502 oldpoints =
MEM_mallocN(
sizeof(
float[2]) *
size,
"PPolygonOldPoints");
1503 newpoints =
MEM_mallocN(
sizeof(
float[2]) *
size,
"PPolygonNewPoints");
1505 memcpy(oldpoints, points,
sizeof(
float[2]) * npoints);
1507 for (i = 0; i < npoints; i++) {
1509 p2 = points[(i + 1) % npoints];
1510 p_polygon_kernel_clip(oldpoints, nnewpoints, newpoints, &nnewpoints, p1, p2);
1512 if (nnewpoints == 0) {
1514 memcpy(oldpoints, points,
sizeof(
float[2]) * npoints);
1515 nnewpoints = npoints;
1518 else if (nnewpoints == 1) {
1520 center[0] = newpoints[0][0];
1521 center[1] = newpoints[0][1];
1529 if (nnewpoints * 2 >
size) {
1533 memcpy(oldpoints, newpoints,
sizeof(
float[2]) * nnewpoints);
1538 float(*sw_points)[2] = oldpoints;
1539 oldpoints = newpoints;
1540 newpoints = sw_points;
1546 for (i = 0; i < nnewpoints; i++) {
1547 center[0] += oldpoints[i][0];
1548 center[1] += oldpoints[i][1];
1565 static float p_vert_cotan(
const float v1[3],
const float v2[3],
const float v3[3])
1567 float a[3], b[3],
c[3], clen;
1582 static PBool p_vert_flipped_wheel_triangle(
PVert *
v)
1592 }
while (
e && (
e !=
v->edge));
1597 static PBool p_vert_map_harmonic_weights(
PVert *
v)
1599 float weightsum, positionsum[2], olduv[2];
1602 positionsum[0] = positionsum[1] = 0.0f;
1608 float t1, t2, weight;
1612 v2 =
e->next->next->vert;
1613 t1 = p_vert_cotan(
v2->
co,
e->vert->
co,
v1->co);
1615 v1 =
e->pair->next->vert;
1616 v2 =
e->pair->next->next->vert;
1617 t2 = p_vert_cotan(
v2->
co,
e->pair->vert->
co,
v1->co);
1619 weight = 0.5f * (t1 + t2);
1620 weightsum += weight;
1621 positionsum[0] += weight *
e->pair->vert->uv[0];
1622 positionsum[1] += weight *
e->pair->vert->uv[1];
1625 }
while (
e && (
e !=
v->edge));
1635 v1 =
e->next->next->vert;
1637 t1 = p_vert_cotan(
v1->co,
v->
co,
v2->
co);
1638 t2 = p_vert_cotan(
v2->
co,
v->
co,
v1->co);
1640 weightsum += t1 + t2;
1641 positionsum[0] += (
v2->uv[1] -
v1->uv[1]) + (t1 *
v2->uv[0] + t2 *
v1->uv[0]);
1642 positionsum[1] += (
v1->uv[0] -
v2->uv[0]) + (t1 *
v2->uv[1] + t2 *
v1->uv[1]);
1645 }
while (
e && (
e !=
v->edge));
1648 if (weightsum != 0.0f) {
1649 weightsum = 1.0f / weightsum;
1650 positionsum[0] *= weightsum;
1651 positionsum[1] *= weightsum;
1654 olduv[0] =
v->uv[0];
1655 olduv[1] =
v->uv[1];
1656 v->uv[0] = positionsum[0];
1657 v->uv[1] = positionsum[1];
1659 if (p_vert_flipped_wheel_triangle(
v)) {
1660 v->uv[0] = olduv[0];
1661 v->uv[1] = olduv[1];
1669 static void p_vert_harmonic_insert(
PVert *
v)
1673 if (!p_vert_map_harmonic_weights(
v)) {
1685 }
while (
e && (
e !=
v->edge));
1691 points =
MEM_mallocN(
sizeof(
float[2]) * npoints,
"PHarmonicPoints");
1698 points[i][0] =
e->next->vert->uv[0];
1699 points[i][1] =
e->next->vert->uv[1];
1701 if (nexte ==
NULL) {
1703 points[i][0] =
e->next->next->vert->uv[0];
1704 points[i][1] =
e->next->next->vert->uv[1];
1710 }
while (
e !=
v->edge);
1712 p_polygon_kernel_center(points, npoints,
v->uv);
1720 p_vert_map_harmonic_weights(
e->next->vert);
1723 }
while (
e && (
e !=
v->edge));
1725 p_vert_map_harmonic_weights(
v);
1728 static void p_vert_fix_edge_pointer(
PVert *
v)
1733 while (
v->edge->pair) {
1736 if (
v->edge == start) {
1746 *r_newv = edge->
vert;
1751 *r_keepv = pair->
vert;
1755 static void p_collapse_edge(
PEdge *edge,
PEdge *pair)
1757 PVert *oldv, *keepv;
1760 p_collapsing_verts(edge, pair, &oldv, &keepv);
1765 if ((
e != edge) && !(pair && pair->
next ==
e)) {
1770 }
while (
e && (
e != oldv->
edge));
1773 if ((edge && (keepv->
edge == edge->
next)) || (keepv->
edge == pair)) {
1804 p_vert_fix_edge_pointer(e2->vert);
1822 p_vert_fix_edge_pointer(e2->vert);
1825 p_vert_fix_edge_pointer(keepv);
1851 static void p_split_vertex(
PEdge *edge,
PEdge *pair)
1853 PVert *newv, *keepv;
1856 p_collapsing_verts(edge, pair, &newv, &keepv);
1870 p_vert_fix_edge_pointer(e2->vert);
1885 p_vert_fix_edge_pointer(e2->vert);
1889 p_vert_fix_edge_pointer(keepv);
1896 }
while (
e && (
e != newv->
edge));
1901 PVert *oldv, *keepv;
1903 p_collapsing_verts(edge, pair, &oldv, &keepv);
1906 if (!edge || !pair) {
1924 static PBool p_collapse_normal_flipped(
float *
v1,
float *
v2,
float *vold,
float *vnew)
1926 float nold[3], nnew[3], sub1[3], sub2[3];
1936 return (
dot_v3v3(nold, nnew) <= 0.0f);
1941 PVert *oldv, *keepv;
1943 float angulardefect,
angle;
1945 p_collapsing_verts(edge, pair, &oldv, &keepv);
1947 angulardefect = 2 *
M_PI;
1951 float a[3], b[3], minangle, maxangle;
1957 angulardefect -=
angle;
1960 if (
v1 == keepv ||
v2 == keepv) {
1965 if (p_collapse_normal_flipped(
v1->co,
v2->
co, oldv->
co, keepv->
co)) {
1975 b[2] =
M_PI - b[0] - b[1];
1978 minangle = 15.0f *
M_PI / 180.0f;
1979 maxangle =
M_PI - minangle;
1981 for (i = 0; i < 3; i++) {
1982 if ((b[i] <
a[i]) && (b[i] < minangle)) {
1985 else if ((b[i] >
a[i]) && (b[i] > maxangle)) {
1991 }
while (
e && (
e != oldv->
edge));
1995 if (
fabsf(angulardefect) > (
float)(
M_PI * 30.0 / 180.0)) {
2020 PVert *oldv, *keepv;
2022 p_collapsing_verts(edge, pair, &oldv, &keepv);
2028 return (p_collapse_allowed_topologic(edge, pair) && p_collapse_allowed_geometric(edge, pair));
2031 static float p_collapse_cost(
PEdge *edge,
PEdge *pair)
2036 PVert *oldv, *keepv;
2038 PFace *oldf1, *oldf2;
2039 float volumecost = 0.0f, areacost = 0.0f, edgevec[3], cost, weight, elen;
2040 float shapecost = 0.0f;
2041 float shapeold = 0.0f, shapenew = 0.0f;
2042 int nshapeold = 0, nshapenew = 0;
2044 p_collapsing_verts(edge, pair, &oldv, &keepv);
2045 oldf1 = (edge) ? edge->
face :
NULL;
2046 oldf2 = (pair) ? pair->
face :
NULL;
2053 float *co1 =
e->next->vert->
co;
2054 float *co2 =
e->next->next->vert->
co;
2056 if ((
e->face != oldf1) && (
e->face != oldf2)) {
2057 float tetrav2[3], tetrav3[3];
2073 a1 = a1 -
M_PI / 3.0;
2074 a2 = a2 -
M_PI / 3.0;
2075 a3 = a3 -
M_PI / 3.0;
2076 shapeold = (a1 * a1 + a2 * a2 + a3 * a3) / ((
M_PI / 2) * (
M_PI / 2));
2082 a1 = a1 -
M_PI / 3.0;
2083 a2 = a2 -
M_PI / 3.0;
2084 a3 = a3 -
M_PI / 3.0;
2085 shapenew = (a1 * a1 + a2 * a2 + a3 * a3) / ((
M_PI / 2) * (
M_PI / 2));
2091 }
while (
e && (
e != oldv->
edge));
2102 cost = weight * volumecost * volumecost + elen * elen * areacost * areacost;
2106 shapeold /= nshapeold;
2107 shapenew /= nshapenew;
2108 shapecost = (shapeold + 0.00001) / (shapenew + 0.00001);
2116 static void p_collapse_cost_vertex(
PVert *vert,
float *r_mincost,
PEdge **r_mine)
2124 if (p_collapse_allowed(
e,
e->pair)) {
2125 float cost = p_collapse_cost(
e,
e->pair);
2127 if ((*r_mine ==
NULL) || (cost < *r_mincost)) {
2135 if (enext ==
NULL) {
2137 pair =
e->next->next;
2139 if (p_collapse_allowed(
NULL, pair)) {
2140 float cost = p_collapse_cost(
NULL, pair);
2142 if ((*r_mine ==
NULL) || (cost < *r_mincost)) {
2152 }
while (
e != vert->
edge);
2155 static void p_chart_post_collapse_flush(
PChart *chart,
PEdge *collapsed)
2170 nextv =
v->nextlink;
2177 v->nextlink = chart->
verts;
2183 for (
e = edges;
e;
e = nexte) {
2184 nexte =
e->nextlink;
2192 e->nextlink = chart->
edges;
2201 for (
e = collapsed;
e;
e =
e->nextlink) {
2202 e->nextlink =
e->u.nextcollapse;
2210 for (f =
faces; f; f = nextf) {
2225 static void p_chart_post_split_flush(
PChart *chart)
2234 nextv =
v->nextlink;
2235 v->nextlink = chart->
verts;
2241 nexte =
e->nextlink;
2242 e->nextlink = chart->
edges;
2259 static void p_chart_simplify_compute(
PChart *chart)
2269 int nwheelverts, i, ncollapsed = 0;
2274 for (
v = chart->
verts;
v;
v =
v->nextlink) {
2278 p_collapse_cost_vertex(
v, &cost, &
e);
2284 v->u.heaplink =
NULL;
2288 for (
e = chart->
edges;
e;
e =
e->nextlink) {
2289 e->u.nextcollapse =
NULL;
2294 if (ncollapsed == NCOLLAPSE) {
2300 PVert *oldv, *keepv;
2301 PEdge *wheele, *nexte;
2305 collapsededges = edge;
2317 p_collapsing_verts(edge, pair, &oldv, &keepv);
2321 wheele = oldv->
edge;
2324 wheelverts[nwheelverts++] = wheele->
next->
vert;
2327 if (nexte ==
NULL) {
2332 }
while (wheele && (wheele != oldv->
edge));
2335 p_collapse_edge(edge, pair);
2337 for (i = 0; i < nwheelverts; i++) {
2343 if (
v->u.heaplink) {
2345 v->u.heaplink =
NULL;
2348 p_collapse_cost_vertex(
v, &cost, &collapse);
2361 p_chart_post_collapse_flush(chart, collapsededges);
2364 static void p_chart_complexify(
PChart *chart)
2367 PVert *newv, *keepv;
2382 p_split_vertex(edge, pair);
2383 p_collapsing_verts(edge, pair, &newv, &keepv);
2385 if (
x >= NCOLLAPSEX) {
2386 newv->
uv[0] = keepv->
uv[0];
2387 newv->
uv[1] = keepv->
uv[1];
2390 p_vert_harmonic_insert(newv);
2395 p_chart_post_split_flush(chart);
2399 static void p_chart_simplify(
PChart *chart)
2408 #define ABF_MAX_ITER 20
2472 for (i = 0; i < sys->
nangles; i++, sine++, cosine++,
alpha++) {
2490 if (aid == e1->
u.
id) {
2500 if (aid == e2->
u.
id) {
2509 e =
e->next->next->pair;
2510 }
while (
e && (
e !=
v->edge));
2512 return (sin1 - sin2);
2517 PVert *
v =
e->vert, *
v1 =
e->next->vert, *
v2 =
e->next->next->vert;
2549 float gtriangle, galpha1, galpha2, galpha3;
2556 sys->
bAlpha[e2->u.id] = -galpha2;
2557 sys->
bAlpha[e3->u.id] = -galpha3;
2559 norm += galpha1 * galpha1 + galpha2 * galpha2 + galpha3 * galpha3;
2563 norm += gtriangle * gtriangle;
2566 for (
v = chart->
verts;
v;
v =
v->nextlink) {
2568 float gplanar = -2 *
M_PI, glength;
2572 gplanar += sys->
alpha[
e->u.id];
2573 e =
e->next->next->pair;
2574 }
while (
e && (
e !=
v->edge));
2577 norm += gplanar * gplanar;
2581 norm += glength * glength;
2598 for (i = 0; i < nvar; i++) {
2603 float wi1, wi2, wi3, b, si,
beta[3], j2[3][3], W[3][3];
2604 float row1[6], row2[6], row3[6];
2610 wi2 = 1.0f / sys->
weight[e2->u.id];
2611 wi3 = 1.0f / sys->
weight[e3->u.id];
2615 b += sys->
bAlpha[e2->u.id] * wi2;
2616 b += sys->
bAlpha[e3->u.id] * wi3;
2620 si = 1.0f / (wi1 + wi2 + wi3);
2636 W[1][1] = si - sys->
weight[e2->u.id];
2640 W[2][2] = si - sys->
weight[e3->u.id];
2642 vid[0] = vid[1] = vid[2] = vid[3] = vid[4] = vid[5] = -1;
2646 vid[3] = ninterior +
v1->u.id;
2648 sys->
J2dt[e1->
u.
id][0] = j2[0][0] = 1.0f * wi1;
2656 row1[0] = j2[0][0] * W[0][0];
2657 row2[0] = j2[0][0] * W[1][0];
2658 row3[0] = j2[0][0] * W[2][0];
2660 row1[3] = j2[1][0] * W[0][1] + j2[2][0] * W[0][2];
2661 row2[3] = j2[1][0] * W[1][1] + j2[2][0] * W[1][2];
2662 row3[3] = j2[1][0] * W[2][1] + j2[2][0] * W[2][2];
2667 vid[4] = ninterior +
v2->u.id;
2670 sys->
J2dt[e2->u.id][1] = j2[1][1] = 1.0f * wi2;
2677 row1[1] = j2[1][1] * W[0][1];
2678 row2[1] = j2[1][1] * W[1][1];
2679 row3[1] = j2[1][1] * W[2][1];
2681 row1[4] = j2[0][1] * W[0][0] + j2[2][1] * W[0][2];
2682 row2[4] = j2[0][1] * W[1][0] + j2[2][1] * W[1][2];
2683 row3[4] = j2[0][1] * W[2][0] + j2[2][1] * W[2][2];
2688 vid[5] = ninterior + v3->u.id;
2692 sys->
J2dt[e3->u.id][2] = j2[2][2] = 1.0f * wi3;
2696 context, 0, ninterior + v3->u.id, j2[0][2] *
beta[0] + j2[1][2] *
beta[1]);
2698 row1[2] = j2[2][2] * W[0][2];
2699 row2[2] = j2[2][2] * W[1][2];
2700 row3[2] = j2[2][2] * W[2][2];
2702 row1[5] = j2[0][2] * W[0][0] + j2[1][2] * W[0][1];
2703 row2[5] = j2[0][2] * W[1][0] + j2[1][2] * W[1][1];
2704 row3[5] = j2[0][2] * W[2][0] + j2[1][2] * W[2][1];
2707 for (i = 0; i < 3; i++) {
2714 for (j = 0; j < 6; j++) {
2749 float dlambda1, pre[3], dalpha;
2753 pre[0] = pre[1] = pre[2] = 0.0;
2758 pre[0] += sys->
J2dt[e1->
u.
id][0] *
x;
2759 pre[1] += sys->
J2dt[e2->u.id][0] *
x2;
2760 pre[2] += sys->
J2dt[e3->u.id][0] *
x2;
2767 pre[1] += sys->
J2dt[e2->u.id][1] *
x;
2768 pre[2] += sys->
J2dt[e3->u.id][1] *
x2;
2775 pre[1] += sys->
J2dt[e2->u.id][2] *
x2;
2776 pre[2] += sys->
J2dt[e3->u.id][2] *
x;
2779 dlambda1 = pre[0] + pre[1] + pre[2];
2784 dalpha = (sys->
bAlpha[e1->
u.
id] - dlambda1);
2787 dalpha = (sys->
bAlpha[e2->u.id] - dlambda1);
2788 sys->
alpha[e2->u.id] += dalpha / sys->
weight[e2->u.id] - pre[1];
2790 dalpha = (sys->
bAlpha[e3->u.id] - dlambda1);
2791 sys->
alpha[e3->u.id] += dalpha / sys->
weight[e3->u.id] - pre[2];
2799 else if (sys->
alpha[
e->u.id] < 0.0f) {
2800 sys->
alpha[
e->u.id] = 0.0f;
2802 }
while (
e != f->
edge);
2805 for (i = 0; i < ninterior; i++) {
2823 float limit = (chart->
nfaces > 100) ? 1.0f : 0.001f;
2828 for (
v = chart->
verts;
v;
v =
v->nextlink) {
2884 sys.
weight[e1->
u.
id] = 2.0f / (a1 * a1);
2885 sys.
weight[e2->
u.
id] = 2.0f / (a2 * a2);
2886 sys.
weight[e3->
u.
id] = 2.0f / (a3 * a3);
2889 for (
v = chart->
verts;
v;
v =
v->nextlink) {
2891 float anglesum = 0.0, scale;
2895 anglesum += sys.
beta[
e->u.id];
2896 e =
e->next->next->pair;
2897 }
while (
e && (
e !=
v->edge));
2899 scale = (anglesum == 0.0f) ? 0.0f : 2.0f * (
float)
M_PI / anglesum;
2904 e =
e->next->next->pair;
2905 }
while (
e && (
e !=
v->edge));
2950 if (!*pin1 || !*pin2 || *pin1 == *pin2) {
2956 (*pin1)->
uv[0] = 0.0f;
2957 (*pin1)->uv[1] = 0.5f;
2958 (*pin2)->uv[0] = 1.0f;
2959 (*pin2)->uv[1] = 0.5f;
2962 int diru, dirv, dirx, diry;
2966 sub[0] =
fabsf(sub[0]);
2967 sub[1] =
fabsf(sub[1]);
2968 sub[2] =
fabsf(sub[2]);
2970 if ((sub[0] > sub[1]) && (sub[0] > sub[2])) {
2972 diry = (sub[1] > sub[2]) ? 1 : 2;
2974 else if ((sub[1] > sub[0]) && (sub[1] > sub[2])) {
2976 diry = (sub[0] > sub[2]) ? 0 : 2;
2980 diry = (sub[0] > sub[1]) ? 0 : 1;
2992 (*pin1)->uv[diru] = (*pin1)->co[dirx];
2993 (*pin1)->uv[dirv] = (*pin1)->co[diry];
2994 (*pin2)->uv[diru] = (*pin2)->co[dirx];
2995 (*pin2)->uv[dirv] = (*pin2)->co[diry];
3003 float maxlen = 0.0f, curlen = 0.0f, totlen = 0.0f, firstlen = 0.0f;
3029 if (curlen > maxlen) {
3035 if (firste1 == cure) {
3046 }
while (be != outer);
3049 if (cure && (cure != outer)) {
3052 if (firstlen > maxlen) {
3059 if (!maxe1 || !maxe2 || (maxlen < 0.5f * totlen)) {
3078 }
while (be1 != be2);
3097 }
while (be1 != be2);
3108 float minv[3], maxv[3], dirlen;
3109 PVert *
v, *minvert[3], *maxvert[3];
3113 minv[0] = minv[1] = minv[2] = 1e20;
3114 maxv[0] = maxv[1] = maxv[2] = -1e20;
3116 minvert[0] = minvert[1] = minvert[2] =
NULL;
3117 maxvert[0] = maxvert[1] = maxvert[2] =
NULL;
3119 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3120 for (i = 0; i < 3; i++) {
3121 if (
v->
co[i] < minv[i]) {
3125 if (
v->
co[i] > maxv[i]) {
3136 for (i = 0; i < 3; i++) {
3137 if (maxv[i] - minv[i] > dirlen) {
3139 dirlen = maxv[i] - minv[i];
3143 *pin1 = minvert[dir];
3144 *pin2 = maxvert[dir];
3154 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3164 int npins = 0,
id = 0;
3167 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3180 if ((live && (!
select || !deselect))) {
3185 p_chart_simplify_compute(chart);
3186 p_chart_topological_sanity_check(chart);
3191 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3201 param_warning(
"ABF solving failed: falling back to LSCM.\n");
3220 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3235 float area_pinned_up, area_pinned_down;
3243 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3267 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3279 area_pinned_up = 0.0f;
3280 area_pinned_down = 0.0f;
3290 area_pinned_up +=
area;
3293 area_pinned_down -=
area;
3298 flip_faces = (area_pinned_down > area_pinned_up);
3306 float a1, a2, a3, ratio, cosine, sine;
3307 float sina1, sina2, sina3, sinmax;
3320 SWAP(
float, a2, a3);
3329 sinmax =
max_fff(sina1, sina2, sina3);
3332 if (sina3 != sinmax) {
3334 SHIFT3(
float, a1, a2, a3);
3335 SHIFT3(
float, sina1, sina2, sina3);
3337 if (sina2 == sinmax) {
3339 SHIFT3(
float, a1, a2, a3);
3340 SHIFT3(
float, sina1, sina2, sina3);
3345 ratio = (sina3 == 0.0f) ? 1.0f : sina2 / sina3;
3346 cosine =
cosf(a1) * ratio;
3347 sine = sina1 * ratio;
3369 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3383 if (new_area > 0.0f) {
3416 #define P_STRETCH_ITER 20
3422 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3423 if (
v->edge->pair ==
NULL) {
3446 w = 1.0f / (2.0f *
area);
3495 }
while (
e &&
e != (
v->edge));
3505 float orig_stretch,
low, stretch_low,
high, stretch_high, mid, stretch;
3506 float orig_uv[2], dir[2], random_angle, trusted_radius;
3508 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3514 orig_uv[0] =
v->uv[0];
3515 orig_uv[1] =
v->uv[1];
3518 trusted_radius = 0.0f;
3527 }
while (
e &&
e != (
v->edge));
3529 trusted_radius /= 2 * nedges;
3532 dir[0] = trusted_radius *
cosf(random_angle);
3533 dir[1] = trusted_radius *
sinf(random_angle);
3537 stretch_low = orig_stretch;
3546 v->uv[0] = orig_uv[0] + mid * dir[0];
3547 v->uv[1] = orig_uv[1] + mid * dir[1];
3550 if (stretch_low < stretch_high) {
3552 stretch_high = stretch;
3556 stretch_low = stretch;
3561 if (stretch >= orig_stretch) {
3574 if (
v1->uv[0] <
v2->uv[0]) {
3577 if (
v1->uv[0] ==
v2->uv[0]) {
3578 if (
v1->uv[1] <
v2->uv[1]) {
3581 if (
v1->uv[1] ==
v2->uv[1]) {
3595 int npoints = 0, i, ulen, llen;
3596 PVert **
U, **
L, **points, **p;
3624 for (p = points, i = 0; i < npoints; i++, p++) {
3625 while ((ulen > 1) && (
p_area_signed(
U[ulen - 2]->uv, (*p)->uv,
U[ulen - 1]->uv) <= 0)) {
3628 while ((llen > 1) && (
p_area_signed(
L[llen - 2]->uv, (*p)->uv,
L[llen - 1]->uv) >= 0)) {
3639 for (p = points, i = 0; i < ulen; i++, p++, npoints++) {
3644 for (i = llen - 2; i > 0; i--, p++, npoints++) {
3649 *r_nverts = npoints;
3650 *r_right = ulen - 1;
3665 orthodir[0] = dir[1];
3666 orthodir[1] = -dir[0];
3688 float rotated, minarea, minangle,
area,
len;
3689 float *angles, miny, maxy,
v[2],
a[4], mina;
3690 int npoints,
right, i_min, i_max, i, idx[4], nextidx;
3691 PVert **points, *p1, *p2, *p3, *p4, *p1n;
3699 angles =
MEM_mallocN(
sizeof(
float) * npoints,
"PMinAreaAngles");
3705 for (i = 0; i < npoints; i++) {
3706 p1 = (i == 0) ? points[npoints - 1] : points[i - 1];
3708 p3 = (i == npoints - 1) ? points[0] : points[i + 1];
3712 if (points[i]->uv[1] < miny) {
3713 miny = points[i]->
uv[1];
3716 if (points[i]->uv[1] > maxy) {
3717 maxy = points[i]->
uv[1];
3728 v[0] = points[idx[0]]->
uv[0];
3729 v[1] = points[idx[0]]->
uv[1] + 1.0f;
3730 a[0] =
p_vec2_angle(points[(idx[0] + 1) % npoints]->uv, points[idx[0]]->uv,
v);
3732 v[0] = points[idx[1]]->
uv[0] + 1.0f;
3733 v[1] = points[idx[1]]->
uv[1];
3734 a[1] =
p_vec2_angle(points[(idx[1] + 1) % npoints]->uv, points[idx[1]]->uv,
v);
3736 v[0] = points[idx[2]]->
uv[0];
3737 v[1] = points[idx[2]]->
uv[1] - 1.0f;
3738 a[2] =
p_vec2_angle(points[(idx[2] + 1) % npoints]->uv, points[idx[2]]->uv,
v);
3740 v[0] = points[idx[3]]->
uv[0] - 1.0f;
3741 v[1] = points[idx[3]]->
uv[1];
3742 a[3] =
p_vec2_angle(points[(idx[3] + 1) % npoints]->uv, points[idx[3]]->uv,
v);
3750 while (rotated <= (
float)(
M_PI / 2.0)) {
3755 for (i = 0; i < 4; i++) {
3763 nextidx = (idx[i_min] + 1) % npoints;
3765 a[i_min] = angles[nextidx];
3766 a[(i_min + 1) % 4] =
a[(i_min + 1) % 4] - mina;
3767 a[(i_min + 2) % 4] =
a[(i_min + 2) % 4] - mina;
3768 a[(i_min + 3) % 4] =
a[(i_min + 3) % 4] - mina;
3771 p1 = points[idx[i_min]];
3772 p1n = points[nextidx];
3773 p2 = points[idx[(i_min + 1) % 4]];
3774 p3 = points[idx[(i_min + 2) % 4]];
3775 p4 = points[idx[(i_min + 3) % 4]];
3781 v[0] = (p1n->
uv[0] - p1->
uv[0]) *
len;
3782 v[1] = (p1n->
uv[1] - p1->
uv[1]) *
len;
3787 if (
area < minarea) {
3793 idx[i_min] = nextidx;
3797 if (minangle > (
float)(
M_PI / 4)) {
3814 for (
v = chart->
verts;
v;
v =
v->nextlink) {
3815 float oldu =
v->uv[0], oldv =
v->uv[1];
3816 v->uv[0] = cosine * oldu - sine * oldv;
3817 v->uv[1] = sine * oldu + cosine * oldv;
3831 if (
angle != 0.0f) {
3855 const float v1[2],
const float v2[2],
const float v3[2],
const float p[2],
float b[3])
3857 float a[2],
c[2], h[2], div;
3859 a[0] =
v2[0] -
v1[0];
3860 a[1] =
v2[1] -
v1[1];
3861 c[0] = v3[0] -
v1[0];
3862 c[1] = v3[1] -
v1[1];
3864 div =
a[0] *
c[1] -
a[1] *
c[0];
3872 h[0] = p[0] -
v1[0];
3873 h[1] = p[1] -
v1[1];
3877 b[1] = (h[0] *
c[1] - h[1] *
c[0]) * div;
3878 b[2] = (
a[0] * h[1] -
a[1] * h[0]) * div;
3879 b[0] = 1.0f - b[1] - b[2];
3889 if ((b[0] >= 0.0f) && (b[1] >= 0.0f) && (b[2] >= 0.0f)) {
3890 co[0] =
t->oco1[0] * b[0] +
t->oco2[0] * b[1] +
t->oco3[0] * b[2];
3891 co[1] =
t->oco1[1] * b[0] +
t->oco2[1] * b[1] +
t->oco3[1] * b[2];
3902 int axis, i, t1size = 0, t2size = 0;
3909 if (ntri <= 10 || depth >= 15) {
3916 axis = (bmax[0] - bmin[0] > bmax[1] - bmin[1]) ? 0 : 1;
3919 for (i = 0; i <
ntri; i++) {
3932 if ((t1size == t2size) && (t1size ==
ntri)) {
3975 for (i = 0; i <
node->ntri; i++) {
3984 if (co[
node->axis] <
node->split) {
3994 const float a = *(
const float *)a_;
3995 const float b = *(
const float *)b_;
4014 for (i = 0,
e = chart->
edges;
e;
e =
e->nextlink, i++) {
4020 median = lengths[i / 2];
4031 return (len3d == 0.0f) ? 0.0f : len2d / len3d;
4039 int j, it2, maxiter2, it;
4040 int nedges = chart->
nedges, nwheel, gridx, gridy;
4041 int edgesx, edgesy, nsize, esize, i,
x,
y, maxiter, totiter;
4042 float minv[2], maxv[2], median, invmedian, avglen2d, avglen3d;
4043 float center[2], dx, dy, *nodes, dlimit, d, *oldnodesx, *oldnodesy;
4044 float *nodesx, *nodesy, *hedges, *vedges, climit, moved,
padding;
4056 if (median == 0.0f) {
4060 invmedian = 1.0f / median;
4063 avglen2d = avglen3d = 0.0;
4065 for (
e = chart->
edges;
e;
e =
e->nextlink) {
4073 for (
v = chart->
verts;
v;
v =
v->nextlink) {
4074 v->u.distortion = 0.0;
4082 e =
e->next->next->pair;
4083 }
while (
e && (
e !=
v->edge));
4085 v->u.distortion /= nwheel;
4089 center[0] = 0.5f * (minv[0] + maxv[0]);
4090 center[1] = 0.5f * (minv[1] + maxv[1]);
4092 dx = 0.5f * (maxv[0] - minv[0]);
4093 dy = 0.5f * (maxv[1] - minv[1]);
4096 dx +=
padding * dx + 2.0f * median;
4097 dy +=
padding * dy + 2.0f * median;
4099 gridx = (int)(dx * invmedian);
4100 gridy = (int)(dy * invmedian);
4102 minv[0] =
center[0] - median * gridx;
4103 minv[1] =
center[1] - median * gridy;
4104 maxv[0] =
center[0] + median * gridx;
4105 maxv[1] =
center[1] + median * gridy;
4108 gridx = gridx * 2 + 1;
4109 gridy = gridy * 2 + 1;
4111 if ((gridx <= 2) || (gridy <= 2)) {
4117 nsize = gridx * gridy;
4118 esize = edgesx * edgesy;
4120 nodes =
MEM_mallocN(
sizeof(
float) * nsize,
"PSmoothNodes");
4121 nodesx =
MEM_mallocN(
sizeof(
float) * nsize,
"PSmoothNodesX");
4122 nodesy =
MEM_mallocN(
sizeof(
float) * nsize,
"PSmoothNodesY");
4123 oldnodesx =
MEM_mallocN(
sizeof(
float) * nsize,
"PSmoothOldNodesX");
4124 oldnodesy =
MEM_mallocN(
sizeof(
float) * nsize,
"PSmoothOldNodesY");
4125 hedges =
MEM_mallocN(
sizeof(
float) * esize,
"PSmoothHEdges");
4126 vedges =
MEM_mallocN(
sizeof(
float) * esize,
"PSmoothVEdges");
4128 if (!nodes || !nodesx || !nodesy || !oldnodesx || !oldnodesy || !hedges || !vedges) {
4155 for (
x = 0;
x < gridx;
x++) {
4156 for (
y = 0;
y < gridy;
y++) {
4159 nodesx[i] = minv[0] + median *
x;
4160 nodesy[i] = minv[1] + median *
y;
4169 float fmin[2], fmax[2];
4170 int bx1, by1, bx2, by2;
4178 bx1 = (int)((fmin[0] - minv[0]) * invmedian);
4179 by1 = (int)((fmin[1] - minv[1]) * invmedian);
4180 bx2 = (int)((fmax[0] - minv[0]) * invmedian + 2);
4181 by2 = (int)((fmax[1] - minv[1]) * invmedian + 2);
4183 for (
x = bx1;
x < bx2;
x++) {
4184 for (
y = by1;
y < by2;
y++) {
4194 if ((b[0] > 0.0f) && (b[1] > 0.0f) && (b[2] > 0.0f)) {
4196 nodes[i] += e2->vert->u.distortion * b[1];
4197 nodes[i] += e3->vert->u.distortion * b[2];
4206 climit = 0.00001f * nsize;
4208 for (it = 0; it < maxiter; it++) {
4211 for (
x = 0;
x < edgesx;
x++) {
4212 for (
y = 0;
y < edgesy;
y++) {
4216 hedges[j] = (nodes[i] + nodes[i + 1]) * 0.5f;
4217 vedges[j] = (nodes[i] + nodes[i + gridx]) * 0.5f;
4220 hedges[j] = 1.0f / hedges[j];
4221 vedges[j] = 1.0f / vedges[j];
4228 for (it2 = 0; it2 < maxiter2; it2++) {
4232 memcpy(oldnodesx, nodesx,
sizeof(
float) * nsize);
4233 memcpy(oldnodesy, nodesy,
sizeof(
float) * nsize);
4235 for (
x = 1;
x < gridx - 1;
x++) {
4236 for (
y = 1;
y < gridy - 1;
y++) {
4237 float p[2], oldp[2], sum1, sum2,
diff[2],
length;
4242 oldp[0] = oldnodesx[i];
4243 oldp[1] = oldnodesy[i];
4245 sum1 = hedges[j - 1] * oldnodesx[i - 1];
4246 sum1 += hedges[j] * oldnodesx[i + 1];
4247 sum1 += vedges[j - edgesx] * oldnodesx[i - gridx];
4248 sum1 += vedges[j] * oldnodesx[i + gridx];
4250 sum2 = hedges[j - 1];
4252 sum2 += vedges[j - edgesx];
4255 nodesx[i] = sum1 / sum2;
4257 sum1 = hedges[j - 1] * oldnodesy[i - 1];
4258 sum1 += hedges[j] * oldnodesy[i + 1];
4259 sum1 += vedges[j - edgesx] * oldnodesy[i - gridx];
4260 sum1 += vedges[j] * oldnodesy[i + gridx];
4262 nodesy[i] = sum1 / sum2;
4267 diff[0] = p[0] - oldp[0];
4268 diff[1] = p[1] - oldp[1];
4281 if (moved < climit) {
4295 if (!triangles || !
tri) {
4311 for (
x = 0;
x < edgesx;
x++) {
4312 for (
y = 0;
y < edgesy;
y++) {
4315 t->co1[0] = nodesx[i];
4316 t->co1[1] = nodesy[i];
4318 t->co2[0] = nodesx[i + 1];
4319 t->co2[1] = nodesy[i + 1];
4321 t->co3[0] = nodesx[i + gridx];
4322 t->co3[1] = nodesy[i + gridx];
4324 t->oco1[0] = minv[0] +
x * median;
4325 t->oco1[1] = minv[1] +
y * median;
4327 t->oco2[0] = minv[0] + (
x + 1) * median;
4328 t->oco2[1] = minv[1] +
y * median;
4330 t->oco3[0] = minv[0] +
x * median;
4331 t->oco3[1] = minv[1] + (
y + 1) * median;
4335 t2->co1[0] = nodesx[i + gridx + 1];
4336 t2->co1[1] = nodesy[i + gridx + 1];
4338 t2->oco1[0] = minv[0] + (
x + 1) * median;
4339 t2->oco1[1] = minv[1] + (
y + 1) * median;
4341 t2->co2[0] =
t->co2[0];
4342 t2->co2[1] =
t->co2[1];
4343 t2->oco2[0] =
t->oco2[0];
4344 t2->oco2[1] =
t->oco2[1];
4346 t2->co3[0] =
t->co3[0];
4347 t2->co3[1] =
t->co3[1];
4348 t2->oco3[0] =
t->oco3[0];
4349 t2->oco3[1] =
t->oco3[1];
4367 for (
v = chart->
verts;
v;
v =
v->nextlink) {
4369 param_warning(
"area smoothing error: couldn't find mapping triangle\n");
4389 handle->
aspx = 1.0f;
4390 handle->
aspy = 1.0f;
4404 phandle->
aspx = aspx;
4405 phandle->
aspy = aspy;
4416 for (i = 0; i < phandle->
ncharts; i++) {
4451 uint nfilltri = nverts - 2;
4459 const float *co_curr, *co_prev = co[nverts - 1];
4460 for (
int j = 0; j < nverts; j++) {
4470 float axis_mat[3][3];
4472 for (
int j = 0; j < nverts; j++) {
4482 for (
int j = 0; j < nfilltri; j++) {
4488 ParamKey tri_vkeys[3] = {vkeys[v0], vkeys[
v1], vkeys[
v2]};
4489 float *tri_co[3] = {co[v0], co[
v1], co[
v2]};
4490 float *tri_uv[3] = {uv[v0], uv[
v1], uv[
v2]};
4494 param_face_add(handle, key, 3, tri_vkeys, tri_co, tri_uv, tri_pin, tri_select);
4519 else if (nverts == 4) {
4556 int i, j, nboundaries = 0;
4572 for (i = j = 0; i < phandle->
ncharts; i++) {
4574 chart = phandle->
charts[i];
4578 if (!topology_from_uvs && nboundaries == 0) {
4580 if (count_fail !=
NULL) {
4586 phandle->
charts[j] = chart;
4589 if (fill && (nboundaries > 1)) {
4593 for (
v = chart->
verts;
v;
v =
v->nextlink) {
4612 for (i = 0; i < phandle->
ncharts; i++) {
4628 for (i = 0; i < phandle->
ncharts; i++) {
4629 chart = phandle->
charts[i];
4647 if (count_changed !=
NULL) {
4648 *count_changed += 1;
4652 if (count_failed !=
NULL) {
4667 for (i = 0; i < phandle->
ncharts; i++) {
4670 p_chart_complexify(phandle->
charts[i]);
4689 phandle->
blend = 0.0f;
4691 for (i = 0; i < phandle->
ncharts; i++) {
4692 chart = phandle->
charts[i];
4694 for (
v = chart->
verts;
v;
v =
v->nextlink) {
4723 for (i = 0; i < phandle->
ncharts; i++) {
4724 chart = phandle->
charts[i];
4747 for (i = 0; i < phandle->
ncharts; i++) {
4751 for (
v = chart->
verts;
v;
v =
v->nextlink) {
4767 for (i = 0; i < phandle->
ncharts; i++) {
4768 chart = phandle->
charts[i];
4782 float tot_width, tot_height, scale;
4785 int i, unpacked = 0;
4800 if (phandle->
aspx != phandle->
aspy) {
4807 for (i = 0; i < phandle->
ncharts; i++) {
4808 chart = phandle->
charts[i];
4815 box = boxarray + (i - unpacked);
4819 trans[0] = -trans[0];
4820 trans[1] = -trans[1];
4828 if (margin > 0.0f) {
4833 if (margin > 0.0f) {
4840 for (i = 0; i < phandle->
ncharts; i++) {
4841 chart = phandle->
charts[i];
4848 box = boxarray + (i - unpacked);
4852 box->
w += margin * 2;
4853 box->
h += margin * 2;
4859 if (tot_height > tot_width) {
4860 scale = 1.0f / tot_height;
4863 scale = 1.0f / tot_width;
4866 for (i = 0; i < phandle->
ncharts - unpacked; i++) {
4877 if (phandle->
aspx != phandle->
aspy) {
4886 float tot_uvarea = 0.0f, tot_facearea = 0.0f;
4888 float minv[2], maxv[2], trans[2];
4895 for (i = 0; i < phandle->
ncharts; i++) {
4897 chart = phandle->
charts[i];
4915 if (tot_facearea == tot_uvarea || tot_facearea == 0.0f || tot_uvarea == 0.0f) {
4920 tot_fac = tot_facearea / tot_uvarea;
4922 for (i = 0; i < phandle->
ncharts; i++) {
4923 chart = phandle->
charts[i];
4934 trans[0] = (minv[0] + maxv[0]) / -2.0f;
4935 trans[1] = (minv[1] + maxv[1]) / -2.0f;
4942 trans[0] = -trans[0];
4943 trans[1] = -trans[1];
4955 for (i = 0; i < phandle->
ncharts; i++) {
4956 chart = phandle->
charts[i];
4967 for (i = 0; i < phandle->
ncharts; i++) {
4968 chart = phandle->
charts[i];
4974 if (phandle->
blend == 0.0f) {
4990 for (i = 0; i < phandle->
ncharts; i++) {
4991 chart = phandle->
charts[i];
typedef float(TangentPoint)[2]
void BLI_box_pack_2d(BoxPack *boxarray, const 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)
A min-heap / priority queue ADT.
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1)
Heap * BLI_heap_new_ex(unsigned int tot_reserve) ATTR_WARN_UNUSED_RESULT
void void bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1)
void * BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1)
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 max_ff(float a, float b)
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])
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], const float angle)
MINLINE float len_v3v3(const float a[3], const float b[3]) 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 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 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 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 float len_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
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)
#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 BLI_memarena_clear(MemArena *ma) ATTR_NONNULL(1)
struct MemArena * BLI_memarena_new(const size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) ATTR_MALLOC
void BLI_polyfill_calc_arena(const float(*coords)[2], const unsigned int coords_tot, const 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], const unsigned int coords_tot, 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 UNUSED_FUNCTION(x)
#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 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 u2
_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 u1
_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 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 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)
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.
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
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.
static CCL_NAMESPACE_BEGIN const double alpha
IconTextureDrawCall normal
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)
IMETHOD Vector diff(const Vector &a, const Vector &b, double dt=1)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
struct SELECTID_Context context
_W64 unsigned int uintptr_t
union PChart::PChartUnion u
union PEdge::PEdgeUnion u
union PFace::PFaceUnion u
MemArena * polyfill_arena
PChart * construction_chart
union PVert::PVertUnion u
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
__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)
ccl_device_inline float beta(float x, float y)
static void p_flush_uvs_blend(PHandle *handle, PChart *chart, float blend)
static void phash_insert(PHash *ph, PHashLink *link)
static float p_face_stretch(PFace *f)
void param_stretch_begin(ParamHandle *handle)
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)
struct SmoothTriangle SmoothTriangle
static PFace * p_face_add_construct(PHandle *handle, ParamKey key, const ParamKey *vkeys, float *co[4], float *uv[4], int i1, int i2, int i3, const ParamBool *pin, const ParamBool *select)
static float p_vec_angle_cos(const float v1[3], const float v2[3], const float v3[3])
static float p_abf_compute_grad_alpha(PAbfSystem *sys, PFace *f, PEdge *e)
static PChart ** p_split_charts(PHandle *handle, PChart *chart, int ncharts)
void param_stretch_iter(ParamHandle *handle)
void param_stretch_end(ParamHandle *handle)
static void p_split_vert(PChart *chart, PEdge *e)
void param_delete(ParamHandle *handle)
#define PHASH_hash(ph, item)
static void p_smooth(PChart *chart)
static float p_edge_boundary_angle(PEdge *e)
static void p_chart_lscm_load_solution(PChart *chart)
static void p_chart_fill_boundaries(PChart *chart, PEdge *outer)
static void p_chart_uv_to_array(PChart *chart, float(*points)[2])
static void p_abf_setup_system(PAbfSystem *sys)
void param_flush_restore(ParamHandle *handle)
static float p_abf_compute_sin_product(PAbfSystem *sys, PVert *v, int aid)
void param_aspect_ratio(ParamHandle *handle, float aspx, float aspy)
static float p_edge_length(PEdge *e)
static PEdge * p_wheel_edge_next(PEdge *e)
static PBool p_edge_has_pair(PHandle *handle, PEdge *e, PBool topology_from_uvs, PEdge **r_pair)
static void p_chart_rotate_fit_aabb(PChart *chart)
static void p_node_delete(SmoothNode *node)
void param_flush(ParamHandle *handle)
static PBool p_chart_abf_solve(PChart *chart)
static void p_stretch_pin_boundary(PChart *chart)
static int p_face_exists(ParamHandle *phandle, ParamKey *pvkeys, int i1, int i2, int i3)
ParamHandle * param_construct_begin(void)
static PBool p_chart_lscm_solve(PHandle *handle, PChart *chart)
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 PVert * p_vert_lookup(PHandle *handle, PHashKey key, const float co[3], PEdge *e)
static PBool 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])
static void p_chart_lscm_begin(PChart *chart, PBool live, PBool abf)
#define param_assert(condition)
#define PHASH_edge(v1, v2)
static PBool p_chart_convex_hull(PChart *chart, PVert ***r_verts, int *r_nverts, int *r_right)
void param_scale(ParamHandle *handle, float x, float y)
struct PAbfSystem PAbfSystem
void param_average(ParamHandle *handle, bool ignore_pinned)
static void p_chart_lscm_end(PChart *chart)
static void p_chart_extrema_verts(PChart *chart, PVert **pin1, PVert **pin2)
static PBool p_triangle_inside(SmoothTriangle *t, float co[2])
static float p_face_uv_area_signed(PFace *f)
void param_face_add(ParamHandle *handle, ParamKey key, int nverts, ParamKey *vkeys, float *co[4], float *uv[4], ParamBool *pin, ParamBool *select)
static PBool p_vert_interior(PVert *v)
static void p_chart_uv_translate(PChart *chart, const float trans[2])
#define PEDGE_VERTEX_FLAGS
static PBool p_edge_implicit_seam(PEdge *e, PEdge *ep)
static void p_abf_compute_sines(PAbfSystem *sys)
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 SmoothNode * p_node_new(MemArena *arena, SmoothTriangle **tri, int ntri, float *bmin, float *bmax, int depth)
static PVert * p_vert_copy(PChart *chart, PVert *v)
static float p_vec2_angle(const float v1[2], const float v2[2], const float v3[2])
static int p_compare_float(const void *a_, const void *b_)
static PHashLink * phash_next(PHash *ph, PHashKey key, PHashLink *link)
static void UNUSED_FUNCTION() p_chart_uv_from_array(PChart *chart, float(*points)[2])
static PEdge * p_boundary_edge_prev(PEdge *e)
void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf)
static void p_barycentric_2d(const float v1[2], const float v2[2], const float v3[2], const float p[2], float b[3])
static PBool p_node_intersect(SmoothNode *node, float co[2])
void param_pack(ParamHandle *handle, float margin, bool do_rotate, bool ignore_pinned)
static PBool p_quad_split_direction(PHandle *handle, float **co, PHashKey *vkeys)
static float p_smooth_distortion(PEdge *e, float avg2d, float avg3d)
static void p_chart_uv_transform(PChart *chart, const float mat[2][2])
void param_smooth_area(ParamHandle *handle)
void param_edge_set_seam(ParamHandle *handle, ParamKey *vkeys)
static PFace * p_face_add_fill(PChart *chart, PVert *v1, PVert *v2, PVert *v3)
static void p_abf_free_system(PAbfSystem *sys)
static int p_connect_pairs(PHandle *handle, PBool topology_from_uvs)
static PFace * p_face_add(PHandle *handle)
static void p_chart_rotate_minimum_area(PChart *chart)
static float p_rectangle_area(float *p1, float *dir, float *p2, float *p3, float *p4)
void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool topology_from_uvs, int *count_fail)
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_flush_uvs(PHandle *handle, PChart *chart)
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])
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 param_lscm_solve(ParamHandle *handle, int *count_changed, int *count_failed)
static PBool p_chart_symmetry_pins(PChart *chart, PEdge *outer, PVert **pin1, PVert **pin2)
static PEdge * p_edge_lookup(PHandle *handle, const PHashKey *vkeys)
static PEdge * p_wheel_edge_prev(PEdge *e)
#define param_warning(message)
static PBool p_abf_matrix_invert(PAbfSystem *sys, PChart *chart)
static float p_edge_uv_length(PEdge *e)
static int phash_size(PHash *ph)
static float p_face_area(PFace *f)
static void p_vert_load_pin_select_uvs(PHandle *handle, PVert *v)
void param_lscm_end(ParamHandle *handle)
static void p_chart_fill_boundary(PChart *chart, PEdge *be, int nedges)
static PHashLink * phash_lookup(PHash *ph, PHashKey key)
static PVert * p_vert_add(PHandle *handle, PHashKey key, const float co[3], PEdge *e)
static void p_chart_uv_scale_xy(PChart *chart, float x, float y)
static void p_face_restore_uvs(PFace *f)
static PBool p_edge_connect_pair(PHandle *handle, PEdge *e, PBool topology_from_uvs, PEdge ***stack)
static void p_add_ngon(ParamHandle *handle, ParamKey key, int nverts, ParamKey *vkeys, float **co, float **uv, ParamBool *pin, ParamBool *select)
@ PHANDLE_STATE_ALLOCATED
@ PHANDLE_STATE_CONSTRUCTED
static void param_pack_rotate(ParamHandle *handle, bool ignore_pinned)
static void p_face_angles(PFace *f, float *r_a1, float *r_a2, float *r_a3)
static PChart * p_chart_new(PHandle *handle)
static float p_smooth_median_edge_length(PChart *chart)
void param_stretch_blend(ParamHandle *handle, float blend)
static float p_vec_angle(const float v1[3], const float v2[3], const float v3[3])
static void p_chart_boundaries(PChart *chart, int *r_nboundaries, PEdge **r_outer)
struct SmoothNode SmoothNode
static float p_abf_compute_gradient(PAbfSystem *sys, PChart *chart)
static void p_chart_lscm_transform_single_pin(PChart *chart)