35 #ifdef BEVEL_DEBUG_TIME
39 #define BEVEL_EPSILON_D 1e-6
40 #define BEVEL_EPSILON 1e-6f
41 #define BEVEL_EPSILON_SQ 1e-12f
42 #define BEVEL_EPSILON_BIG 1e-4f
43 #define BEVEL_EPSILON_BIG_SQ 1e-8f
44 #define BEVEL_EPSILON_ANG DEG2RADF(2.0f)
45 #define BEVEL_SMALL_ANG DEG2RADF(10.0f)
47 #define BEVEL_SMALL_ANG_DOT (1.0f - cosf(BEVEL_SMALL_ANG))
49 #define BEVEL_EPSILON_ANG_DOT (1.0f - cosf(BEVEL_EPSILON_ANG))
50 #define BEVEL_MAX_ADJUST_PCT 10.0f
51 #define BEVEL_MAX_AUTO_ADJUST_PCT 300.0f
52 #define BEVEL_MATCH_SPEC_WEIGHT 0.2
145 #define PRO_SQUARE_R 1e4f
146 #define PRO_CIRCLE_R 2.0f
147 #define PRO_LINE_R 1.0f
148 #define PRO_SQUARE_IN_R 0.0f
378 #define BM_ELEM_LONG_TAG (1 << 6)
436 const float direction_dot =
dot_v3v3(d1, d2);
484 int nj = (vm->
seg / 2) + 1;
485 int nk = vm->
seg + 1;
487 return &vm->
mesh[i * nk * nj + j * nk + k];
509 for (
int i = 0; i < bv->
edgecount; i++) {
510 if (bv->
edges[i].
e == bme) {
511 return &bv->
edges[i];
549 if (from_e ==
NULL) {
557 }
while ((
e =
e->next) != from_e);
605 frep =
v->ebev->fprev;
606 if (
v->efirst->fprev != frep) {
607 frep2 =
v->efirst->fprev;
610 else if (
v->efirst) {
611 frep =
v->efirst->fprev;
613 if (
v->elast->fnext != frep) {
614 frep2 =
v->elast->fnext;
616 else if (
v->efirst->fnext != frep) {
617 frep2 =
v->efirst->fnext;
619 else if (
v->elast->fprev != frep) {
620 frep2 =
v->efirst->fprev;
623 else if (
v->efirst->fnext) {
624 frep =
v->efirst->fnext;
625 if (
v->elast->fnext != frep) {
626 frep2 =
v->elast->fnext;
629 else if (
v->elast->fprev) {
630 frep =
v->elast->fprev;
633 else if (
v->prev->elast) {
634 frep =
v->prev->elast->fnext;
635 if (
v->next->efirst) {
637 frep2 =
v->next->efirst->fprev;
640 frep =
v->next->efirst->fprev;
674 if ((facerep || (face_arr && face_arr[0])) && f) {
685 interp_f = face_arr[i];
693 bme = snap_edge_arr[i];
722 f->
mat_nr = (short)mat_nr;
756 if (lef1->
f != f1 || lef2->
f != f2) {
771 lv1f2->
v ==
v1 && lv1f2->
f == f2 && lv2f2->
v ==
v2 && lv2f2->
f == f2);
792 for (
int f = 0; f < totface; f++) {
793 if (face_component[f] == c1) {
794 face_component[f] = c2;
796 else if (face_component[f] == c2) {
797 face_component[f] = c1;
835 for (f = 0; f < totface; f++) {
836 face_component[f] = -1;
839 int current_component = -1;
840 for (f = 0; f < totface; f++) {
841 if (face_component[f] == -1 && !in_stack[f]) {
847 while (stack_top >= 0) {
848 BMFace *bmf = stack[stack_top];
851 in_stack[bmf_index] =
false;
852 if (face_component[bmf_index] != -1) {
855 face_component[bmf_index] = current_component;
866 if (bmf_other != bmf) {
868 if (face_component[bmf_other_index] != -1 || in_stack[bmf_other_index]) {
874 stack[stack_top] = bmf_other;
875 in_stack[bmf_other_index] =
true;
888 if (current_component <= 0) {
892 float top_face_z = -1e30f;
893 int top_face_component = -1;
895 float bot_face_z = 1e30f;
896 int bot_face_component = -1;
897 for (f = 0; f < totface; f++) {
902 if (fz > top_face_z) {
905 top_face_component = face_component[f];
907 if (fz < bot_face_z) {
910 bot_face_component = face_component[f];
916 if (bot_face_component != top_face_component) {
917 if (bot_face_component == 0) {
919 bot_face_component = top_face_component;
939 #define VEC_VALUE_LEN 6
945 for (
int f = 0; f < nfaces; f++) {
948 still_viable[f] =
false;
951 still_viable[f] =
true;
966 value_vecs[f][value_index++] = cent[2];
967 value_vecs[f][value_index++] = cent[0];
968 value_vecs[f][value_index++] = cent[1];
976 for (
int value_index = 0; num_viable > 1 && value_index <
VEC_VALUE_LEN; value_index++) {
977 for (
int f = 0; f < nfaces; f++) {
978 if (!still_viable[f] || f == best_f) {
985 if (value_vecs[f][value_index] < value_vecs[best_f][value_index]) {
988 for (
int i = f - 1; i >= 0; i--) {
989 if (still_viable[i]) {
990 still_viable[i] =
false;
995 else if (value_vecs[f][value_index] > value_vecs[best_f][value_index]) {
996 still_viable[f] =
false;
1004 return face[best_f];
1005 #undef VEC_VALUE_LEN
1014 for (
int i = 0; i < num_of_uv_layers; i++) {
1017 if (cd_loop_uv_offset == -1) {
1022 float uv[2] = {0.0f, 0.0f};
1054 else if (
l->
prev->
e == bme) {
1062 for (
int i = 0; i < num_of_uv_layers; i++) {
1065 if (cd_loop_uv_offset == -1) {
1069 float uv[2] = {0.0f, 0.0f};
1100 float *l1 =
e->
e->
v1->
co;
1107 *ret_closer_v =
e->
e->
v1;
1111 *ret_closer_v =
e->
e->
v2;
1122 float dir1[3], dir2[3];
1141 else if (e2->
fprev) {
1159 float dir1[3], dir2[3], dirco[3], no[3];
1187 float dir1[3], dir2[3],
cross[3];
1190 if (e1->
v1 == e2->
v1) {
1195 else if (e1->
v1 == e2->
v2) {
1200 else if (e1->
v2 == e2->
v1) {
1205 else if (e1->
v2 == e2->
v2) {
1246 float d0, d3, d4, d5;
1252 bool no_offsets = f1 ==
NULL || f2 ==
NULL;
1269 d0 = d3 = d4 = d5 = bp->
offset;
1328 float dir1[3], dir2[3];
1332 float dir1n[3], dir2p[3];
1333 if (edges_between) {
1346 float norm_perp1[3];
1364 for (
EdgeHalf *eloop = e1; eloop != e2; eloop = eloop->
next) {
1365 if (eloop->fnext !=
NULL) {
1383 d = d /
cosf(ang / 2.0f);
1403 float norm_v1[3], norm_v2[3];
1408 else if (!edges_between) {
1433 float norm_perp2[3];
1439 float off1a[3], off1b[3], off2a[3], off2b[3];
1456 if (isect_kind == 0) {
1474 if (isect_kind == 2) {
1509 #define BEVEL_GOOD_ANGLE 0.1f
1522 float dir1[3], dir2[3];
1553 float sinang =
sinf(ang);
1593 bool retval =
false;
1598 float meet1[3], meet2[3];
1619 *r_sinratio = (ang1 == 0.0f) ? 1.0f :
sinf(ang2) /
sinf(ang1);
1627 *r_sinratio = (ang1 == 0.0f) ? 1.0f :
sinf(ang2) /
sinf(ang1);
1631 else if (ok1 && !ok2) {
1634 else if (!ok1 && ok2) {
1652 float dir[3], no[3];
1682 const float co_a[3],
1683 const float co_b[3],
1688 #ifdef BEVEL_ASSERT_PROJECT
1699 bool do_linear_interp =
true;
1703 float start[3], end[3];
1707 do_linear_interp =
false;
1736 if (
e->prev->is_bev &&
e->next->is_bev && bv->
selcount >= 3) {
1738 float d3[3], d4[3], co4[3], meetco[3], isect2[3];
1748 do_linear_interp =
true;
1755 if (isect_kind != 0) {
1761 do_linear_interp =
true;
1774 do_linear_interp =
true;
1791 do_linear_interp =
false;
1801 do_linear_interp =
false;
1804 if (do_linear_interp) {
1837 float no[3], no2[3], no3[3];
1868 float d1[3], d2[3], no[3];
1876 float no2[3], no3[3];
1909 return lb->
next == la ? 1 : -1;
1934 const float vmid[3],
1938 float vb_vmid[3], va_vmid[3];
1950 float vo[3], vd[3], vddir[3];
1991 const float va[3],
const float vb[3],
const float vc[3],
const float vd[3],
float r_mat[4][4])
2032 return pow((1.0 -
pow(
x,
r)), (1.0 /
r));
2034 return 1.0 -
pow((1.0 -
pow(1.0 -
x,
r)), (1.0 /
r));
2058 if (nseg == bp->
seg) {
2076 const float map[4][4],
2078 const bool reversed,
2080 const double *xvals,
2081 const double *yvals,
2085 for (
int k = 0; k <= ns; k++) {
2095 const float p[3] = {
2096 reversed ? (
float)yvals[ns - k] : (
float)xvals[k],
2097 reversed ? (
float)xvals[ns - k] : (
float)yvals[k],
2108 float *prof_co_k = r_prof_co + 3 * k;
2165 float bottom_corner[3] = {0.0f, 0.0f, 0.0f};
2167 float top_corner[3] = {1.0f, 1.0f, 0.0f};
2203 float a =
max_ff(0.0f, co[0]);
2204 float b =
max_ff(0.0f, co[1]);
2205 float c =
max_ff(0.0f, co[2]);
2217 float dx = 1.0f -
x;
2218 float dy = 1.0f -
y;
2221 y = midline ? 1.0f :
y;
2225 x = midline ? 1.0f :
x;
2232 y = midline ? 0.0f :
y;
2236 x = midline ? 0.0f :
x;
2241 float rinv = 1.0f /
r;
2265 #define BEV_EXTEND_EDGE_DATA_CHECK(eh, flag) (BM_elem_flag_test(eh->e, flag))
2307 e->rightv->seam_len = flag_count;
2310 e->rightv->sharp_len = flag_count;
2313 }
while (
e != efirst);
2337 for (
int i = bcur->
index; i < idxlen; i++) {
2340 for (
int k = 1; k < vm->
seg; k++) {
2346 while (
e->v1 !=
v2 &&
e->v2 !=
v2) {
2348 e =
e->v1_disk_link.next;
2351 e =
e->v2_disk_link.next;
2359 while (
e->v1 != v3 &&
e->v2 != v3) {
2361 e =
e->v1_disk_link.next;
2364 e =
e->v2_disk_link.next;
2374 }
while (bcur != start);
2385 for (
int i = bcur->
index; i < idxlen; i++) {
2388 for (
int k = 1; k < vm->
seg; k++) {
2392 while (
e->v1 !=
v2 &&
e->v2 !=
v2) {
2394 e =
e->v1_disk_link.next;
2397 e =
e->v2_disk_link.next;
2405 while (
e->v1 != v3 &&
e->v2 != v3) {
2407 e =
e->v1_disk_link.next;
2410 e =
e->v2_disk_link.next;
2420 }
while (bcur != start);
2441 if (lother !=
l && fother) {
2475 if (cd_clnors_offset == -1) {
2484 if (cd_clnors_offset == -1) {
2506 float *pnorm =
NULL;
2517 pnorm = lprev->
f->
no;
2520 pnorm = lnext->
f->
no;
2526 else if (fkind ==
F_VERT) {
2530 else if (fprevkind ==
F_RECON) {
2531 pnorm = lprev->
f->
no;
2533 else if (fnextkind ==
F_RECON) {
2534 pnorm = lnext->
f->
no;
2537 BMLoop *lprevprev, *lnextnext;
2539 estep = lprev->
prev->
e;
2555 pnorm = lprevprev->
f->
no;
2571 if (pnorm ==
norm) {
2588 if (cd_prop_int_idx == -1) {
2600 bool do_set_strength =
true;
2620 do_set_strength =
false;
2622 if (do_set_strength) {
2624 *strength_ptr = strength;
2635 v->any_seam =
false;
2637 v->any_seam |=
e->is_seam;
2638 if (
e ==
v->elast) {
2660 for (
int i = 0; i < bv->
edgecount; i++) {
2671 if (
e->fprev &&
e->fnext) {
2694 bool miter_profile =
false;
2695 bool reverse_profile =
false;
2720 v->efirst =
v->elast =
e;
2721 e->leftv =
e->rightv =
v;
2726 }
while ((
e =
e->next) != efirst);
2730 if (vm->
count == 2) {
2733 else if (bp->
seg == 1) {
2750 const bool construct)
2761 const float *no =
e->fprev ?
e->fprev->
no : (
e->fnext ?
e->fnext->
no :
NULL);
2771 no =
e->fnext ?
e->fnext->
no : (
e->fprev ?
e->fprev->
no :
NULL);
2786 e->next->leftv =
e->next->rightv = bndv;
2810 e->prev->leftv =
e->prev->rightv = bndv;
2826 e->leftv =
e->rightv = bndv;
2827 e->prev->rightv = bndv;
2837 for (
e =
e->next;
e->next != efirst;
e =
e->next) {
2842 e->leftv =
e->rightv = bndv;
2864 else if (vm->
count == 3) {
2865 bool use_tri_fan =
true;
2869 float profile_plane[4];
2873 use_tri_fan =
false;
2876 vm->
mesh_kind = (use_tri_fan) ? M_TRI_FAN : M_POLY;
2904 if (
v1->is_arc_start) {
2910 float co1[3], edge_dir[3], line_p[3];
2914 float d = bp->
offset / (bp->
seg / 2.0f);
2939 if (
v->is_arc_start) {
2943 float edge_dir[3], co[3];
2960 }
while (
v != vstart);
3023 int not_in_plane = 0;
3039 if (in_plane == 0 && not_in_plane == 0) {
3042 else if (not_in_plane > 0) {
3078 e3->leftv = e3->rightv =
v;
3108 v1->is_patch_start =
true;
3110 v2->sinratio =
v1->sinratio;
3113 v1->sinratio = 1.0f;
3115 if (
e->next == e2) {
3120 v2->efirst =
e->next;
3122 e3->leftv = e3->rightv =
v2;
3128 v1->is_arc_start =
true;
3130 if (
e->next == e2) {
3131 v1->elast =
v1->efirst;
3134 int between = in_plane + not_in_plane;
3135 int bet2 = between / 2;
3136 bool betodd = (between % 2) == 1;
3143 e3->profile_index = 0;
3145 else if (betodd && i == bet2) {
3146 e3->profile_index = bp->
seg / 2;
3149 e3->profile_index = bp->
seg;
3186 }
while (
e != efirst);
3198 if (vm->count == 2) {
3199 vm->mesh_kind = M_NONE;
3201 else if (efirst->seg == 1) {
3202 vm->mesh_kind = M_POLY;
3205 switch (bp->vmesh_method) {
3207 vm->mesh_kind = M_ADJ;
3210 vm->mesh_kind = M_CUTOFF;
3218 static void print_adjust_stats(
BoundVert *vstart)
3220 printf(
"\nSolution analysis\n");
3221 double even_residual2 = 0.0;
3222 double spec_residual2 = 0.0;
3223 double max_even_r = 0.0;
3224 double max_even_r_pct = 0.0;
3225 double max_spec_r = 0.0;
3226 double max_spec_r_pct = 0.0;
3227 printf(
"width matching\n");
3230 if (
v->adjchain !=
NULL) {
3235 printf(
"e%d r(%f) vs l(%f): abs(delta)=%f, delta_pct=%f\n",
3241 even_residual2 += delta * delta;
3242 if (delta > max_even_r) {
3245 if (delta_pct > max_even_r_pct) {
3246 max_even_r_pct = delta_pct;
3250 }
while (
v &&
v != vstart);
3252 printf(
"spec matching\n");
3255 if (
v->adjchain !=
NULL) {
3260 printf(
"e%d r(%f) vs r spec(%f): delta=%f, delta_pct=%f\n",
3266 spec_residual2 += delta * delta;
3267 delta =
fabs(delta);
3268 delta_pct =
fabs(delta_pct);
3269 if (delta > max_spec_r) {
3272 if (delta_pct > max_spec_r_pct) {
3273 max_spec_r_pct = delta_pct;
3278 printf(
"e%d l(%f) vs l spec(%f): delta=%f, delta_pct=%f\n",
3284 spec_residual2 += delta * delta;
3285 delta =
fabs(delta);
3286 delta_pct =
fabs(delta_pct);
3287 if (delta > max_spec_r) {
3290 if (delta_pct > max_spec_r_pct) {
3291 max_spec_r_pct = delta_pct;
3295 }
while (
v &&
v != vstart);
3297 printf(
"Analysis Result:\n");
3298 printf(
"even residual2 = %f, spec residual2 = %f\n", even_residual2, spec_residual2);
3299 printf(
"max even delta = %f, max as percent of spec = %f\n", max_even_r, max_even_r_pct);
3300 printf(
"max spec delta = %f, max as percent of spec = %f\n", max_spec_r, max_spec_r_pct);
3304 #ifdef FAST_ADJUST_CODE
3313 static bool adjust_the_cycle_or_chain_fast(
BoundVert *vstart,
int np,
bool iscycle)
3315 float *
g =
MEM_mallocN(np *
sizeof(
float),
"beveladjust");
3316 float *g_prod =
MEM_mallocN(np *
sizeof(
float),
"beveladjust");
3319 float spec_sum = 0.0f;
3323 if (iscycle ||
v->adjchain !=
NULL) {
3324 spec_sum +=
v->efirst->offset_r;
3327 spec_sum +=
v->elast->offset_l;
3331 }
while (
v &&
v != vstart);
3333 float gprod = 1.00f;
3334 float gprod_sum = 1.0f;
3335 for (i = np - 1; i > 0; i--) {
3350 if (gprod_sum == 0.0f) {
3355 float p = spec_sum / gprod_sum;
3361 if (iscycle ||
v->adjchain !=
NULL) {
3364 eright->
offset_r = g_prod[(i + 1) % np] * p;
3365 if (iscycle ||
v != vstart) {
3376 }
while (
v &&
v != vstart);
3409 if ((*r_bv)->selcount == 1) {
3414 if ((*r_bv)->selcount == 2) {
3426 float dir_start_edge[3];
3427 if (start_edge->
e->
v1 == (*r_bv)->v) {
3437 float second_best_dot = 0.0f, best_dot = 0.0f;
3445 float dir_new_edge[3];
3455 float new_dot =
dot_v3v3(dir_new_edge, dir_start_edge);
3456 if (new_dot > best_dot) {
3457 second_best_dot = best_dot;
3461 else if (new_dot > second_best_dot) {
3462 second_best_dot = new_dot;
3496 for (
int i = 0; i < 2; i++) {
3497 EdgeHalf *edgehalf = start_edgehalf;
3499 bool toward_bv = (i == 0);
3516 toward_bv = !toward_bv;
3536 printf(
"\nadjust the %s (with eigen)\n", iscycle ?
"cycle" :
"chain");
3547 }
while (
v &&
v != vstart);
3549 printf(
" -> %d parms\n", np);
3552 #ifdef FAST_ADJUST_CODE
3553 if (adjust_the_cycle_or_chain_fast(vstart, np, iscycle)) {
3558 int nrows = iscycle ? 3 * np : 3 * np - 3;
3566 EdgeHalf *eleft, *eright, *enextleft;
3569 if (iscycle || i < np - 1) {
3572 enextleft =
v->adjchain->elast;
3575 if (iscycle ||
v != vstart) {
3576 printf(
" dependent: e%d->offset_l = %f * p%d\n",
3597 int row = iscycle ? np + 2 * i : np - 1 + 2 * i;
3601 printf(
"b[%d]=%f * %f, for e%d->offset_r\n",
3612 solver, row, (i == np - 1) ? 0 : i + 1, weight *
v->adjchain->sinratio);
3615 printf(
"b[%d]=%f * %f, for e%d->offset_l\n",
3633 }
while (
v &&
v != vstart);
3638 printf(
"\nSolution:\n");
3639 for (i = 0; i < np; i++) {
3649 if (iscycle || i < np - 1) {
3656 if (iscycle ||
v != vstart) {
3673 }
while (
v &&
v != vstart);
3676 print_adjust_stats(vstart);
3727 v = vchainstart = vchainend = vanchor;
3729 bool iscycle =
false;
3731 while (
v->eon && !
v->visited && !iscycle) {
3742 v->adjchain = vnext;
3746 if (vnext != vchainstart) {
3771 vchainstart = vnext;
3773 }
while (!
v->visited &&
v->eon);
3774 if (chainlen >= 3 && !vchainstart->
eon && !vchainend->
eon) {
3811 float dir1[3], dir3[3];
3815 if (
v1->ebev &&
v2->ebev && v3->
ebev) {
3870 BLI_assert(0 <= i && i <= n && 0 <= j && j <= ns && 0 <= k && k <= ns);
3872 if (!odd && j == ns2 && k == ns2) {
3875 if (j <= ns2 - 1 + odd && k <= ns2) {
3879 return mesh_vert(vm, (i + n - 1) % n, k, ns - j);
3881 return mesh_vert(vm, (i + 1) % n, ns - k, j);
3886 int ns2 = vm->
seg / 2;
3887 if (vm->
seg % 2 == 1) {
3888 return (j <= ns2 && k <= ns2);
3891 return ((j < ns2 && k <= ns2) || (j == ns2 && k == ns2 && i == 0));
3900 for (
int i = 0; i < n; i++) {
3901 for (
int j = 0; j <= ns2; j++) {
3902 for (
int k = 0; k <= ns; k++) {
3919 int ns2 = vm->
seg / 2;
3922 for (
int i = 0; i < n; i++) {
3949 return 0.065247584f;
3955 return 0.401983447f;
3958 return 0.523423277f;
3960 double k =
cos(
M_PI / (
double)n);
3964 double k4 = k2 * k2;
3965 double k6 = k4 * k2;
3966 double y =
pow(
M_SQRT3 *
sqrt(64.0 * k6 - 144.0 * k4 + 135.0 * k2 - 27.0) + 9.0 * k, 1.0 / 3.0);
3967 double x = 0.480749856769136 *
y - (0.231120424783545 * (12.0 * k2 - 9.0)) /
y;
3968 return (k *
x + 2.0 * k2 - 1.0) / (
x *
x * (k *
x + 1.0));
3979 for (
int k = 0; k < ns; k++) {
3981 frac[k + 1] = total;
3984 for (
int k = 1; k <= ns; k++) {
3996 float co[3], nextco[3];
4001 for (
int k = 0; k < ns; k++) {
4004 frac[k + 1] = total;
4008 for (
int k = 1; k <= ns; k++) {
4022 for (
int i = 0; i < n; i++) {
4023 if (f <=
frac[i + 1]) {
4024 float rest = f -
frac[i];
4029 *r_rest = rest / (
frac[i + 1] -
frac[i]);
4031 if (i == n - 1 && *r_rest == 1.0f) {
4048 int n_bndv = vm_in->
count;
4049 int ns_in = vm_in->
seg;
4050 int nseg2 = nseg / 2;
4062 for (
int i = 0; i < n_bndv; i++) {
4065 for (
int j = 0; j <= nseg2 - 1 + odd; j++) {
4066 for (
int k = 0; k <= nseg2; k++) {
4068 float fraction = new_frac[k];
4072 fraction = prev_new_frac[nseg - j];
4073 int k_in_prev =
interp_range(prev_frac, ns_in, fraction, &restkprev);
4074 int j_in = ns_in - k_in_prev;
4075 float restj = -restkprev;
4081 restj = 1.0f + restj;
4089 int j0inc = (restj <
BEVEL_EPSILON || j_in == ns_in) ? 0 : 1;
4090 int k0inc = (restk <
BEVEL_EPSILON || k_in == ns_in) ? 0 : 1;
4102 memcpy(prev_frac,
frac,
sizeof(
float) * (ns_in + 1));
4103 memcpy(prev_new_frac, new_frac,
sizeof(
float) * (nseg + 1));
4122 int n_boundary = vm_in->
count;
4123 int ns_in = vm_in->
seg;
4124 int ns_in2 = ns_in / 2;
4126 int ns_out = 2 * ns_in;
4130 for (
int i = 0; i < n_boundary; i++) {
4132 for (
int k = 1; k < ns_in; k++) {
4137 float co1[3], co2[3], acc[3];
4151 for (
int i = 0; i < n_boundary; i++) {
4152 for (
int k = 1; k < ns_out; k += 2) {
4157 float co1[3], co2[3], acc[3];
4173 for (
int i = 0; i < n_boundary; i++) {
4174 for (
int k = 0; k < ns_in; k++) {
4185 for (
int i = 0; i < n_boundary; i++) {
4186 for (
int j = 0; j < ns_in2; j++) {
4187 for (
int k = 0; k < ns_in2; k++) {
4200 for (
int i = 0; i < n_boundary; i++) {
4201 for (
int j = 0; j < ns_in2; j++) {
4202 for (
int k = 1; k <= ns_in2; k++) {
4215 for (
int i = 0; i < n_boundary; i++) {
4216 for (
int j = 1; j < ns_in2; j++) {
4217 for (
int k = 0; k < ns_in2; k++) {
4230 float gamma = 0.25f;
4231 float beta = -gamma;
4232 for (
int i = 0; i < n_boundary; i++) {
4233 for (
int j = 1; j < ns_in2; j++) {
4234 for (
int k = 1; k <= ns_in2; k++) {
4235 float co1[3], co2[3];
4263 float co1[3], co2[3];
4266 for (
int i = 0; i < n_boundary; i++) {
4272 mul_v3_fl(co, 1.0f / (
float)n_boundary);
4275 for (
int i = 0; i < n_boundary; i++) {
4281 for (
int i = 0; i < n_boundary; i++) {
4282 int inext = (i + 1) % n_boundary;
4283 for (
int k = 0; k <= ns_out; k++) {
4286 if (k >= ns_in && k < ns_out) {
4302 for (
int i = 0; i < 3; i++) {
4303 float co[3] = {0.0f, 0.0f, 0.0f};
4307 for (
int i = 0; i < 3; i++) {
4308 for (
int j = 0; j <= ns2; j++) {
4309 for (
int k = 0; k <= ns2; k++) {
4315 co[(i + 1) % 3] = (
float)k * 2.0f / (
float)nseg;
4316 co[(i + 2) % 3] = (
float)j * 2.0f / (
float)nseg;
4337 for (
int i = 0; i < 3; i++) {
4338 float co[3] = {0.0f, 0.0f, 0.0f};
4350 for (
int i = 0; i < 3; i++) {
4351 for (
int k = 0; k <= ns2; k++) {
4353 co[i] = 1.0f - (
float)k *
b;
4354 co[(i + 1) % 3] = 0.0f;
4355 co[(i + 2) % 3] = 0.0f;
4357 co[(i + 1) % 3] = 1.0f - (
float)k *
b;
4358 co[(i + 2) % 3] = 0.0f;
4390 for (
int i = 0; i < 3; i++) {
4391 float co[3] = {0.0f, 0.0f, 0.0f};
4396 for (
int i = 0; i < 3; i++) {
4400 coc[(i + 1) % 3] = 1.0f;
4401 coc[(i + 2) % 3] = 0.0f;
4426 else if (
r < 0.75f) {
4435 while (vm1->
seg < nseg) {
4438 if (vm1->
seg != nseg) {
4444 for (
int i = 0; i < 3; i++) {
4445 for (
int j = 0; j <= ns2; j++) {
4446 for (
int k = 0; k <= nseg; k++) {
4471 float totang = 0.0f;
4472 for (
int i = 0; i < bv->
edgecount; i++) {
4475 float absang =
fabsf(ang);
4479 else if (absang >= 3.0f * (
float)
M_PI_4) {
4494 (angdiff > (
float)
M_PI_4)) {
4507 float co0[3], co1[3], co2[3];
4519 for (
int i = 0; i < 3; i++) {
4520 for (
int j = 0; j <= ns2; j++) {
4521 for (
int k = 0; k <= ns; k++) {
4552 float boundverts_center[3] = {0.0f, 0.0f, 0.0f};
4553 for (
int i = 0; i < n_bndv; i++) {
4560 mul_v3_fl(boundverts_center, 1.0f / (
float)n_bndv);
4566 float original_vertex[3], negative_fullest[3];
4568 sub_v3_v3v3(negative_fullest, boundverts_center, original_vertex);
4569 add_v3_v3(negative_fullest, boundverts_center);
4573 float center_direction[3];
4574 sub_v3_v3v3(center_direction, original_vertex, boundverts_center);
4593 }
while (vm1->
seg < nseg);
4594 if (vm1->
seg != nseg) {
4617 float edir[3], plane[4];
4621 float start_plane[3], end_plane[3], middle_plane[3];
4626 float m[4][4], minv[4][4];
4658 int half_ns = ns / 2;
4659 int ipipe1 = vpipe->
index;
4662 for (
int i = 0; i < n_bndv; i++) {
4663 for (
int j = 1; j <= half_ns; j++) {
4664 for (
int k = 0; k <= half_ns; k++) {
4671 float *profile_point_pipe1, *profile_point_pipe2, f;
4672 if (
ELEM(i, ipipe1, ipipe2)) {
4673 if (n_bndv == 3 && i == ipipe1) {
4676 profile_point_pipe2 =
mesh_vert(vm, i, 0, ring)->
co;
4677 profile_point_pipe1 =
mesh_vert(vm, i, ring, 0)->
co;
4679 f = ((k < j) ?
min_ff(j, k) : ((2.0f * ring) - j)) / (2.0f * ring);
4684 profile_point_pipe2 =
mesh_vert(vm, (i == ipipe1) ? ipipe2 : ipipe1, 0, ns - k)->
co;
4685 f = (
float)j / (
float)ns;
4691 profile_point_pipe2 =
mesh_vert(vm, i, j, ns)->
co;
4692 f = (
float)k / (
float)ns;
4701 bool even = (ns % 2) == 0;
4702 bool midline = even && k == half_ns &&
4703 ((i == 0 && j == half_ns) || (
ELEM(i, ipipe1, ipipe2)));
4723 if (
e->v1 ==
v ||
e->v2 ==
v) {
4724 if (*r_e1 ==
NULL) {
4727 else if (*r_e2 ==
NULL) {
4769 r_internal[n_internal++] =
v;
4770 if (n_internal == 3) {
4775 for (
int i = n_internal; i < 3; i++) {
4776 r_internal[i] =
NULL;
4794 float axis_mat[3][3];
4804 float *co =
v->nv.v->
co;
4805 if (
v == unsnapped[0] ||
v == unsnapped[1] ||
v == unsnapped[2]) {
4809 float snap1[3], snap2[3];
4814 if (d1_sq <= d2_sq) {
4859 bool consider_all_faces = bv->
selcount == 1;
4864 for (
int i = 0; i < bv->
edgecount; i++) {
4865 if (!bv->
edges[i].
is_bev && !consider_all_faces) {
4870 BMFace *ftwo[2] = {bmf1, bmf2};
4873 if (any_bmf ==
NULL) {
4876 bool already_there =
false;
4877 for (
int j = fcount - 1; j >= 0; j--) {
4878 if (fchoices[j] == bmf) {
4879 already_there =
true;
4883 if (!already_there) {
4889 fchoices[fcount++] = bmf;
4909 int ns2 = vm->
seg / 2;
4911 BMEdge *frep_e1, *frep_e2;
4920 frep_e1 = frep_e2 =
NULL;
4928 if (
v == frep_unsnapped[0] ||
v == frep_unsnapped[1] ||
v == frep_unsnapped[2]) {
4963 for (
int i = 0; i < n; i++) {
4964 for (
int k = 1; k < ns; k++) {
4966 if (i > 0 && k <= ns2) {
4969 else if (i == n - 1 && k > ns2) {
4978 for (
int i = 0; i < n; i++) {
5016 float ns2inv = 1.0f / (
float)ns2;
5018 int clstride = 3 * (ns2 + 1);
5019 float *centerline =
MEM_mallocN(
sizeof(
float) * clstride * n_bndv,
"bevel");
5020 bool *cset =
MEM_callocN(
sizeof(
bool) * n_bndv,
"bevel");
5025 for (
int i = 0; i < n_bndv; i++) {
5055 float dir1[3], dir2[3], co1[3], co2[3];
5061 float meet1[3], meet2[3];
5086 float *on_edge_cur = centerline + clstride * i;
5087 int iprev = (i == 0) ? n_bndv - 1 : i - 1;
5088 float *on_edge_prev = centerline + clstride * iprev;
5112 for (
int i = 0; i < n_bndv; i++) {
5114 float *on_edge_cur = centerline + clstride * i;
5116 float co1[3], co2[3];
5121 float meet1[3], meet2[3];
5147 float co1[3], co2[3];
5150 for (
int i = 0; i < n_bndv; i++) {
5159 finalfrac = 0.5f /
sinf(ang);
5160 if (finalfrac > 0.8f) {
5167 ns2inv = 1.0f / (ns2 + finalfrac);
5170 float *p = centerline + clstride * i;
5173 for (
int j = 1; j <= ns2; j++) {
5182 for (
int i = 0; i < n_bndv; i++) {
5184 copy_v3_v3(co2, centerline + clstride * (i == 0 ? n_bndv - 1 : i - 1));
5185 for (
int j = 0; j < ns2 + odd; j++) {
5189 for (
int k = 1; k <= ns2; k++) {
5201 for (
int i = 0; i < n_bndv; i++) {
5202 int im1 = (i == 0) ? n_bndv - 1 : i - 1;
5203 for (
int j = 1; j < ns2 + odd; j++) {
5204 for (
int k = 1; k <= ns2; k++) {
5205 float meet1[3], meet2[3];
5207 centerline + clstride * im1 + 3 * k,
5209 centerline + clstride * i + 3 * j,
5216 centerline + clstride * im1 + 3 * k,
5219 else if (ikind == 1) {
5243 const bool *frep_beats_next)
5245 int previ = (i + n_bndv - 1) % n_bndv;
5246 int nexti = (i + 1) % n_bndv;
5248 if (frep_beats_next[previ] && bndv_rep_faces[previ] == center_frep) {
5251 if (!frep_beats_next[i] && bndv_rep_faces[nexti] == center_frep) {
5293 const bool *frep_beats_next,
5296 BLI_assert(0 <= i && i < n_bndv && 0 <= j && j < ns2 && 0 <= k && k <= ns2);
5302 int previ = (i + n_bndv - 1) % n_bndv;
5304 int jj =
corner < 2 ? j : j + 1;
5306 if (jj < ns2 && kk < ns2) {
5309 else if (jj < ns2 && kk == ns2) {
5311 if (!frep_beats_next[i]) {
5312 r_snap_edges[
corner] = enext;
5315 else if (jj < ns2 && kk == ns2 + 1) {
5317 if (frep_beats_next[i]) {
5318 r_snap_edges[
corner] = enext;
5321 else if (jj == ns2 && kk < ns2) {
5323 if (frep_beats_next[previ]) {
5324 r_snap_edges[
corner] = eprev;
5327 else if (jj == ns2 && kk == ns2) {
5330 i, n_bndv, eprev, enext, bndv_rep_faces, center_frep, frep_beats_next);
5332 else if (jj == ns2 && kk == ns2 + 1) {
5334 int nexti = (i + 1) % n_bndv;
5336 nexti, n_bndv, enext, enextnext, bndv_rep_faces, center_frep, frep_beats_next);
5379 for (
int i = 0; i < n_bndv; i++) {
5380 for (
int j = 0; j <= ns2; j++) {
5381 for (
int k = 0; k <= ns; k++) {
5382 if (j == 0 && (
ELEM(k, 0, ns))) {
5399 int i = bndv->
index;
5407 bool *frep_beats_next =
NULL;
5415 for (
int i = 0; i < n_bndv; i++) {
5416 center_edge_snaps[i] =
NULL;
5418 int inext = (i + 1) % n_bndv;
5419 BMFace *fchoices[2] = {bndv_rep_faces[i], bndv_rep_faces[inext]};
5421 frep_beats_next[i] = fwinner == bndv_rep_faces[i];
5427 int i = bndv->
index;
5429 BMFace *f = bndv_rep_faces[i];
5430 BMFace *f2 = bndv_rep_faces[inext];
5433 fc = frep_beats_next[i] ? f : f2;
5457 for (
int j = 0; j < ns2; j++) {
5458 for (
int k = 0; k < ns2 + odd; k++) {
5464 BMVert *bmvs[4] = {bmv1, bmv2, bmv3, bmv4};
5476 fr[0] = fr[1] = fr[2] = fr[3] = f2;
5478 if (k == ns2 && j == ns2 - 1) {
5485 se[0] = se[2] = bme;
5492 fr[0] = fr[1] = fr[2] = fr[3] = f;
5511 if (!
e ||
e->is_seam) {
5512 fr[0] = fr[1] = fr[2] = fr[3] = fc;
5520 center_verts[i] = bmvs[3];
5521 center_edge_snaps[i] = se[3];
5522 center_face_interps[i] = bv->
any_seam ? center_frep : f;
5530 if (j == ns2 - 1 && bndv->
prev->
ebev) {
5533 se[2] = se[1] !=
NULL ? se[1] : se[3];
5546 int i = bndv->
index;
5548 for (
int ring = 1; ring < ns2; ring++) {
5570 bm, center_verts, n_bndv, center_face_interps, frep, center_edge_snaps, mat_nr,
true);
5592 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5593 printf(
"BEVEL BUILD CUTOFF\n");
5594 # define F3(v) (v)[0], (v)[1], (v)[2]
5601 int i = bndv->
index;
5605 float down_direction[3];
5624 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5625 printf(
"Corner vertices:\n");
5626 for (
int j = 0; j < n_bndv; j++) {
5632 bool build_center_face =
true;
5641 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5642 printf(
"build_center_face: %d\n", build_center_face);
5646 if (build_center_face) {
5648 int i = bndv->
index;
5658 for (
int i = 1; i < n_bndv; i++) {
5666 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5667 printf(
"Building profile cutoff faces.\n");
5673 int i = bndv->
index;
5682 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5683 printf(
"Profile Number %d:\n", i);
5685 printf(
" Miter profile\n");
5687 printf(
" Corner 1: (%0.3f, %0.3f, %0.3f)\n", F3(
mesh_vert(bv->
vmesh, i, 1, 0)->
co));
5691 for (
int k = 0; k < bp->
seg + 1; k++) {
5693 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5694 printf(
" Profile %d: (%0.3f, %0.3f, %0.3f)\n", k, F3(
mesh_vert(bv->
vmesh, i, 0, k)->
co));
5699 if (build_center_face) {
5701 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5702 printf(
" Corner 2: (%0.3f, %0.3f, %0.3f)\n", F3(
mesh_vert(bv->
vmesh, i, 1, 1)->
co));
5710 bp->
seg + 2 + build_center_face,
5722 if (build_center_face) {
5729 for (
int i = 0; i < n_bndv; i++) {
5752 BMEdge *repface_e1, *repface_e2;
5761 repface_e1 = repface_e2 =
NULL;
5771 if (bndv == unsnapped[0] || bndv == unsnapped[1] || bndv == unsnapped[2]) {
5785 for (
int k = 1; k < bndv->
ebev->
seg; k++) {
5830 while (f->
len > 3) {
5837 if (f_new->
len > f->
len) {
5839 if (l_new->
v == v_fan) {
5842 else if (l_new->
next->
v == v_fan) {
5843 l_fan = l_new->
next;
5845 else if (l_new->
prev->
v == v_fan) {
5846 l_fan = l_new->
prev;
5853 if (l_fan->
v == v_fan) {
5855 else if (l_fan->
next->
v == v_fan) {
5856 l_fan = l_fan->
next;
5858 else if (l_fan->
prev->
v == v_fan) {
5859 l_fan = l_fan->
prev;
5897 for (
int k = 1; k < ns; k++) {
5904 for (
int k = 1; k < ns; k++) {
5912 for (
int k = 0; k < ns; k++) {
5936 sizeof(
NewVert) * n * (ns2 + 1) * (ns + 1));
5946 int i = bndv->
index;
5952 if (weld && bndv->
ebev) {
5973 int i = bndv->
index;
5978 for (
int k = 1; k < ns; k++) {
5987 else if (n == 2 && !bndv->
ebev) {
5999 for (
int k = 1; k < ns; k++) {
6022 for (
int k = 1; k < ns; k++) {
6061 if (
e->fprev &&
e->fnext) {
6069 #define BM_BEVEL_EDGE_TAG_ENABLE(bme) BM_ELEM_API_FLAG_ENABLE((bme), _FLAG_OVERLAP)
6070 #define BM_BEVEL_EDGE_TAG_DISABLE(bme) BM_ELEM_API_FLAG_DISABLE((bme), _FLAG_OVERLAP)
6071 #define BM_BEVEL_EDGE_TAG_TEST(bme) BM_ELEM_API_FLAG_TEST((bme), _FLAG_OVERLAP)
6103 for (
int sucindex = 0; sucindex < nsucs; sucindex++) {
6104 BMEdge *nextbme = sucs[sucindex];
6108 bv->
edges[j + 1].
e = nextbme;
6115 for (
int k = j + 1; k <= bestj; k++) {
6120 for (
int k = j + 1; k <= tryj; k++) {
6129 for (
int k = j + 1; k <= bestj; k++) {
6131 bv->
edges[k].
e = save_path[k - (j + 1)];
6146 #ifdef FASTER_FASTORDER
6155 for (
int j = 1; j < bv->
edgecount; j++) {
6165 if (bmenext ==
NULL) {
6170 if (nsucs == 0 || (nsucs == 2 && j != 1) || nsucs > 2 ||
6172 for (
int k = 1; k < j; k++) {
6178 bv->
edges[j].
e = bmenext;
6196 for (
int i = 1; i < ntot; i++) {
6198 int num_shared_face = 0;
6212 if (first_suc ==
NULL) {
6217 if (num_shared_face >= 3) {
6221 if (num_shared_face == 1 || (i == 1 && num_shared_face == 2)) {
6223 e->
e = bme = first_suc;
6227 for (
int k = 1; k < i; k++) {
6246 bv->
edges[i].
e = first_bme;
6274 for (
int i = 0; i < ntot; i++) {
6292 if (!bestf ||
l->
v == bv->
v) {
6297 e->fnext = e2->
fprev = bestf;
6330 if (face_count == 1) {
6378 for (
int i = 0; i < tot_edges; i++) {
6389 e->is_rev = (bme->
v2 ==
v);
6390 e->leftv =
e->rightv =
NULL;
6391 e->profile_index = 0;
6401 if (tot_edges > 1) {
6402 int ccw_test_sum = 0;
6403 for (
int i = 0; i < tot_edges; i++) {
6407 if (ccw_test_sum < 0) {
6408 for (
int i = 0; i <= (tot_edges / 2) - 1; i++) {
6413 if (tot_edges % 2 == 1) {
6414 int i = tot_edges / 2;
6421 float vert_axis[3] = {0, 0, 0};
6436 for (
int i = 0; i < tot_edges; i++,
e++) {
6447 for (
int i = 0; i < tot_edges; i++,
e++) {
6448 e->next = &bv->
edges[(i + 1) % tot_edges];
6449 e->prev = &bv->
edges[(i + tot_edges - 1) % tot_edges];
6458 e->offset_l_spec = bp->
offset;
6464 e->offset_l_spec = 0.01f * bp->
offset;
6474 e->offset_l_spec = 0.01f * bp->
offset;
6495 e->offset_l_spec = bp->
offset;
6496 e->offset_r_spec = bp->
offset;
6501 e->offset_l_spec = bp->
offset;
6506 e->offset_r_spec =
e->offset_l_spec;
6510 e->offset_l_spec *= weight;
6511 e->offset_r_spec *= weight;
6520 e->offset_l_spec = bv->
offset;
6528 e->offset_l_spec = 0.01f * bp->
offset;
6540 e->offset_l_spec = 0.01f * bp->
offset;
6552 e->offset_l_spec = bv->
offset;
6556 e->offset_r_spec =
e->offset_l_spec;
6559 e->offset_l_spec =
e->offset_r_spec = 0.0f;
6561 e->offset_l =
e->offset_l_spec;
6562 e->offset_r =
e->offset_r_spec;
6564 if (
e->fprev &&
e->fnext) {
6573 if (tot_wire != 0) {
6590 bool do_rebuild =
false;
6613 if (
e->prev == eprev) {
6614 if (eprev->
prev ==
e) {
6616 go_ccw = (
e->fnext != f);
6622 else if (eprev->
prev ==
e) {
6637 bool on_profile_start =
false;
6643 if (
e->profile_index > 0) {
6644 vstart = vstart->
prev;
6645 on_profile_start =
true;
6649 vstart = eprev->
leftv;
6652 vstart = vstart->
next;
6653 on_profile_start =
true;
6658 if (!on_profile_start) {
6664 bool corner3special = (vm->
mesh_kind == M_NONE &&
v->ebev !=
e &&
v->ebev != eprev);
6668 if (on_profile_start) {
6669 kstart =
e->profile_index;
6670 on_profile_start =
false;
6681 for (
int k = kstart; k <= kend; k++) {
6686 if (corner3special &&
v->ebev && !bv->
any_seam && k != vm->
seg) {
6695 int i =
v->prev->index;
6697 if (on_profile_start) {
6699 on_profile_start =
false;
6702 kstart = vm->
seg - 1;
6704 if (
e->rightv ==
v->prev &&
e->profile_index > 0) {
6705 kend =
e->profile_index;
6710 for (
int k = kstart; k >= kend; k--) {
6715 if (corner3special &&
v->ebev && !bv->
any_seam && k != 0) {
6740 BMEdge *bme_prev = ee[n - 1];
6741 for (
int k = 0; k < n; k++) {
6744 if (ee[k] != bme_new) {
6748 if (k < n - 1 && ee[k] == ee[k + 1]) {
6799 int faces_len, f_index;
6804 for (f_index = 0; f_index < faces_len; f_index++) {
6825 for (
int i = 0; i < bv->
wirecount; i++) {
6829 float dclosest = FLT_MAX;
6835 if (!bvother || !bvother->
vmesh) {
6846 vclosest = bndv->
nv.
v;
6847 votherclosest = bndvother->
nv.
v;
6855 vclosest = bndv->
nv.
v;
6856 votherclosest = vother;
6872 int i =
e->leftv->index;
6873 for (
int k = 1; k < nseg; k++) {
6912 for (
int i = 0; i < 4; i++) {
6913 if (&bv->
edges[i] ==
e) {
6914 bme_prev = bv->
edges[(i + 3) % 4].
e;
6915 bme_next = bv->
edges[(i + 1) % 4].
e;
6928 for (
int i = 0; i < nseg; i++) {
6936 if (enable_smooth) {
6998 BMFace *fchoices[2] = {f1, f2};
7000 int center_adj_k = -1;
7004 center_adj_k = f_choice == f1 ? mid + 2 : mid;
7007 for (
int k = 1; k <= nseg; k++) {
7011 if (odd && k == mid + 1) {
7017 if (f_choice == f1) {
7018 edges[0] = edges[1] =
NULL;
7019 edges[2] = edges[3] = bme;
7022 edges[0] = edges[1] = bme;
7023 edges[2] = edges[3] =
NULL;
7032 else if (odd && k == center_adj_k && e1->
is_seam) {
7040 edges[0] = edges[1] =
NULL;
7041 edges[2] = edges[3] = bme;
7045 edges[0] = edges[1] = bme;
7046 edges[2] = edges[3] =
NULL;
7051 else if (!odd && k == mid) {
7058 else if (!odd && k == mid + 1) {
7065 BMFace *f = (k <= mid) ? f1 : f2;
7121 const double tol = 1
e-13;
7122 const int maxiter = 10;
7125 double xmin = x0 +
M_SQRT2 / 2.0 * dtarget;
7129 double xmax = x0 + dtarget;
7137 double dmaxerr =
sqrt(
pow((xmax - x0), 2) +
pow((ymax - y0), 2)) - dtarget;
7138 double dminerr =
sqrt(
pow((xmin - x0), 2) +
pow((ymin - y0), 2)) - dtarget;
7140 double xnew = xmax - dmaxerr * (xmax - xmin) / (dmaxerr - dminerr);
7141 bool lastupdated_upper =
true;
7143 for (
int iter = 0; iter < maxiter; iter++) {
7145 double dnewerr =
sqrt(
pow((xnew - x0), 2) +
pow((ynew - y0), 2)) - dtarget;
7146 if (
fabs(dnewerr) < tol) {
7153 if (!lastupdated_upper) {
7154 xnew = (dmaxerr / 2 * xmin - dminerr * xmax) / (dmaxerr / 2 - dminerr);
7157 xnew = xmax - dmaxerr * (xmax - xmin) / (dmaxerr - dminerr);
7159 lastupdated_upper =
false;
7165 if (lastupdated_upper) {
7166 xnew = (dmaxerr * xmin - dminerr / 2 * xmax) / (dmaxerr - dminerr / 2);
7169 xnew = xmax - dmaxerr * (xmax - xmin) / (dmaxerr - dminerr);
7171 lastupdated_upper =
true;
7188 const int smoothitermax = 10;
7189 const double error_tol = 1
e-7;
7190 int imax = (seg + 1) / 2 - 1;
7192 bool seg_odd = seg % 2;
7198 mx =
pow(0.5, 1.0 /
r);
7202 mx = 1 -
pow(0.5, 1.0 /
r);
7206 for (
int i = 0; i <= imax; i++) {
7207 xvals[i] = i * mx / seg * 2;
7213 for (
int iter = 0; iter < smoothitermax; iter++) {
7220 for (
int i = 0; i < imax; i++) {
7221 double d =
sqrt(
pow((xvals[i + 1] - xvals[i]), 2) +
pow((yvals[i + 1] - yvals[i]), 2));
7233 sum +=
M_SQRT2 / 2 * (yvals[imax] - xvals[imax]);
7234 davg =
sum / (imax + 0.5);
7237 sum +=
sqrt(
pow((xvals[imax] - mx), 2) +
pow((yvals[imax] - mx), 2));
7238 davg =
sum / (imax + 1.0);
7241 bool precision_reached =
true;
7242 if (dmax - davg > error_tol) {
7243 precision_reached =
false;
7245 if (dmin - davg < error_tol) {
7246 precision_reached =
false;
7248 if (precision_reached) {
7253 for (
int i = 1; i <= imax; i++) {
7261 xvals[imax + 1] = mx;
7262 yvals[imax + 1] = mx;
7264 for (
int i = imax + 1; i <= seg; i++) {
7265 yvals[i] = xvals[seg - i];
7266 xvals[i] = yvals[seg - i];
7270 for (
int i = 0; i <= seg; i++) {
7271 double temp = xvals[i];
7272 xvals[i] = 1.0 - yvals[i];
7273 yvals[i] = 1.0 - temp;
7288 bool seg_odd = n % 2;
7294 for (
int i = 0; i <= n; i++) {
7295 xvals[i] = (
double)i / n;
7296 yvals[i] = 1.0 - (
double)i / n;
7301 double temp =
M_PI_2 / n;
7303 for (
int i = 0; i <= n; i++) {
7304 xvals[i] =
sin(i * temp);
7305 yvals[i] =
cos(i * temp);
7312 for (
int i = 0; i <= n2; i++) {
7314 yvals[i] = 1.0 - (
double)i / n2;
7315 xvals[n - i] = yvals[i];
7316 yvals[n - i] = xvals[i];
7321 double temp = 1.0 / (n2 +
M_SQRT2 / 2.0);
7322 for (
int i = 0; i <= n2; i++) {
7324 yvals[i] = 1.0 - (
double)i * temp;
7325 xvals[n - i] = yvals[i];
7326 yvals[n - i] = xvals[i];
7334 for (
int i = 0; i <= n2; i++) {
7335 xvals[i] = (
double)i / n2;
7337 xvals[n - i] = yvals[i];
7338 yvals[n - i] = xvals[i];
7343 double temp = 1.0 / (n2 +
M_SQRT2 / 2);
7344 for (
int i = 0; i <= n2; i++) {
7345 xvals[i] = (
double)i * temp;
7347 xvals[n - i] = yvals[i];
7348 yvals[n - i] = xvals[i];
7367 #define CIRCLE_FULLNESS_SEGS 11
7386 for (
int i = 0; i < nseg; i++) {
7397 fullness = circle_fullness[nseg - 1];
7401 if (nseg % 2 == 0) {
7402 fullness = 2.4506f * bp->
profile - 0.00000300f * nseg - 0.6266f;
7405 fullness = 2.3635f * bp->
profile + 0.000152f * nseg - 0.6060f;
7433 pro_spacing->
seg_2 = 0;
7447 sizeof(
double) * (seg_2 + 1));
7449 sizeof(
double) * (seg_2 + 1));
7455 for (
int i = 0; i < seg_2 + 1; i++) {
7476 for (
int i = 0; i < seg + 1; i++) {
7511 float no_collide_offset = bp->
offset + 1e6;
7512 float limit = no_collide_offset;
7513 if (bp->
offset == 0.0f) {
7514 return no_collide_offset;
7541 return bp->
offset > blen / 2.0f ? blen / 2.0f : blen;
7543 return no_collide_offset;
7545 if (ebother !=
NULL) {
7557 return no_collide_offset;
7561 return no_collide_offset;
7563 if (lb->
next->
v == vc) {
7566 else if (lb->
v == vc) {
7570 return no_collide_offset;
7573 if (ea->
e == eb->
e || (ec && ec->
e == eb->
e)) {
7574 return no_collide_offset;
7585 float sin1 =
sinf(th1);
7586 float sin2 =
sinf(th2);
7587 if ((ka > 0.0f) + (kb > 0.0f) + (kc > 0.0f) >= 2) {
7588 float tan1 =
tanf(th1);
7589 float tan2 =
tanf(th2);
7590 float g = tan1 * tan2;
7591 float h = sin1 * sin2;
7592 float den =
g * (ka * sin2 + kc * sin1) + kb * h * (tan1 + tan2);
7603 if (kb > 0.0f && ka == 0.0f ) {
7606 if (
t >= 0.0f &&
t < limit) {
7610 if (kb > 0.0f && kc == 0.0f ) {
7613 if (
t >= 0.0f &&
t < limit) {
7627 float no_collide_offset = bp->
offset + 1e6;
7628 if (bp->
offset == 0.0f) {
7629 return no_collide_offset;
7634 float kab = ka + kb;
7637 return no_collide_offset;
7649 float limited_offset = bp->
offset;
7660 for (
int i = 0; i < bv->
edgecount; i++) {
7664 if (collision_offset < limited_offset) {
7665 limited_offset = collision_offset;
7670 if (collision_offset < limited_offset) {
7671 limited_offset = collision_offset;
7677 if (limited_offset < bp->
offset) {
7683 float offset_factor = limited_offset / bp->
offset;
7692 for (
int i = 0; i < bv->
edgecount; i++) {
7700 bp->
offset = limited_offset;
7706 const int offset_type,
7707 const int profile_type,
7709 const float profile,
7710 const bool affect_type,
7711 const bool use_weights,
7712 const bool limit_offset,
7714 const int vertex_group,
7716 const bool loop_slide,
7717 const bool mark_seam,
7718 const bool mark_sharp,
7719 const bool harden_normals,
7720 const int face_strength_mode,
7721 const int miter_outer,
7722 const int miter_inner,
7724 const float smoothresh,
7726 const int vmesh_method)
7737 .offset_type = offset_type,
7738 .seg =
max_ii(segments, 1),
7741 .affect_type = affect_type,
7742 .use_weights = use_weights,
7743 .loop_slide = loop_slide,
7744 .limit_offset = limit_offset,
7748 .vertex_group = vertex_group,
7750 .mark_seam = mark_seam,
7751 .mark_sharp = mark_sharp,
7752 .harden_normals = harden_normals,
7753 .face_strength_mode = face_strength_mode,
7754 .miter_outer = miter_outer,
7755 .miter_inner = miter_inner,
7757 .smoothresh = smoothresh,
7759 .profile_type = profile_type,
7760 .custom_profile = custom_profile,
7761 .vmesh_method = vmesh_method,
7768 #ifdef BEVEL_DEBUG_TIME
7778 if (profile >= 0.950f) {
7819 if (!limit_offset && bv) {
7935 #ifdef BEVEL_DEBUG_TIME
7937 printf(
"BMESH BEVEL TIME = %.3f\n", end_time - start_time);
typedef float(TangentPoint)[2]
void BKE_curveprofile_init(struct CurveProfile *profile, short segments_len)
CustomData interface, see also DNA_customdata_types.h.
int CustomData_number_of_layers(const struct CustomData *data, int type)
bool CustomData_has_layer(const struct CustomData *data, int type)
int CustomData_get_named_layer_index(const struct CustomData *data, int type, const char *name)
bool CustomData_data_equals(int type, const void *data1, const void *data2)
int CustomData_get_layer_index(const struct CustomData *data, int type)
int CustomData_get_n_offset(const struct CustomData *data, int type, int n)
bool CustomData_layer_has_math(const struct CustomData *data, int layer_n)
int CustomData_get_offset(const struct CustomData *data, int type)
void BKE_lnor_space_custom_normal_to_data(MLoopNorSpace *lnor_space, const float custom_lnor[3], short r_clnor_data[2])
#define BLI_array_alloca(arr, realsize)
A (mainly) macro array library.
#define BLI_array_append(arr, item)
#define BLI_array_staticdeclare(arr, maxstatic)
#define BLI_array_len(arr)
#define BLI_array_clear(arr)
#define BLI_array_free(arr)
#define BLI_assert_msg(a, msg)
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)
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_flag_set(GHash *gh, unsigned int flag)
MINLINE float max_ff(float a, float b)
MINLINE int power_of_2_max_i(int n)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE int is_power_of_2_i(int n)
#define BLI_ASSERT_UNIT_V3(v)
MINLINE int compare_ff(float a, float b, float max_diff)
void plane_from_point_normal_v3(float r_plane[4], const float plane_co[3], const float plane_no[3])
float dist_squared_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3])
int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float r_i1[3], float r_i2[3])
float dist_squared_to_plane_v3(const float p[3], const float plane[4])
float closest_to_line_segment_v3(float r_close[3], const float p[3], const float l1[3], const float l2[3])
void closest_to_plane_normalized_v3(float r_close[3], const float plane[4], const float pt[3])
void axis_dominant_v3_to_m3(float r_mat[3][3], const float normal[3])
Normal to x,y matrix.
void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[3])
bool isect_line_plane_v3(float r_isect_co[3], const float l1[3], const float l2[3], const float plane_co[3], const float plane_no[3]) ATTR_WARN_UNUSED_RESULT
float area_poly_v2(const float verts[][2], unsigned int nr)
void interp_bilinear_quad_v3(float data[4][3], float u, float v, float res[3])
void mul_m4_v4(const float M[4][4], float r[4])
void mul_v2_m3v3(float r[2], const float M[3][3], const float a[3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
MINLINE bool compare_v3v3(const float a[3], const float b[3], float limit) ATTR_WARN_UNUSED_RESULT
float angle_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v2_fl(float r[2], float f)
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])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
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
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v3(float r[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
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
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3(float r[3], const float a[3])
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
void BLI_memarena_use_calloc(struct MemArena *ma) ATTR_NONNULL(1)
void * BLI_memarena_alloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
#define POINTER_FROM_INT(i)
#define UNUSED_VARS_NDEBUG(...)
#define POINTER_AS_INT(i)
typedef double(DMatrix)[4][4]
#define MOD_WEIGHTEDNORMALS_FACEWEIGHT_CDLAYER_ID
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 z
_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 type
_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)
Platform independent time functions.
__forceinline void dot3(const avxf &a, const avxf &b, float &den, float &den2)
static void set_profile_params(BevelParams *bp, BevVert *bv, BoundVert *bndv)
static float find_profile_fullness(BevelParams *bp)
static double find_superellipse_chord_endpoint(double x0, double dtarget, float r, bool rbig)
static void vmesh_center(VMesh *vm, float r_cent[3])
static int find_face_internal_boundverts(const BevVert *bv, const BMFace *f, BoundVert *(r_internal[3]))
static bool make_unit_square_map(const float va[3], const float vmid[3], const float vb[3], float r_mat[4][4])
#define BM_BEVEL_EDGE_TAG_DISABLE(bme)
struct BevelParams BevelParams
static void regularize_profile_orientation(BevelParams *bp, BMEdge *bme)
static BMFace * boundvert_rep_face(BoundVert *v, BMFace **r_fother)
static VMesh * pipe_adj_vmesh(BevelParams *bp, BevVert *bv, BoundVert *vpipe)
static void get_incident_edges(BMFace *f, BMVert *v, BMEdge **r_e1, BMEdge **r_e2)
static BMFace * choose_rep_face(BevelParams *bp, BMFace **face, int nfaces)
static int count_ccw_edges_between(EdgeHalf *e1, EdgeHalf *e2)
static void move_profile_plane(BoundVert *bndv, BMVert *bmvert)
static bool fast_bevel_edge_order(BevVert *bv)
static void bevel_build_rings(BevelParams *bp, BMesh *bm, BevVert *bv, BoundVert *vpipe)
#define BEVEL_EPSILON_ANG
static void build_boundary_terminal_edge(BevelParams *bp, BevVert *bv, EdgeHalf *efirst, const bool construct)
static void get_profile_point(BevelParams *bp, const Profile *pro, int i, int nseg, float r_co[3])
static BMEdge * find_closer_edge(float *co, BMEdge *e1, BMEdge *e2)
#define BEVEL_SMALL_ANG_DOT
static FKind get_face_kind(BevelParams *bp, BMFace *f)
static void disable_flag_out_edge(BMesh *bm, BMEdge *bme)
static bool point_between_edges(const float co[3], BMVert *v, BMFace *f, EdgeHalf *e1, EdgeHalf *e2)
static NewVert * mesh_vert(VMesh *vm, int i, int j, int k)
BLI_INLINE void adjust_bound_vert(BoundVert *bv, const float co[3])
static void swap_face_components(int *face_component, int totface, int c1, int c2)
static void snap_edges_for_vmesh_vert(int i, int j, int k, int ns, int ns2, int n_bndv, BMEdge *eprev, BMEdge *enext, BMEdge *enextnext, BMFace **bndv_rep_faces, BMFace *center_frep, const bool *frep_beats_next, BMEdge *r_snap_edges[4])
static void adjust_miter_inner_coords(BevelParams *bp, BevVert *bv, EdgeHalf *emiter)
static BevVert * find_bevvert(BevelParams *bp, BMVert *bmv)
static void offset_meet_lines_percent_or_absolute(BevelParams *bp, EdgeHalf *e1, EdgeHalf *e2, BMVert *v, float r_l1a[3], float r_l1b[3], float r_l2a[3], float r_l2b[3])
#define BM_BEVEL_EDGE_TAG_TEST(bme)
static float sabin_gamma(int n)
static void weld_cross_attrs_copy(BMesh *bm, BevVert *bv, VMesh *vm, int vmindex, EdgeHalf *e)
static void bevel_set_weighted_normal_face_strength(BMesh *bm, BevelParams *bp)
static void flag_out_vert(BMesh *bm, BMVert *bmv)
static void flag_out_edge(BMesh *bm, BMEdge *bme)
#define BEVEL_EPSILON_ANG_DOT
static void bevel_rebuild_existing_polygons(BMesh *bm, BevelParams *bp, BMVert *v)
static void record_face_kind(BevelParams *bp, BMFace *f, FKind fkind)
static int tri_corner_test(BevelParams *bp, BevVert *bv)
static void bevel_build_edge_polygons(BMesh *bm, BevelParams *bp, BMEdge *bme)
static bool bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f)
static void build_vmesh(BevelParams *bp, BMesh *bm, BevVert *bv)
static BMFace * frep_for_center_poly(BevelParams *bp, BevVert *bv)
static BMEdge * snap_edge_for_center_vmesh_vert(int i, int n_bndv, BMEdge *eprev, BMEdge *enext, BMFace **bndv_rep_faces, BMFace *center_frep, const bool *frep_beats_next)
static bool good_offset_on_edge_between(EdgeHalf *e1, EdgeHalf *e2, EdgeHalf *emid, BMVert *v)
static void bev_merge_edge_uvs(BMesh *bm, BMEdge *bme, BMVert *v)
static bool bevvert_is_weld_cross(BevVert *bv)
static void adjust_the_cycle_or_chain(BoundVert *vstart, bool iscycle)
static void bevel_limit_offset(BevelParams *bp, BMesh *bm)
struct MathLayerInfo MathLayerInfo
static EdgeHalf * next_bev(BevVert *bv, EdgeHalf *from_e)
#define BEV_EXTEND_EDGE_DATA_CHECK(eh, flag)
static void calculate_vm_profiles(BevelParams *bp, BevVert *bv, VMesh *vm)
static AngleKind edges_angle_kind(EdgeHalf *e1, EdgeHalf *e2, BMVert *v)
static void build_boundary_vertex_only(BevelParams *bp, BevVert *bv, bool construct)
static void offset_in_plane(EdgeHalf *e, const float plane_no[3], bool left, float r_co[3])
static void bevel_vert_two_edges(BevelParams *bp, BMesh *bm, BevVert *bv)
static void closer_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float v[3])
static BoundVert * add_new_bound_vert(MemArena *mem_arena, VMesh *vm, const float co[3])
#define BM_BEVEL_EDGE_TAG_ENABLE(bme)
static VMesh * new_adj_vmesh(MemArena *mem_arena, int count, int seg, BoundVert *bounds)
static void set_bound_vert_seams(BevVert *bv, bool mark_seam, bool mark_sharp)
static void move_weld_profile_planes(BevVert *bv, BoundVert *bndv1, BoundVert *bndv2)
static void bev_merge_end_uvs(BMesh *bm, BevVert *bv, EdgeHalf *e)
static bool edge_edge_angle_less_than_180(const BMEdge *e1, const BMEdge *e2, const BMFace *f)
static void create_mesh_bmvert(BMesh *bm, VMesh *vm, int i, int j, int k, BMVert *eg)
static void calculate_profile_segments(const Profile *profile, const float map[4][4], const bool use_map, const bool reversed, const int ns, const double *xvals, const double *yvals, float *r_prof_co)
static void bevel_build_trifan(BevelParams *bp, BMesh *bm, BevVert *bv)
static EdgeHalf * next_edgehalf_bev(BevelParams *bp, EdgeHalf *start_edge, bool toward_bv, BevVert **r_bv)
static void vmesh_copy_equiv_verts(VMesh *vm)
static int count_bound_vert_seams(BevVert *bv)
static bool offset_meet_edge(EdgeHalf *e1, EdgeHalf *e2, BMVert *v, float meetco[3], float *r_angle)
static EdgeHalf * find_edge_half(BevVert *bv, BMEdge *bme)
static void build_boundary(BevelParams *bp, BevVert *bv, bool construct)
static VMesh * make_cube_corner_square_in(MemArena *mem_arena, int nseg)
static void build_center_ngon(BevelParams *bp, BMesh *bm, BevVert *bv, int mat_nr)
static NewVert * mesh_vert_canon(VMesh *vm, int i, int j, int k)
static bool edges_face_connected_at_vert(BMEdge *bme1, BMEdge *bme2)
static void make_unit_cube_map(const float va[3], const float vb[3], const float vc[3], const float vd[3], float r_mat[4][4])
static void adjust_offsets(BevelParams *bp, BMesh *bm)
static void offset_meet(BevelParams *bp, EdgeHalf *e1, EdgeHalf *e2, BMVert *v, BMFace *f, bool edges_between, float meetco[3], const EdgeHalf *e_in_plane)
static bool offset_on_edge_between(BevelParams *bp, EdgeHalf *e1, EdgeHalf *e2, EdgeHalf *emid, BMVert *v, float meetco[3], float *r_sinratio)
static VMesh * cubic_subdiv(BevelParams *bp, VMesh *vm_in)
static void bevel_edges_sharp_boundary(BMesh *bm, BevelParams *bp)
struct ProfileSpacing ProfileSpacing
static void fill_profile_fracs(BevelParams *bp, BoundVert *bndv, float *frac, int ns)
static bool nearly_parallel(const float d1[3], const float d2[3])
static void build_square_in_vmesh(BevelParams *bp, BMesh *bm, BevVert *bv, VMesh *vm1)
static bool is_canon(VMesh *vm, int i, int j, int k)
static bool is_outside_edge(EdgeHalf *e, const float co[3], BMVert **ret_closer_v)
static void find_even_superellipse_chords(int n, float r, double *xvals, double *yvals)
static BevVert * bevel_vert_construct(BMesh *bm, BevelParams *bp, BMVert *v)
static int interp_range(const float *frac, int n, const float f, float *r_rest)
static float geometry_collide_offset(BevelParams *bp, EdgeHalf *eb)
static void set_profile_spacing(BevelParams *bp, ProfileSpacing *pro_spacing, bool custom)
static void slide_dist(EdgeHalf *e, BMVert *v, float d, float r_slideco[3])
static void fill_vmesh_fracs(VMesh *vm, float *frac, int i)
static void bev_merge_uvs(BMesh *bm, BMVert *v)
static void avg4(float co[3], const NewVert *v0, const NewVert *v1, const NewVert *v2, const NewVert *v3)
static float projected_boundary_area(BevVert *bv, BMFace *f)
static void check_edge_data_seam_sharp_edges(BevVert *bv, int flag, bool neg)
#define BEVEL_EPSILON_BIG
static void math_layer_info_init(BevelParams *bp, BMesh *bm)
static VMesh * make_cube_corner_square(MemArena *mem_arena, int nseg)
static VMesh * make_cube_corner_adj_vmesh(BevelParams *bp)
static void bevel_harden_normals(BevelParams *bp, BMesh *bm)
Harden normals for bevel.
static void bevel_build_cutoff(BevelParams *bp, BMesh *bm, BevVert *bv)
static void snap_to_pipe_profile(BoundVert *vpipe, bool midline, float co[3])
static void find_bevel_edge_order(BMesh *bm, BevVert *bv, BMEdge *first_bme)
static float vertex_collide_offset(BevelParams *bp, EdgeHalf *ea)
static EdgeHalf * find_other_end_edge_half(BevelParams *bp, EdgeHalf *e, BevVert **r_bvother)
static void calculate_profile(BevelParams *bp, BoundVert *bndv, bool reversed, bool miter)
void BM_mesh_bevel(BMesh *bm, const float offset, const int offset_type, const int profile_type, const int segments, const float profile, const bool affect_type, const bool use_weights, const bool limit_offset, const struct MDeformVert *dvert, const int vertex_group, const int mat, const bool loop_slide, const bool mark_seam, const bool mark_sharp, const bool harden_normals, const int face_strength_mode, const int miter_outer, const int miter_inner, const float spread, const float smoothresh, const struct CurveProfile *custom_profile, const int vmesh_method)
static int bevel_edge_order_extend(BMesh *bm, BevVert *bv, int i)
static BMFace * bev_create_ngon(BMesh *bm, BMVert **vert_arr, const int totv, BMFace **face_arr, BMFace *facerep, BMEdge **snap_edge_arr, int mat_nr, bool do_interp)
#define BEVEL_MATCH_SPEC_WEIGHT
static float edge_face_angle(EdgeHalf *e)
static BoundVert * pipe_test(BevVert *bv)
static void adjust_miter_coords(BevelParams *bp, BevVert *bv, EdgeHalf *emiter)
static bool contig_ldata_across_edge(BMesh *bm, BMEdge *e, BMFace *f1, BMFace *f2)
static VMesh * tri_corner_adj_vmesh(BevelParams *bp, BevVert *bv)
static void snap_to_superellipsoid(float co[3], const float super_r, bool midline)
static void bevel_reattach_wires(BMesh *bm, BevelParams *bp, BMVert *v)
static void find_even_superellipse_chords_general(int seg, float r, double *xvals, double *yvals)
static bool is_bad_uv_poly(BevVert *bv, BMFace *frep)
static BMFace * bevel_build_poly(BevelParams *bp, BMesh *bm, BevVert *bv)
static bool contig_ldata_across_loops(BMesh *bm, BMLoop *l1, BMLoop *l2, int layer_index)
static bool nearly_parallel_normalized(const float d1[3], const float d2[3])
static void copy_mesh_vert(VMesh *vm, int ito, int jto, int kto, int ifrom, int jfrom, int kfrom)
static double superellipse_co(double x, float r, bool rbig)
static void bevel_extend_edge_data(BevVert *bv)
struct BoundVert BoundVert
static VMesh * square_out_adj_vmesh(BevelParams *bp, BevVert *bv)
static bool eh_on_plane(EdgeHalf *e)
static VMesh * adj_vmesh(BevelParams *bp, BevVert *bv)
#define CIRCLE_FULLNESS_SEGS
static int bev_ccw_test(BMEdge *a, BMEdge *b, BMFace *f)
static void project_to_edge(const BMEdge *e, const float co_a[3], const float co_b[3], float projco[3])
static VMesh * interp_vmesh(BevelParams *bp, VMesh *vm_in, int nseg)
#define BM_DEFAULT_NGON_STACK_SIZE
#define BM_FACE_FIRST_LOOP(p)
#define BM_DEFAULT_ITER_STACK_SIZE
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
void BM_elem_attrs_copy(BMesh *bm_src, BMesh *bm_dst, const void *ele_src, void *ele_dst)
BMVert * BM_vert_create(BMesh *bm, const float co[3], const BMVert *v_example, const eBMCreateFlag create_flag)
Main function for creating a new vertex.
BMFace * BM_face_create_verts(BMesh *bm, BMVert **vert_arr, const int len, const BMFace *f_example, const eBMCreateFlag create_flag, const bool create_edges)
void BM_vert_kill(BMesh *bm, BMVert *v)
void BM_face_kill(BMesh *bm, BMFace *f)
BMEdge * BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *e_example, const eBMCreateFlag create_flag)
Main function for creating a new edge.
#define BM_elem_index_get(ele)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
float BM_elem_float_data_get(CustomData *cd, void *element, int type)
void BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const char *name)
void BM_loop_interp_from_face(BMesh *bm, BMLoop *l_dst, const BMFace *f_src, const bool do_vertex, const bool do_multires)
void * BM_iter_as_arrayN(BMesh *bm, const char itype, void *data, int *r_len, void **stack_array, int stack_array_size)
Iterator as Array.
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_MESH_MUTABLE(ele, ele_next, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
BLI_INLINE BMFace * BM_face_at_index(BMesh *bm, const int index)
void BM_lnorspace_update(BMesh *bm)
void BM_mesh_normals_update(BMesh *bm)
void BM_edges_sharp_from_angle_set(BMesh *bm, const float split_angle)
BMFace * BM_face_split(BMesh *bm, BMFace *f, BMLoop *l_a, BMLoop *l_b, BMLoop **r_l, BMEdge *example, const bool no_double)
Face Split.
#define BMO_edge_flag_test(bm, e, oflag)
#define BMO_edge_flag_enable(bm, e, oflag)
#define BMO_vert_flag_enable(bm, e, oflag)
#define BMO_vert_flag_test(bm, e, oflag)
#define BMO_edge_flag_disable(bm, e, oflag)
@ BEVEL_PROFILE_SUPERELLIPSE
@ BEVEL_FACE_STRENGTH_NONE
@ BEVEL_FACE_STRENGTH_AFFECTED
@ BEVEL_FACE_STRENGTH_NEW
@ BEVEL_FACE_STRENGTH_ALL
void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3])
bool BM_face_point_inside_test(const BMFace *f, const float co[3])
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
BMLoop * BM_face_edge_share_loop(BMFace *f, BMEdge *e)
Return the Loop Shared by Face and Edge.
int BM_edge_face_count(const BMEdge *e)
float BM_edge_calc_length(const BMEdge *e)
BMLoop * BM_vert_step_fan_loop(BMLoop *l, BMEdge **e_step)
bool BM_vert_face_check(const BMVert *v)
float BM_edge_calc_face_angle_signed_ex(const BMEdge *e, const float fallback)
BMESH EDGE/FACE ANGLE.
BMLoop * BM_face_vert_share_loop(BMFace *f, BMVert *v)
Return the Loop Shared by Face and Vertex.
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
static T sum(const btAlignedObjectArray< T > &items)
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void EIG_linear_solver_print_matrix(LinearSolver *solver)
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)
static MemArena * mem_arena
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
ccl_device_inline float2 fabs(const float2 &a)
ccl_device_inline float3 pow(float3 v, float e)
ccl_device_inline float frac(float x, int *ix)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
static void area(int d1, int d2, int e1, int e2, float weights[2])
vec_base< T, 3 > cross(const vec_base< T, 3 > &a, const vec_base< T, 3 > &b)
T length(const vec_base< T, Size > &a)
static MEdge new_edge(const int v1, const int v2)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
vector snap(vector a, vector b)
SocketIndexByIdentifierMap * map
struct BMLoop * radial_next
struct MLoopNorSpaceArray * lnor_spacearr
MathLayerInfo math_layer_info
const struct CurveProfile * custom_profile
const struct MDeformVert * dvert
ProfileSpacing pro_spacing
ProfileSpacing pro_spacing_miter
struct BoundVert * adjchain
CurveProfilePoint * segments
struct BoundVert * rightv
MLoopNorSpace ** lspacearr
enum VMesh::@168 mesh_kind
double PIL_check_seconds_timer(void)
ccl_device_inline float beta(float x, float y)