49 #ifdef BEVEL_DEBUG_TIME
53 #define BEVEL_EPSILON_D 1e-6
54 #define BEVEL_EPSILON 1e-6f
55 #define BEVEL_EPSILON_SQ 1e-12f
56 #define BEVEL_EPSILON_BIG 1e-4f
57 #define BEVEL_EPSILON_BIG_SQ 1e-8f
58 #define BEVEL_EPSILON_ANG DEG2RADF(2.0f)
59 #define BEVEL_SMALL_ANG DEG2RADF(10.0f)
61 #define BEVEL_SMALL_ANG_DOT (1.0f - cosf(BEVEL_SMALL_ANG))
63 #define BEVEL_EPSILON_ANG_DOT (1.0f - cosf(BEVEL_EPSILON_ANG))
64 #define BEVEL_MAX_ADJUST_PCT 10.0f
65 #define BEVEL_MAX_AUTO_ADJUST_PCT 300.0f
66 #define BEVEL_MATCH_SPEC_WEIGHT 0.2
159 #define PRO_SQUARE_R 1e4f
160 #define PRO_CIRCLE_R 2.0f
161 #define PRO_LINE_R 1.0f
162 #define PRO_SQUARE_IN_R 0.0f
389 #define BM_ELEM_LONG_TAG (1 << 6)
447 const float direction_dot =
dot_v3v3(d1, d2);
495 int nj = (vm->
seg / 2) + 1;
496 int nk = vm->
seg + 1;
498 return &vm->
mesh[i * nk * nj + j * nk + k];
520 for (
int i = 0; i < bv->
edgecount; i++) {
521 if (bv->
edges[i].
e == bme) {
522 return &bv->
edges[i];
560 if (from_e ==
NULL) {
568 }
while ((
e =
e->next) != from_e);
616 frep =
v->ebev->fprev;
617 if (
v->efirst->fprev != frep) {
618 frep2 =
v->efirst->fprev;
621 else if (
v->efirst) {
622 frep =
v->efirst->fprev;
624 if (
v->elast->fnext != frep) {
625 frep2 =
v->elast->fnext;
627 else if (
v->efirst->fnext != frep) {
628 frep2 =
v->efirst->fnext;
630 else if (
v->elast->fprev != frep) {
631 frep2 =
v->efirst->fprev;
634 else if (
v->efirst->fnext) {
635 frep =
v->efirst->fnext;
636 if (
v->elast->fnext != frep) {
637 frep2 =
v->elast->fnext;
640 else if (
v->elast->fprev) {
641 frep =
v->elast->fprev;
644 else if (
v->prev->elast) {
645 frep =
v->prev->elast->fnext;
646 if (
v->next->efirst) {
648 frep2 =
v->next->efirst->fprev;
651 frep =
v->next->efirst->fprev;
685 if ((facerep || (face_arr && face_arr[0])) && f) {
696 interp_f = face_arr[i];
733 f->
mat_nr = (short)mat_nr;
750 BMFace *farr[4] = {f1, f2, f3, f4};
771 BMFace *farr[4] = {f1, f2, f3, f4};
772 BMEdge *earr[4] = {e1, e2, e3, e4};
805 if (lef1->
f != f1 || lef2->
f != f2) {
820 lv1f2->
v ==
v1 && lv1f2->
f == f2 && lv2f2->
v ==
v2 && lv2f2->
f == f2);
864 for (
int f = 0; f < totface; f++) {
865 face_component[f] = -1;
868 int current_component = -1;
869 for (
int f = 0; f < totface; f++) {
870 if (face_component[f] == -1 && !in_stack[f]) {
876 while (stack_top >= 0) {
877 BMFace *bmf = stack[stack_top];
880 in_stack[bmf_index] =
false;
881 if (face_component[bmf_index] != -1) {
884 face_component[bmf_index] = current_component;
895 if (bmf_other != bmf) {
897 if (face_component[bmf_other_index] != -1 || in_stack[bmf_other_index]) {
903 stack[stack_top] = bmf_other;
904 in_stack[bmf_other_index] =
true;
930 #define VEC_VALUE_LEN 6
936 for (
int f = 0; f < nfaces; f++) {
939 still_viable[f] =
false;
942 still_viable[f] =
true;
957 value_vecs[f][value_index++] = cent[2];
958 value_vecs[f][value_index++] = cent[0];
959 value_vecs[f][value_index++] = cent[1];
967 for (
int value_index = 0; num_viable > 1 && value_index <
VEC_VALUE_LEN; value_index++) {
968 for (
int f = 0; f < nfaces; f++) {
969 if (!still_viable[f] || f == best_f) {
976 if (value_vecs[f][value_index] < value_vecs[best_f][value_index]) {
979 for (
int i = f - 1; i >= 0; i--) {
980 if (still_viable[i]) {
981 still_viable[i] =
false;
986 else if (value_vecs[f][value_index] > value_vecs[best_f][value_index]) {
987 still_viable[f] =
false;
1005 for (
int i = 0; i < num_of_uv_layers; i++) {
1008 if (cd_loop_uv_offset == -1) {
1013 float uv[2] = {0.0f, 0.0f};
1045 else if (
l->
prev->
e == bme) {
1053 for (
int i = 0; i < num_of_uv_layers; i++) {
1056 if (cd_loop_uv_offset == -1) {
1060 float uv[2] = {0.0f, 0.0f};
1091 float *l1 =
e->
e->
v1->
co;
1098 *ret_closer_v =
e->
e->
v1;
1102 *ret_closer_v =
e->
e->
v2;
1113 float dir1[3], dir2[3];
1132 else if (e2->
fprev) {
1150 float dir1[3], dir2[3], dirco[3], no[3];
1178 float dir1[3], dir2[3],
cross[3];
1181 if (e1->
v1 == e2->
v1) {
1186 else if (e1->
v1 == e2->
v2) {
1191 else if (e1->
v2 == e2->
v1) {
1196 else if (e1->
v2 == e2->
v2) {
1237 float d0, d3, d4, d5;
1243 bool no_offsets = f1 ==
NULL || f2 ==
NULL;
1260 d0 = d3 = d4 = d5 = bp->
offset;
1319 float dir1[3], dir2[3];
1323 float dir1n[3], dir2p[3];
1324 if (edges_between) {
1337 float norm_perp1[3];
1355 for (
EdgeHalf *eloop = e1; eloop != e2; eloop = eloop->
next) {
1356 if (eloop->fnext !=
NULL) {
1374 d = d /
cosf(ang / 2.0f);
1394 float norm_v1[3], norm_v2[3];
1399 else if (!edges_between) {
1424 float norm_perp2[3];
1430 float off1a[3], off1b[3], off2a[3], off2b[3];
1447 if (isect_kind == 0) {
1465 if (isect_kind == 2) {
1496 #define BEVEL_GOOD_ANGLE 0.25f
1509 float dir1[3], dir2[3];
1540 float sinang =
sinf(ang);
1580 bool retval =
false;
1585 float meet1[3], meet2[3];
1606 *r_sinratio = (ang1 == 0.0f) ? 1.0f :
sinf(ang2) /
sinf(ang1);
1614 *r_sinratio = (ang1 == 0.0f) ? 1.0f :
sinf(ang2) /
sinf(ang1);
1618 else if (ok1 && !ok2) {
1621 else if (!ok1 && ok2) {
1639 float dir[3], no[3];
1669 const float co_a[3],
1670 const float co_b[3],
1675 #ifdef BEVEL_ASSERT_PROJECT
1686 bool do_linear_interp =
true;
1690 float start[3], end[3];
1694 do_linear_interp =
false;
1723 if (
e->prev->is_bev &&
e->next->is_bev && bv->
selcount >= 3) {
1725 float d3[3], d4[3], co4[3], meetco[3], isect2[3];
1735 do_linear_interp =
true;
1742 if (isect_kind != 0) {
1748 do_linear_interp =
true;
1761 do_linear_interp =
true;
1778 do_linear_interp =
false;
1788 do_linear_interp =
false;
1791 if (do_linear_interp) {
1824 float no[3], no2[3], no3[3];
1855 float d1[3], d2[3], no[3];
1863 float no2[3], no3[3];
1896 return lb->
next == la ? 1 : -1;
1921 const float vmid[3],
1925 float vb_vmid[3], va_vmid[3];
1937 float vo[3], vd[3], vddir[3];
1978 const float va[3],
const float vb[3],
const float vc[3],
const float vd[3],
float r_mat[4][4])
2019 return pow((1.0 -
pow(
x,
r)), (1.0 /
r));
2021 return 1.0 -
pow((1.0 -
pow(1.0 -
x,
r)), (1.0 /
r));
2045 if (nseg == bp->
seg) {
2063 const float map[4][4],
2065 const bool reversed,
2067 const double *xvals,
2068 const double *yvals,
2072 for (
int k = 0; k <= ns; k++) {
2082 const float p[3] = {
2083 reversed ? (
float)yvals[ns - k] : (
float)xvals[k],
2084 reversed ? (
float)xvals[ns - k] : (
float)yvals[k],
2095 float *prof_co_k = r_prof_co + 3 * k;
2152 float bottom_corner[3] = {0.0f, 0.0f, 0.0f};
2154 float top_corner[3] = {1.0f, 1.0f, 0.0f};
2190 float a =
max_ff(0.0f, co[0]);
2191 float b =
max_ff(0.0f, co[1]);
2192 float c =
max_ff(0.0f, co[2]);
2204 float dx = 1.0f -
x;
2205 float dy = 1.0f -
y;
2208 y = midline ? 1.0f :
y;
2212 x = midline ? 1.0f :
x;
2219 y = midline ? 0.0f :
y;
2223 x = midline ? 0.0f :
x;
2228 float rinv = 1.0f /
r;
2252 #define BEV_EXTEND_EDGE_DATA_CHECK(eh, flag) (BM_elem_flag_test(eh->e, flag))
2294 e->rightv->seam_len = flag_count;
2297 e->rightv->sharp_len = flag_count;
2300 }
while (
e != efirst);
2324 for (
int i = bcur->
index; i < idxlen; i++) {
2327 for (
int k = 1; k < vm->
seg; k++) {
2333 while (
e->v1 !=
v2 &&
e->v2 !=
v2) {
2335 e =
e->v1_disk_link.next;
2338 e =
e->v2_disk_link.next;
2346 while (
e->v1 != v3 &&
e->v2 != v3) {
2348 e =
e->v1_disk_link.next;
2351 e =
e->v2_disk_link.next;
2361 }
while (bcur != start);
2372 for (
int i = bcur->
index; i < idxlen; i++) {
2375 for (
int k = 1; k < vm->
seg; k++) {
2379 while (
e->v1 !=
v2 &&
e->v2 !=
v2) {
2381 e =
e->v1_disk_link.next;
2384 e =
e->v2_disk_link.next;
2392 while (
e->v1 != v3 &&
e->v2 != v3) {
2394 e =
e->v1_disk_link.next;
2397 e =
e->v2_disk_link.next;
2407 }
while (bcur != start);
2428 if (lother !=
l && fother) {
2462 if (cd_clnors_offset == -1) {
2471 if (cd_clnors_offset == -1) {
2493 float *pnorm =
NULL;
2504 pnorm = lprev->
f->
no;
2507 pnorm = lnext->
f->
no;
2513 else if (fkind ==
F_VERT) {
2517 else if (fprevkind ==
F_RECON) {
2518 pnorm = lprev->
f->
no;
2520 else if (fnextkind ==
F_RECON) {
2521 pnorm = lnext->
f->
no;
2524 BMLoop *lprevprev, *lnextnext;
2526 estep = lprev->
prev->
e;
2542 pnorm = lprevprev->
f->
no;
2558 if (pnorm ==
norm) {
2575 if (cd_prop_int_idx == -1) {
2587 bool do_set_strength =
true;
2607 do_set_strength =
false;
2609 if (do_set_strength) {
2611 *strength_ptr = strength;
2622 v->any_seam =
false;
2624 v->any_seam |=
e->is_seam;
2625 if (
e ==
v->elast) {
2647 for (
int i = 0; i < bv->
edgecount; i++) {
2658 if (
e->fprev &&
e->fnext) {
2681 bool miter_profile =
false;
2682 bool reverse_profile =
false;
2707 v->efirst =
v->elast =
e;
2708 e->leftv =
e->rightv =
v;
2713 }
while ((
e =
e->next) != efirst);
2717 if (vm->
count == 2) {
2720 else if (bp->
seg == 1) {
2737 const bool construct)
2748 const float *no =
e->fprev ?
e->fprev->
no : (
e->fnext ?
e->fnext->
no :
NULL);
2758 no =
e->fnext ?
e->fnext->
no : (
e->fprev ?
e->fprev->
no :
NULL);
2773 e->next->leftv =
e->next->rightv = bndv;
2797 e->prev->leftv =
e->prev->rightv = bndv;
2813 e->leftv =
e->rightv = bndv;
2814 e->prev->rightv = bndv;
2824 for (
e =
e->next;
e->next != efirst;
e =
e->next) {
2829 e->leftv =
e->rightv = bndv;
2851 else if (vm->
count == 3) {
2852 bool use_tri_fan =
true;
2856 float profile_plane[4];
2860 use_tri_fan =
false;
2863 vm->
mesh_kind = (use_tri_fan) ? M_TRI_FAN : M_POLY;
2891 if (
v1->is_arc_start) {
2897 float co1[3], edge_dir[3], line_p[3];
2901 float d = bp->
offset / (bp->
seg / 2.0f);
2926 if (
v->is_arc_start) {
2930 float edge_dir[3], co[3];
2947 }
while (
v != vstart);
3010 int not_in_plane = 0;
3026 if (in_plane == 0 && not_in_plane == 0) {
3029 else if (not_in_plane > 0) {
3063 e3->leftv = e3->rightv =
v;
3093 v1->is_patch_start =
true;
3095 v2->sinratio =
v1->sinratio;
3098 v1->sinratio = 1.0f;
3100 if (
e->next == e2) {
3105 v2->efirst =
e->next;
3107 e3->leftv = e3->rightv =
v2;
3113 v1->is_arc_start =
true;
3115 if (
e->next == e2) {
3116 v1->elast =
v1->efirst;
3119 int between = in_plane + not_in_plane;
3120 int bet2 = between / 2;
3121 bool betodd = (between % 2) == 1;
3128 e3->profile_index = 0;
3130 else if (betodd && i == bet2) {
3131 e3->profile_index = bp->
seg / 2;
3134 e3->profile_index = bp->
seg;
3171 }
while (
e != efirst);
3183 if (vm->count == 2) {
3184 vm->mesh_kind = M_NONE;
3186 else if (efirst->seg == 1) {
3187 vm->mesh_kind = M_POLY;
3190 switch (bp->vmesh_method) {
3192 vm->mesh_kind = M_ADJ;
3195 vm->mesh_kind = M_CUTOFF;
3203 static void print_adjust_stats(
BoundVert *vstart)
3205 printf(
"\nSolution analysis\n");
3206 double even_residual2 = 0.0;
3207 double spec_residual2 = 0.0;
3208 double max_even_r = 0.0;
3209 double max_even_r_pct = 0.0;
3210 double max_spec_r = 0.0;
3211 double max_spec_r_pct = 0.0;
3212 printf(
"width matching\n");
3215 if (
v->adjchain !=
NULL) {
3220 printf(
"e%d r(%f) vs l(%f): abs(delta)=%f, delta_pct=%f\n",
3226 even_residual2 += delta * delta;
3227 if (delta > max_even_r) {
3230 if (delta_pct > max_even_r_pct) {
3231 max_even_r_pct = delta_pct;
3235 }
while (
v &&
v != vstart);
3237 printf(
"spec matching\n");
3240 if (
v->adjchain !=
NULL) {
3245 printf(
"e%d r(%f) vs r spec(%f): delta=%f, delta_pct=%f\n",
3251 spec_residual2 += delta * delta;
3252 delta =
fabs(delta);
3253 delta_pct =
fabs(delta_pct);
3254 if (delta > max_spec_r) {
3257 if (delta_pct > max_spec_r_pct) {
3258 max_spec_r_pct = delta_pct;
3263 printf(
"e%d l(%f) vs l spec(%f): delta=%f, delta_pct=%f\n",
3269 spec_residual2 += delta * delta;
3270 delta =
fabs(delta);
3271 delta_pct =
fabs(delta_pct);
3272 if (delta > max_spec_r) {
3275 if (delta_pct > max_spec_r_pct) {
3276 max_spec_r_pct = delta_pct;
3280 }
while (
v &&
v != vstart);
3282 printf(
"Analysis Result:\n");
3283 printf(
"even residual2 = %f, spec residual2 = %f\n", even_residual2, spec_residual2);
3284 printf(
"max even delta = %f, max as percent of spec = %f\n", max_even_r, max_even_r_pct);
3285 printf(
"max spec delta = %f, max as percent of spec = %f\n", max_spec_r, max_spec_r_pct);
3289 #ifdef FAST_ADJUST_CODE
3298 static bool adjust_the_cycle_or_chain_fast(
BoundVert *vstart,
int np,
bool iscycle)
3300 float *g =
MEM_mallocN(np *
sizeof(
float),
"beveladjust");
3301 float *g_prod =
MEM_mallocN(np *
sizeof(
float),
"beveladjust");
3304 float spec_sum = 0.0f;
3308 if (iscycle ||
v->adjchain !=
NULL) {
3309 spec_sum +=
v->efirst->offset_r;
3312 spec_sum +=
v->elast->offset_l;
3316 }
while (
v &&
v != vstart);
3318 float gprod = 1.00f;
3319 float gprod_sum = 1.0f;
3320 for (i = np - 1; i > 0; i--) {
3335 if (gprod_sum == 0.0f) {
3340 float p = spec_sum / gprod_sum;
3346 if (iscycle ||
v->adjchain !=
NULL) {
3349 eright->
offset_r = g_prod[(i + 1) % np] * p;
3350 if (iscycle ||
v != vstart) {
3361 }
while (
v &&
v != vstart);
3394 if ((*r_bv)->selcount == 1) {
3399 if ((*r_bv)->selcount == 2) {
3403 new_edge = new_edge->
next;
3404 }
while (!new_edge->
is_bev);
3411 float dir_start_edge[3];
3412 if (start_edge->
e->
v1 == (*r_bv)->v) {
3422 float second_best_dot = 0.0f, best_dot = 0.0f;
3424 while (new_edge != start_edge) {
3426 new_edge = new_edge->
next;
3430 float dir_new_edge[3];
3431 if (new_edge->
e->
v2 == (*r_bv)->v) {
3440 float new_dot =
dot_v3v3(dir_new_edge, dir_start_edge);
3441 if (new_dot > best_dot) {
3442 second_best_dot = best_dot;
3444 next_edge = new_edge;
3446 else if (new_dot > second_best_dot) {
3447 second_best_dot = new_dot;
3450 new_edge = new_edge->
next;
3481 for (
int i = 0; i < 2; i++) {
3482 EdgeHalf *edgehalf = start_edgehalf;
3484 bool toward_bv = (i == 0);
3501 toward_bv = !toward_bv;
3521 printf(
"\nadjust the %s (with eigen)\n", iscycle ?
"cycle" :
"chain");
3532 }
while (
v &&
v != vstart);
3534 printf(
" -> %d parms\n", np);
3537 #ifdef FAST_ADJUST_CODE
3538 if (adjust_the_cycle_or_chain_fast(vstart, np, iscycle)) {
3543 int nrows = iscycle ? 3 * np : 3 * np - 3;
3551 EdgeHalf *eleft, *eright, *enextleft;
3554 if (iscycle || i < np - 1) {
3557 enextleft =
v->adjchain->elast;
3560 if (iscycle ||
v != vstart) {
3561 printf(
" dependent: e%d->offset_l = %f * p%d\n",
3582 int row = iscycle ? np + 2 * i : np - 1 + 2 * i;
3586 printf(
"b[%d]=%f * %f, for e%d->offset_r\n",
3597 solver, row, (i == np - 1) ? 0 : i + 1, weight *
v->adjchain->sinratio);
3600 printf(
"b[%d]=%f * %f, for e%d->offset_l\n",
3618 }
while (
v &&
v != vstart);
3623 printf(
"\nSolution:\n");
3624 for (i = 0; i < np; i++) {
3634 if (iscycle || i < np - 1) {
3641 if (iscycle ||
v != vstart) {
3658 }
while (
v &&
v != vstart);
3661 print_adjust_stats(vstart);
3712 v = vchainstart = vchainend = vanchor;
3714 bool iscycle =
false;
3716 while (
v->eon && !
v->visited && !iscycle) {
3727 v->adjchain = vnext;
3731 if (vnext != vchainstart) {
3756 vchainstart = vnext;
3758 }
while (!
v->visited &&
v->eon);
3759 if (chainlen >= 3 && !vchainstart->
eon && !vchainend->
eon) {
3796 float dir1[3], dir3[3];
3800 if (
v1->ebev &&
v2->ebev && v3->
ebev) {
3855 BLI_assert(0 <= i && i <= n && 0 <= j && j <= ns && 0 <= k && k <= ns);
3857 if (!odd && j == ns2 && k == ns2) {
3860 if (j <= ns2 - 1 + odd && k <= ns2) {
3864 return mesh_vert(vm, (i + n - 1) % n, k, ns - j);
3866 return mesh_vert(vm, (i + 1) % n, ns - k, j);
3871 int ns2 = vm->
seg / 2;
3872 if (vm->
seg % 2 == 1) {
3873 return (j <= ns2 && k <= ns2);
3876 return ((j < ns2 && k <= ns2) || (j == ns2 && k == ns2 && i == 0));
3885 for (
int i = 0; i < n; i++) {
3886 for (
int j = 0; j <= ns2; j++) {
3887 for (
int k = 0; k <= ns; k++) {
3904 int ns2 = vm->
seg / 2;
3907 for (
int i = 0; i < n; i++) {
3934 return 0.065247584f;
3940 return 0.401983447f;
3943 return 0.523423277f;
3945 double k =
cos(
M_PI / (
double)n);
3949 double k4 = k2 * k2;
3950 double k6 = k4 * k2;
3951 double y =
pow(
M_SQRT3 *
sqrt(64.0 * k6 - 144.0 * k4 + 135.0 * k2 - 27.0) + 9.0 * k, 1.0 / 3.0);
3952 double x = 0.480749856769136 *
y - (0.231120424783545 * (12.0 * k2 - 9.0)) /
y;
3953 return (k *
x + 2.0 * k2 - 1.0) / (
x *
x * (k *
x + 1.0));
3964 for (
int k = 0; k < ns; k++) {
3966 frac[k + 1] = total;
3969 for (
int k = 1; k <= ns; k++) {
3981 float co[3], nextco[3];
3986 for (
int k = 0; k < ns; k++) {
3989 frac[k + 1] = total;
3993 for (
int k = 1; k <= ns; k++) {
4007 for (
int i = 0; i < n; i++) {
4008 if (f <=
frac[i + 1]) {
4009 float rest = f -
frac[i];
4014 *r_rest = rest / (
frac[i + 1] -
frac[i]);
4016 if (i == n - 1 && *r_rest == 1.0f) {
4033 int n_bndv = vm_in->
count;
4034 int ns_in = vm_in->
seg;
4035 int nseg2 = nseg / 2;
4047 for (
int i = 0; i < n_bndv; i++) {
4050 for (
int j = 0; j <= nseg2 - 1 + odd; j++) {
4051 for (
int k = 0; k <= nseg2; k++) {
4053 float fraction = new_frac[k];
4057 fraction = prev_new_frac[nseg - j];
4058 int k_in_prev =
interp_range(prev_frac, ns_in, fraction, &restkprev);
4059 int j_in = ns_in - k_in_prev;
4060 float restj = -restkprev;
4066 restj = 1.0f + restj;
4074 int j0inc = (restj <
BEVEL_EPSILON || j_in == ns_in) ? 0 : 1;
4075 int k0inc = (restk <
BEVEL_EPSILON || k_in == ns_in) ? 0 : 1;
4087 memcpy(prev_frac,
frac,
sizeof(
float) * (ns_in + 1));
4088 memcpy(prev_new_frac, new_frac,
sizeof(
float) * (nseg + 1));
4107 int n_boundary = vm_in->
count;
4108 int ns_in = vm_in->
seg;
4109 int ns_in2 = ns_in / 2;
4111 int ns_out = 2 * ns_in;
4115 for (
int i = 0; i < n_boundary; i++) {
4117 for (
int k = 1; k < ns_in; k++) {
4122 float co1[3], co2[3], acc[3];
4136 for (
int i = 0; i < n_boundary; i++) {
4137 for (
int k = 1; k < ns_out; k += 2) {
4142 float co1[3], co2[3], acc[3];
4158 for (
int i = 0; i < n_boundary; i++) {
4159 for (
int k = 0; k < ns_in; k++) {
4170 for (
int i = 0; i < n_boundary; i++) {
4171 for (
int j = 0; j < ns_in2; j++) {
4172 for (
int k = 0; k < ns_in2; k++) {
4185 for (
int i = 0; i < n_boundary; i++) {
4186 for (
int j = 0; j < ns_in2; j++) {
4187 for (
int k = 1; k <= ns_in2; k++) {
4200 for (
int i = 0; i < n_boundary; i++) {
4201 for (
int j = 1; j < ns_in2; j++) {
4202 for (
int k = 0; k < ns_in2; k++) {
4215 float gamma = 0.25f;
4216 float beta = -gamma;
4217 for (
int i = 0; i < n_boundary; i++) {
4218 for (
int j = 1; j < ns_in2; j++) {
4219 for (
int k = 1; k <= ns_in2; k++) {
4220 float co1[3], co2[3];
4248 float co1[3], co2[3];
4251 for (
int i = 0; i < n_boundary; i++) {
4257 mul_v3_fl(co, 1.0f / (
float)n_boundary);
4260 for (
int i = 0; i < n_boundary; i++) {
4266 for (
int i = 0; i < n_boundary; i++) {
4267 int inext = (i + 1) % n_boundary;
4268 for (
int k = 0; k <= ns_out; k++) {
4271 if (k >= ns_in && k < ns_out) {
4287 for (
int i = 0; i < 3; i++) {
4288 float co[3] = {0.0f, 0.0f, 0.0f};
4292 for (
int i = 0; i < 3; i++) {
4293 for (
int j = 0; j <= ns2; j++) {
4294 for (
int k = 0; k <= ns2; k++) {
4300 co[(i + 1) % 3] = (
float)k * 2.0f / (
float)nseg;
4301 co[(i + 2) % 3] = (
float)j * 2.0f / (
float)nseg;
4322 for (
int i = 0; i < 3; i++) {
4323 float co[3] = {0.0f, 0.0f, 0.0f};
4333 b = 2.0f / (
float)nseg;
4335 for (
int i = 0; i < 3; i++) {
4336 for (
int k = 0; k <= ns2; k++) {
4338 co[i] = 1.0f - (
float)k * b;
4339 co[(i + 1) % 3] = 0.0f;
4340 co[(i + 2) % 3] = 0.0f;
4342 co[(i + 1) % 3] = 1.0f - (
float)k * b;
4343 co[(i + 2) % 3] = 0.0f;
4375 for (
int i = 0; i < 3; i++) {
4376 float co[3] = {0.0f, 0.0f, 0.0f};
4381 for (
int i = 0; i < 3; i++) {
4385 coc[(i + 1) % 3] = 1.0f;
4386 coc[(i + 2) % 3] = 0.0f;
4411 else if (
r < 0.75f) {
4420 while (vm1->
seg < nseg) {
4423 if (vm1->
seg != nseg) {
4429 for (
int i = 0; i < 3; i++) {
4430 for (
int j = 0; j <= ns2; j++) {
4431 for (
int k = 0; k <= nseg; k++) {
4456 float totang = 0.0f;
4457 for (
int i = 0; i < bv->
edgecount; i++) {
4460 float absang =
fabsf(ang);
4464 else if (absang >= 3.0f * (
float)
M_PI_4) {
4479 (angdiff > (
float)
M_PI_4)) {
4492 float co0[3], co1[3], co2[3];
4504 for (
int i = 0; i < 3; i++) {
4505 for (
int j = 0; j <= ns2; j++) {
4506 for (
int k = 0; k <= ns; k++) {
4537 float boundverts_center[3] = {0.0f, 0.0f, 0.0f};
4538 for (
int i = 0; i < n_bndv; i++) {
4545 mul_v3_fl(boundverts_center, 1.0f / (
float)n_bndv);
4551 float original_vertex[3], negative_fullest[3];
4553 sub_v3_v3v3(negative_fullest, boundverts_center, original_vertex);
4554 add_v3_v3(negative_fullest, boundverts_center);
4558 float center_direction[3];
4559 sub_v3_v3v3(center_direction, original_vertex, boundverts_center);
4578 }
while (vm1->
seg < nseg);
4579 if (vm1->
seg != nseg) {
4602 float edir[3], plane[4];
4606 float start_plane[3], end_plane[3], middle_plane[3];
4611 float m[4][4], minv[4][4];
4643 int half_ns = ns / 2;
4644 int ipipe1 = vpipe->
index;
4647 for (
int i = 0; i < n_bndv; i++) {
4648 for (
int j = 1; j <= half_ns; j++) {
4649 for (
int k = 0; k <= half_ns; k++) {
4656 float *profile_point_pipe1, *profile_point_pipe2, f;
4657 if (
ELEM(i, ipipe1, ipipe2)) {
4658 if (n_bndv == 3 && i == ipipe1) {
4661 profile_point_pipe2 =
mesh_vert(vm, i, 0, ring)->
co;
4662 profile_point_pipe1 =
mesh_vert(vm, i, ring, 0)->
co;
4664 f = ((k < j) ?
min_ff(j, k) : ((2.0f * ring) - j)) / (2.0f * ring);
4669 profile_point_pipe2 =
mesh_vert(vm, (i == ipipe1) ? ipipe2 : ipipe1, 0, ns - k)->
co;
4670 f = (
float)j / (
float)ns;
4676 profile_point_pipe2 =
mesh_vert(vm, i, j, ns)->
co;
4677 f = (
float)k / (
float)ns;
4686 bool even = (ns % 2) == 0;
4687 bool midline = even && k == half_ns &&
4688 ((i == 0 && j == half_ns) || (i == ipipe1 || i == ipipe2));
4708 if (
e->v1 ==
v ||
e->v2 ==
v) {
4709 if (*r_e1 ==
NULL) {
4712 else if (*r_e2 ==
NULL) {
4736 float beste_d2 = 1e20f;
4743 if (d2 < beste_d2) {
4804 bool consider_all_faces = bv->
selcount == 1;
4807 for (
int i = 0; i < bv->
edgecount; i++) {
4808 if (!bv->
edges[i].
is_bev && !consider_all_faces) {
4813 BMFace *ftwo[2] = {bmf1, bmf2};
4816 if (any_bmf ==
NULL) {
4819 bool already_there =
false;
4820 for (
int j = fcount - 1; j >= 0; j--) {
4821 if (fchoices[j] == bmf) {
4822 already_there =
true;
4826 if (!already_there) {
4832 fchoices[fcount++] = bmf;
4852 int ns2 = vm->
seg / 2;
4854 BMEdge *frep_e1, *frep_e2;
4861 frep_e1 = frep_e2 =
NULL;
4899 for (
int i = 0; i < n; i++) {
4900 for (
int k = 1; k < ns; k++) {
4902 if (i > 0 && k <= ns2) {
4905 else if (i == n - 1 && k > ns2) {
4914 for (
int i = 0; i < n; i++) {
4952 float ns2inv = 1.0f / (
float)ns2;
4954 int clstride = 3 * (ns2 + 1);
4955 float *centerline =
MEM_mallocN(
sizeof(
float) * clstride * n_bndv,
"bevel");
4956 bool *cset =
MEM_callocN(
sizeof(
bool) * n_bndv,
"bevel");
4961 for (
int i = 0; i < n_bndv; i++) {
4991 float dir1[3], dir2[3], co1[3], co2[3];
4997 float meet1[3], meet2[3];
5022 float *on_edge_cur = centerline + clstride * i;
5023 int iprev = (i == 0) ? n_bndv - 1 : i - 1;
5024 float *on_edge_prev = centerline + clstride * iprev;
5048 for (
int i = 0; i < n_bndv; i++) {
5050 float *on_edge_cur = centerline + clstride * i;
5052 float co1[3], co2[3];
5057 float meet1[3], meet2[3];
5083 float co1[3], co2[3];
5086 for (
int i = 0; i < n_bndv; i++) {
5095 finalfrac = 0.5f /
sinf(ang);
5096 if (finalfrac > 0.8f) {
5103 ns2inv = 1.0f / (ns2 + finalfrac);
5106 float *p = centerline + clstride * i;
5109 for (
int j = 1; j <= ns2; j++) {
5118 for (
int i = 0; i < n_bndv; i++) {
5120 copy_v3_v3(co2, centerline + clstride * (i == 0 ? n_bndv - 1 : i - 1));
5121 for (
int j = 0; j < ns2 + odd; j++) {
5125 for (
int k = 1; k <= ns2; k++) {
5137 for (
int i = 0; i < n_bndv; i++) {
5138 int im1 = (i == 0) ? n_bndv - 1 : i - 1;
5139 for (
int j = 1; j < ns2 + odd; j++) {
5140 for (
int k = 1; k <= ns2; k++) {
5141 float meet1[3], meet2[3];
5143 centerline + clstride * im1 + 3 * k,
5145 centerline + clstride * i + 3 * j,
5152 centerline + clstride * im1 + 3 * k,
5155 else if (ikind == 1) {
5211 for (
int i = 0; i < n_bndv; i++) {
5212 for (
int j = 0; j <= ns2; j++) {
5213 for (
int k = 0; k <= ns; k++) {
5214 if (j == 0 && (k == 0 || k == ns)) {
5229 int i = bndv->
index;
5232 BMFace *fchoices[2] = {f, f2};
5244 for (
int j = 0; j < ns2; j++) {
5245 for (
int k = 0; k < ns2 + odd; k++) {
5254 if (k == ns2 && j == ns2 - 1) {
5282 bm, bmv1, bmv2, bmv3, bmv4, f2, f2, f2, f2, bme,
NULL, bme,
NULL, f2, mat_nr);
5286 bm, bmv1, bmv2, bmv3, bmv4, f2, f2, f2, f, bme,
NULL, bme,
NULL, f2, mat_nr);
5293 if (
e &&
e->is_seam) {
5295 bm, bmv1, bmv2, bmv3, bmv4, fc, fc, fc, fc,
NULL, bme, bme,
NULL, fc, mat_nr);
5299 bm, bmv1, bmv2, bmv3, bmv4, f, f2, f2, f,
NULL, bme, bme,
NULL, fc, mat_nr);
5309 if (j == ns2 - 1 && bndv->
prev->
ebev) {
5314 bm, bmv1, bmv2, bmv3, bmv4, f, f, f, f,
NULL, bme1, bme2, bme3, f, mat_nr);
5326 int i = bndv->
index;
5328 for (
int ring = 1; ring < ns2; ring++) {
5361 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5362 printf(
"BEVEL BUILD CUTOFF\n");
5363 # define F3(v) (v)[0], (v)[1], (v)[2]
5370 int i = bndv->
index;
5374 float down_direction[3];
5393 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5394 printf(
"Corner vertices:\n");
5395 for (
int j = 0; j < n_bndv; j++) {
5401 bool build_center_face =
true;
5410 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5411 printf(
"build_center_face: %d\n", build_center_face);
5415 if (build_center_face) {
5417 int i = bndv->
index;
5427 for (
int i = 1; i < n_bndv; i++) {
5435 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5436 printf(
"Building profile cutoff faces.\n");
5442 int i = bndv->
index;
5451 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5452 printf(
"Profile Number %d:\n", i);
5454 printf(
" Miter profile\n");
5456 printf(
" Corner 1: (%0.3f, %0.3f, %0.3f)\n", F3(
mesh_vert(bv->
vmesh, i, 1, 0)->
co));
5460 for (
int k = 0; k < bp->
seg + 1; k++) {
5462 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5463 printf(
" Profile %d: (%0.3f, %0.3f, %0.3f)\n", k, F3(
mesh_vert(bv->
vmesh, i, 0, k)->
co));
5468 if (build_center_face) {
5470 #ifdef DEBUG_CUSTOM_PROFILE_CUTOFF
5471 printf(
" Corner 2: (%0.3f, %0.3f, %0.3f)\n", F3(
mesh_vert(bv->
vmesh, i, 1, 1)->
co));
5479 bp->
seg + 2 + build_center_face,
5491 if (build_center_face) {
5498 for (
int i = 0; i < n_bndv; i++) {
5521 BMEdge *repface_e1, *repface_e2;
5528 repface_e1 = repface_e2 =
NULL;
5547 for (
int k = 1; k < bndv->
ebev->
seg; k++) {
5592 while (f->
len > 3) {
5599 if (f_new->
len > f->
len) {
5601 if (l_new->
v == v_fan) {
5604 else if (l_new->
next->
v == v_fan) {
5605 l_fan = l_new->
next;
5607 else if (l_new->
prev->
v == v_fan) {
5608 l_fan = l_new->
prev;
5615 if (l_fan->
v == v_fan) {
5617 else if (l_fan->
next->
v == v_fan) {
5618 l_fan = l_fan->
next;
5620 else if (l_fan->
prev->
v == v_fan) {
5621 l_fan = l_fan->
prev;
5659 for (
int k = 1; k < ns; k++) {
5666 for (
int k = 1; k < ns; k++) {
5674 for (
int k = 0; k < ns; k++) {
5698 sizeof(
NewVert) * n * (ns2 + 1) * (ns + 1));
5708 int i = bndv->
index;
5714 if (weld && bndv->
ebev) {
5735 int i = bndv->
index;
5740 for (
int k = 1; k < ns; k++) {
5749 else if (n == 2 && !bndv->
ebev) {
5761 for (
int k = 1; k < ns; k++) {
5784 for (
int k = 1; k < ns; k++) {
5823 if (
e->fprev &&
e->fnext) {
5831 #define BM_BEVEL_EDGE_TAG_ENABLE(bme) BM_ELEM_API_FLAG_ENABLE((bme), _FLAG_OVERLAP)
5832 #define BM_BEVEL_EDGE_TAG_DISABLE(bme) BM_ELEM_API_FLAG_DISABLE((bme), _FLAG_OVERLAP)
5833 #define BM_BEVEL_EDGE_TAG_TEST(bme) BM_ELEM_API_FLAG_TEST((bme), _FLAG_OVERLAP)
5865 for (
int sucindex = 0; sucindex < nsucs; sucindex++) {
5866 BMEdge *nextbme = sucs[sucindex];
5870 bv->
edges[j + 1].
e = nextbme;
5877 for (
int k = j + 1; k <= bestj; k++) {
5882 for (
int k = j + 1; k <= tryj; k++) {
5891 for (
int k = j + 1; k <= bestj; k++) {
5893 bv->
edges[k].
e = save_path[k - (j + 1)];
5908 #ifdef FASTER_FASTORDER
5917 for (
int j = 1; j < bv->
edgecount; j++) {
5927 if (bmenext ==
NULL) {
5932 if (nsucs == 0 || (nsucs == 2 && j != 1) || nsucs > 2 ||
5934 for (
int k = 1; k < j; k++) {
5940 bv->
edges[j].
e = bmenext;
5958 for (
int i = 1; i < ntot; i++) {
5960 int num_shared_face = 0;
5974 if (first_suc ==
NULL) {
5979 if (num_shared_face >= 3) {
5983 if (num_shared_face == 1 || (i == 1 && num_shared_face == 2)) {
5985 e->
e = bme = first_suc;
5989 for (
int k = 1; k < i; k++) {
6008 bv->
edges[i].
e = first_bme;
6036 for (
int i = 0; i < ntot; i++) {
6054 if (!bestf ||
l->
v == bv->
v) {
6059 e->fnext = e2->
fprev = bestf;
6092 if (face_count == 1) {
6140 for (
int i = 0; i < tot_edges; i++) {
6151 e->is_rev = (bme->
v2 ==
v);
6152 e->leftv =
e->rightv =
NULL;
6153 e->profile_index = 0;
6163 if (tot_edges > 1) {
6164 int ccw_test_sum = 0;
6165 for (
int i = 0; i < tot_edges; i++) {
6169 if (ccw_test_sum < 0) {
6170 for (
int i = 0; i <= (tot_edges / 2) - 1; i++) {
6175 if (tot_edges % 2 == 1) {
6176 int i = tot_edges / 2;
6183 float vert_axis[3] = {0, 0, 0};
6198 for (
int i = 0; i < tot_edges; i++,
e++) {
6209 for (
int i = 0; i < tot_edges; i++,
e++) {
6210 e->next = &bv->
edges[(i + 1) % tot_edges];
6211 e->prev = &bv->
edges[(i + tot_edges - 1) % tot_edges];
6220 e->offset_l_spec = bp->
offset;
6226 e->offset_l_spec = 0.01f * bp->
offset;
6236 e->offset_l_spec = 0.01f * bp->
offset;
6257 e->offset_l_spec = bp->
offset;
6258 e->offset_r_spec = bp->
offset;
6263 e->offset_l_spec = bp->
offset;
6268 e->offset_r_spec =
e->offset_l_spec;
6272 e->offset_l_spec *= weight;
6273 e->offset_r_spec *= weight;
6282 e->offset_l_spec = bv->
offset;
6290 e->offset_l_spec = 0.01f * bp->
offset;
6302 e->offset_l_spec = 0.01f * bp->
offset;
6314 e->offset_l_spec = bv->
offset;
6318 e->offset_r_spec =
e->offset_l_spec;
6321 e->offset_l_spec =
e->offset_r_spec = 0.0f;
6323 e->offset_l =
e->offset_l_spec;
6324 e->offset_r =
e->offset_r_spec;
6326 if (
e->fprev &&
e->fnext) {
6335 if (tot_wire != 0) {
6352 bool do_rebuild =
false;
6375 if (
e->prev == eprev) {
6376 if (eprev->
prev ==
e) {
6378 go_ccw = (
e->fnext != f);
6384 else if (eprev->
prev ==
e) {
6399 bool on_profile_start =
false;
6405 if (
e->profile_index > 0) {
6406 vstart = vstart->
prev;
6407 on_profile_start =
true;
6411 vstart = eprev->
leftv;
6414 vstart = vstart->
next;
6415 on_profile_start =
true;
6420 if (!on_profile_start) {
6426 bool corner3special = (vm->
mesh_kind == M_NONE &&
v->ebev !=
e &&
v->ebev != eprev);
6430 if (on_profile_start) {
6431 kstart =
e->profile_index;
6432 on_profile_start =
false;
6443 for (
int k = kstart; k <= kend; k++) {
6448 if (corner3special &&
v->ebev && !bv->
any_seam && k != vm->
seg) {
6457 int i =
v->prev->index;
6459 if (on_profile_start) {
6461 on_profile_start =
false;
6464 kstart = vm->
seg - 1;
6466 if (
e->rightv ==
v->prev &&
e->profile_index > 0) {
6467 kend =
e->profile_index;
6472 for (
int k = kstart; k >= kend; k--) {
6477 if (corner3special &&
v->ebev && !bv->
any_seam && k != 0) {
6502 BMEdge *bme_prev = ee[n - 1];
6503 for (
int k = 0; k < n; k++) {
6506 if (ee[k] != bme_new) {
6510 if (k < n - 1 && ee[k] == ee[k + 1]) {
6561 int faces_len, f_index;
6566 for (f_index = 0; f_index < faces_len; f_index++) {
6587 for (
int i = 0; i < bv->
wirecount; i++) {
6591 float dclosest = FLT_MAX;
6597 if (!bvother || !bvother->
vmesh) {
6608 vclosest = bndv->
nv.
v;
6609 votherclosest = bndvother->
nv.
v;
6617 vclosest = bndv->
nv.
v;
6618 votherclosest = vother;
6634 int i =
e->leftv->index;
6635 for (
int k = 1; k < nseg; k++) {
6674 for (
int i = 0; i < 4; i++) {
6675 if (&bv->
edges[i] ==
e) {
6676 bme_prev = bv->
edges[(i + 3) % 4].
e;
6677 bme_next = bv->
edges[(i + 1) % 4].
e;
6690 for (
int i = 0; i < nseg; i++) {
6698 if (enable_smooth) {
6760 for (
int k = 1; k <= nseg; k++) {
6764 if (odd && k == mid + 1) {
6765 BMFace *fchoices[2] = {f1, f2};
6772 if (f_choice == f1) {
6773 edges[0] = edges[1] =
NULL;
6774 edges[2] = edges[3] = bme;
6777 edges[0] = edges[1] = bme;
6778 edges[2] = edges[3] =
NULL;
6787 else if (!odd && k == mid) {
6794 else if (!odd && k == mid + 1) {
6801 BMFace *f = (k <= mid) ? f1 : f2;
6857 const double tol = 1
e-13;
6858 const int maxiter = 10;
6861 double xmin = x0 +
M_SQRT2 / 2.0 * dtarget;
6865 double xmax = x0 + dtarget;
6873 double dmaxerr =
sqrt(
pow((xmax - x0), 2) +
pow((ymax - y0), 2)) - dtarget;
6874 double dminerr =
sqrt(
pow((xmin - x0), 2) +
pow((ymin - y0), 2)) - dtarget;
6876 double xnew = xmax - dmaxerr * (xmax - xmin) / (dmaxerr - dminerr);
6877 bool lastupdated_upper =
true;
6879 for (
int iter = 0; iter < maxiter; iter++) {
6881 double dnewerr =
sqrt(
pow((xnew - x0), 2) +
pow((ynew - y0), 2)) - dtarget;
6882 if (
fabs(dnewerr) < tol) {
6889 if (!lastupdated_upper) {
6890 xnew = (dmaxerr / 2 * xmin - dminerr * xmax) / (dmaxerr / 2 - dminerr);
6893 xnew = xmax - dmaxerr * (xmax - xmin) / (dmaxerr - dminerr);
6895 lastupdated_upper =
false;
6901 if (lastupdated_upper) {
6902 xnew = (dmaxerr * xmin - dminerr / 2 * xmax) / (dmaxerr - dminerr / 2);
6905 xnew = xmax - dmaxerr * (xmax - xmin) / (dmaxerr - dminerr);
6907 lastupdated_upper =
true;
6924 const int smoothitermax = 10;
6925 const double error_tol = 1
e-7;
6926 int imax = (seg + 1) / 2 - 1;
6928 bool seg_odd = seg % 2;
6934 mx =
pow(0.5, 1.0 /
r);
6938 mx = 1 -
pow(0.5, 1.0 /
r);
6942 for (
int i = 0; i <= imax; i++) {
6943 xvals[i] = i * mx / seg * 2;
6949 for (
int iter = 0; iter < smoothitermax; iter++) {
6956 for (
int i = 0; i < imax; i++) {
6957 double d =
sqrt(
pow((xvals[i + 1] - xvals[i]), 2) +
pow((yvals[i + 1] - yvals[i]), 2));
6969 sum +=
M_SQRT2 / 2 * (yvals[imax] - xvals[imax]);
6970 davg =
sum / (imax + 0.5);
6973 sum +=
sqrt(
pow((xvals[imax] - mx), 2) +
pow((yvals[imax] - mx), 2));
6974 davg =
sum / (imax + 1.0);
6977 bool precision_reached =
true;
6978 if (dmax - davg > error_tol) {
6979 precision_reached =
false;
6981 if (dmin - davg < error_tol) {
6982 precision_reached =
false;
6984 if (precision_reached) {
6989 for (
int i = 1; i <= imax; i++) {
6997 xvals[imax + 1] = mx;
6998 yvals[imax + 1] = mx;
7000 for (
int i = imax + 1; i <= seg; i++) {
7001 yvals[i] = xvals[seg - i];
7002 xvals[i] = yvals[seg - i];
7006 for (
int i = 0; i <= seg; i++) {
7007 double temp = xvals[i];
7008 xvals[i] = 1.0 - yvals[i];
7009 yvals[i] = 1.0 - temp;
7024 bool seg_odd = n % 2;
7030 for (
int i = 0; i <= n; i++) {
7031 xvals[i] = (
double)i / n;
7032 yvals[i] = 1.0 - (
double)i / n;
7037 double temp = (
M_PI / 2) / n;
7039 for (
int i = 0; i <= n; i++) {
7040 xvals[i] =
sin(i * temp);
7041 yvals[i] =
cos(i * temp);
7048 for (
int i = 0; i <= n2; i++) {
7050 yvals[i] = 1.0 - (
double)i / n2;
7051 xvals[n - i] = yvals[i];
7052 yvals[n - i] = xvals[i];
7057 double temp = 1.0 / (n2 +
M_SQRT2 / 2.0);
7058 for (
int i = 0; i <= n2; i++) {
7060 yvals[i] = 1.0 - (
double)i * temp;
7061 xvals[n - i] = yvals[i];
7062 yvals[n - i] = xvals[i];
7070 for (
int i = 0; i <= n2; i++) {
7071 xvals[i] = (
double)i / n2;
7073 xvals[n - i] = yvals[i];
7074 yvals[n - i] = xvals[i];
7079 double temp = 1.0 / (n2 +
M_SQRT2 / 2);
7080 for (
int i = 0; i <= n2; i++) {
7081 xvals[i] = (
double)i * temp;
7083 xvals[n - i] = yvals[i];
7084 yvals[n - i] = xvals[i];
7103 #define CIRCLE_FULLNESS_SEGS 11
7122 for (
int i = 0; i < nseg; i++) {
7133 fullness = circle_fullness[nseg - 1];
7137 if (nseg % 2 == 0) {
7138 fullness = 2.4506f * bp->
profile - 0.00000300f * nseg - 0.6266f;
7141 fullness = 2.3635f * bp->
profile + 0.000152f * nseg - 0.6060f;
7169 pro_spacing->
seg_2 = 0;
7183 sizeof(
double) * (seg_2 + 1));
7185 sizeof(
double) * (seg_2 + 1));
7191 for (
int i = 0; i < seg_2 + 1; i++) {
7212 for (
int i = 0; i < seg + 1; i++) {
7247 float no_collide_offset = bp->
offset + 1e6;
7248 float limit = no_collide_offset;
7249 if (bp->
offset == 0.0f) {
7250 return no_collide_offset;
7277 return bp->
offset > blen / 2.0f ? blen / 2.0f : blen;
7279 return no_collide_offset;
7281 if (ebother !=
NULL) {
7293 return no_collide_offset;
7297 return no_collide_offset;
7299 if (lb->
next->
v == vc) {
7302 else if (lb->
v == vc) {
7306 return no_collide_offset;
7309 if (ea->
e == eb->
e || (ec && ec->
e == eb->
e)) {
7310 return no_collide_offset;
7321 float sin1 =
sinf(th1);
7322 float sin2 =
sinf(th2);
7323 if ((ka > 0.0f) + (kb > 0.0f) + (kc > 0.0f) >= 2) {
7324 float tan1 =
tanf(th1);
7325 float tan2 =
tanf(th2);
7326 float g = tan1 * tan2;
7327 float h = sin1 * sin2;
7328 float den = g * (ka * sin2 + kc * sin1) + kb * h * (tan1 + tan2);
7339 if (kb > 0.0f && ka == 0.0f ) {
7342 if (
t >= 0.0f &&
t < limit) {
7346 if (kb > 0.0f && kc == 0.0f ) {
7349 if (
t >= 0.0f &&
t < limit) {
7363 float no_collide_offset = bp->
offset + 1e6;
7364 float limit = no_collide_offset;
7365 if (bp->
offset == 0.0f) {
7366 return no_collide_offset;
7371 float kab = ka + kb;
7374 return no_collide_offset;
7387 float limited_offset = bp->
offset;
7398 for (
int i = 0; i < bv->
edgecount; i++) {
7402 if (collision_offset < limited_offset) {
7403 limited_offset = collision_offset;
7408 if (collision_offset < limited_offset) {
7409 limited_offset = collision_offset;
7415 if (limited_offset < bp->offset) {
7421 float offset_factor = limited_offset / bp->
offset;
7430 for (
int i = 0; i < bv->
edgecount; i++) {
7438 bp->
offset = limited_offset;
7456 const int offset_type,
7457 const int profile_type,
7459 const float profile,
7460 const bool affect_type,
7461 const bool use_weights,
7462 const bool limit_offset,
7464 const int vertex_group,
7466 const bool loop_slide,
7467 const bool mark_seam,
7468 const bool mark_sharp,
7469 const bool harden_normals,
7470 const int face_strength_mode,
7471 const int miter_outer,
7472 const int miter_inner,
7474 const float smoothresh,
7476 const int vmesh_method)
7487 .offset_type = offset_type,
7488 .seg =
max_ii(segments, 1),
7491 .affect_type = affect_type,
7492 .use_weights = use_weights,
7493 .loop_slide = loop_slide,
7494 .limit_offset = limit_offset,
7498 .vertex_group = vertex_group,
7500 .mark_seam = mark_seam,
7501 .mark_sharp = mark_sharp,
7502 .harden_normals = harden_normals,
7503 .face_strength_mode = face_strength_mode,
7504 .miter_outer = miter_outer,
7505 .miter_inner = miter_inner,
7507 .smoothresh = smoothresh,
7509 .profile_type = profile_type,
7510 .custom_profile = custom_profile,
7511 .vmesh_method = vmesh_method,
7518 #ifdef BEVEL_DEBUG_TIME
7528 if (profile >= 0.950f) {
7569 if (!limit_offset && bv) {
7685 #ifdef BEVEL_DEBUG_TIME
7687 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)
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)
void * BLI_ghash_lookup(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
MINLINE float max_ff(float a, float b)
MINLINE int power_of_2_max_i(int n)
MINLINE int compare_ff(float a, float b, const float max_diff)
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)
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 area_poly_v3(const float verts[][3], unsigned int nr)
void closest_to_plane_normalized_v3(float r_close[3], const float plane[4], const float pt[3])
void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[3])
void closest_to_line_segment_v3(float r_close[3], const float p[3], const float l1[3], const float l2[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
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])
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])
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
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 bool compare_v3v3(const float a[3], const float b[3], const float limit) ATTR_WARN_UNUSED_RESULT
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
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)
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)
struct MemArena * BLI_memarena_new(const size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) ATTR_MALLOC
#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 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 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)
Platform independent time functions.
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 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 BMFace * bev_create_ngon(BMesh *bm, BMVert **vert_arr, const int totv, BMFace **face_arr, BMFace *facerep, BMEdge **edge_arr, int mat_nr, bool do_interp)
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 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 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 BMFace * bev_create_quad_ex(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4, BMFace *f1, BMFace *f2, BMFace *f3, BMFace *f4, BMEdge *e1, BMEdge *e2, BMEdge *e3, BMEdge *e4, BMFace *frep, int mat_nr)
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 float interp_poly_area(BevVert *bv, BMFace *frep)
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 BMFace * bev_create_quad(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4, BMFace *f1, BMFace *f2, BMFace *f3, BMFace *f4, int mat_nr)
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 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 float snap_face_dist_squared(float *co, BMFace *f, BMEdge **r_snap_e, float *r_snap_co)
#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_lnorspace_update(BMesh *bm)
void BM_mesh_normals_update(BMesh *bm)
BMesh Compute Normals.
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
void BM_edges_sharp_from_angle_set(BMesh *bm, const float split_angle)
BLI_INLINE BMFace * BM_face_at_index(BMesh *bm, const int index)
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])
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)
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.
bool closest(btVector3 &v)
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 float frac(float x, int *ix)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
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])
vector snap(vector a, vector b)
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::@162 mesh_kind
double PIL_check_seconds_timer(void)
__forceinline avxf cross(const avxf &a, const avxf &b)
ccl_device_inline float beta(float x, float y)
ccl_device_inline float2 fabs(const float2 &a)