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:
authorCampbell Barton <ideasman42@gmail.com>2008-09-23 10:26:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-09-23 10:26:48 +0400
commitbcba8003c01d50ffb524092b08026441bbbe4f85 (patch)
treeee8f67293fe9fbe9fda623c46ba5f8739a37ae1c /source/blender/blenkernel/intern/curve.c
parentd2d56e30589caf5bf14f39f21c6a0321e0c01d65 (diff)
changing the number of subdivisions for nurbs curves.
this way each edge/segment gets the same number of points matching the resolution value. before, a nurbs curve would have the same number of points no matter if it was cyclic or not. This will make slight changes to objects on an animated path, but only noticable if the path has a low resolution. bug [#11744] NurbCurve Radius incorrect - now dosnt show bad results with order 4 on non-cyclic curve.
Diffstat (limited to 'source/blender/blenkernel/intern/curve.c')
-rw-r--r--source/blender/blenkernel/intern/curve.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index c5ad9e58a4c..49d25b0652d 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -825,8 +825,8 @@ void makeNurbcurve(Nurb *nu, float *data, int resolu, int dim)
len= nu->pntsu;
if(len==0) return;
sum= (float *)MEM_callocN(sizeof(float)*len, "makeNurbcurve1");
-
- resolu*= nu->pntsu;
+
+ resolu= (resolu*SEGMENTSU(nu))+1;
if(resolu==0) {
MEM_freeN(sum);
return;
@@ -836,7 +836,7 @@ void makeNurbcurve(Nurb *nu, float *data, int resolu, int dim)
ustart= fp[nu->orderu-1];
if(nu->flagu & CU_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
else uend= fp[nu->pntsu];
- ustep= (uend-ustart)/(resolu-1+(nu->flagu & CU_CYCLIC));
+ ustep= (uend-ustart)/(resolu-1);
basisu= (float *)MEM_mallocN(sizeof(float)*KNOTSU(nu), "makeNurbcurve3");
if(nu->flagu & CU_CYCLIC) cycl= nu->orderu-1;
@@ -1620,7 +1620,7 @@ void makeBevelList(Object *ob)
}
else if((nu->type & 7)==CU_NURBS) {
if(nu->pntsv==1) {
- len= resolu*nu->pntsu;
+ len= (resolu*SEGMENTSU(nu))+1;
bl= MEM_mallocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList3");
BLI_addtail(&(cu->bev), bl);
bl->nr= len;