diff options
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 11 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve_add.c | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index a034e4bb10e..a70bc1c0350 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4953,19 +4953,22 @@ bool ed_editnurb_spin( if ((a & 1) == 0) { rotateflagNurb(editnurb, SELECT, cent, scalemat1); - weightflagNurb(editnurb, SELECT, 0.25 * M_SQRT2); + weightflagNurb(editnurb, SELECT, 0.5 * M_SQRT2); } else { rotateflagNurb(editnurb, SELECT, cent, scalemat2); - weightflagNurb(editnurb, SELECT, 4.0 / M_SQRT2); + weightflagNurb(editnurb, SELECT, 2.0 / M_SQRT2); } } if (ok) { LISTBASE_FOREACH (Nurb *, nu, editnurb) { if (ED_curve_nurb_select_check(v3d, nu)) { - nu->orderv = 4; - nu->flagv |= CU_NURB_CYCLIC; + nu->orderv = 3; + /* It is challenging to create a good approximation of a circle with uniform knots vector + * (which is forced in Blender for cyclic NURBS curves). Here a NURBS circle is constructed + * by connecting four Bezier arcs. */ + nu->flagv |= CU_NURB_CYCLIC | CU_NURB_BEZIER; BKE_nurb_knot_calc_v(nu); } } diff --git a/source/blender/editors/curve/editcurve_add.c b/source/blender/editors/curve/editcurve_add.c index 614805a70f5..daef4a21692 100644 --- a/source/blender/editors/curve/editcurve_add.c +++ b/source/blender/editors/curve/editcurve_add.c @@ -306,9 +306,9 @@ Nurb *ED_curve_add_nurbs_primitive( else if (cutype == CU_NURBS) { /* nurb */ nu->pntsu = 8; nu->pntsv = 1; - nu->orderu = 4; + nu->orderu = 3; nu->bp = (BPoint *)MEM_callocN(sizeof(BPoint) * nu->pntsu, "addNurbprim6"); - nu->flagu = CU_NURB_CYCLIC; + nu->flagu = CU_NURB_CYCLIC | CU_NURB_BEZIER; bp = nu->bp; for (a = 0; a < 8; a++) { @@ -322,7 +322,7 @@ Nurb *ED_curve_add_nurbs_primitive( bp->vec[2] += 0.25f * nurbcircle[a][1] * grid; } if (a & 1) { - bp->vec[3] = 0.25 * M_SQRT2; + bp->vec[3] = 0.5 * M_SQRT2; } else { bp->vec[3] = 1.0; |