Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurynas Duburas <laurynas>2022-03-11 03:34:27 +0300
committerHans Goudey <h.goudey@me.com>2022-03-11 03:34:27 +0300
commit0602852860dda7dfc0ea20c72e03b7f96c981f1a (patch)
treef6679aba0cfdfcda8e0e244549eb739e025953e0 /source/blender/editors/curve
parent27fb63381e9b0963976237c58ca2cfc9bc5ddfd8 (diff)
Curve: Improve NURBS knot generation modes
This patch enables all 8 combinations of Nurbs modes: Cyclic, Bezier and Endpoint. Also removes restriction on Bezier Nurbs order. The most significant changes are mode combinations bringing new meaning. In D13891 is a scheme showing NURBS with same control points in a modes, and also further description of each possible case. Differential Revision: https://developer.blender.org/D13891
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editcurve.c2
-rw-r--r--source/blender/editors/curve/editcurve_add.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index ba9502b80bf..f992309ed00 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -4958,7 +4958,7 @@ bool ed_editnurb_spin(
/* 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;
+ nu->flagv |= CU_NURB_CYCLIC | CU_NURB_BEZIER | CU_NURB_ENDPOINT;
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 d7201495f75..ba5a7409ba7 100644
--- a/source/blender/editors/curve/editcurve_add.c
+++ b/source/blender/editors/curve/editcurve_add.c
@@ -292,7 +292,7 @@ Nurb *ED_curve_add_nurbs_primitive(
nu->pntsv = 1;
nu->orderu = 3;
nu->bp = (BPoint *)MEM_callocN(sizeof(BPoint) * nu->pntsu, "addNurbprim6");
- nu->flagu = CU_NURB_CYCLIC | CU_NURB_BEZIER;
+ nu->flagu = CU_NURB_CYCLIC | CU_NURB_BEZIER | CU_NURB_ENDPOINT;
bp = nu->bp;
for (a = 0; a < 8; a++) {
@@ -407,7 +407,7 @@ Nurb *ED_curve_add_nurbs_primitive(
mul_m4_v3(mat, bp->vec);
bp++;
}
- nu->flagu = CU_NURB_BEZIER;
+ nu->flagu = CU_NURB_BEZIER | CU_NURB_ENDPOINT;
BKE_nurb_knot_calc_u(nu);
BLI_addtail(editnurb, nu); /* temporal for spin */