diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-09-23 10:26:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-09-23 10:26:48 +0400 |
commit | bcba8003c01d50ffb524092b08026441bbbe4f85 (patch) | |
tree | ee8f67293fe9fbe9fda623c46ba5f8739a37ae1c /source/blender/blenkernel/BKE_curve.h | |
parent | d2d56e30589caf5bf14f39f21c6a0321e0c01d65 (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/BKE_curve.h')
-rw-r--r-- | source/blender/blenkernel/BKE_curve.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h index 45d8193b16f..006e3ac1e79 100644 --- a/source/blender/blenkernel/BKE_curve.h +++ b/source/blender/blenkernel/BKE_curve.h @@ -39,9 +39,12 @@ struct ListBase; struct BezTriple; struct BevList; -#define KNOTSU(nu) ( (nu)->orderu+ (nu)->pntsu+ (nu->orderu-1)*((nu)->flagu & CU_CYCLIC) ) -#define KNOTSV(nu) ( (nu)->orderv+ (nu)->pntsv+ (nu->orderv-1)*((nu)->flagv & CU_CYCLIC) ) +#define KNOTSU(nu) ( (nu)->orderu+ (nu)->pntsu+ (((nu)->flagu & CU_CYCLIC) ? (nu->orderu-1) : 0) ) +#define KNOTSV(nu) ( (nu)->orderv+ (nu)->pntsv+ (((nu)->flagv & CU_CYCLIC) ? (nu->orderv-1) : 0) ) +/* Non cyclic nurbs have 1 less segment */ +#define SEGMENTSU(nu) ( ((nu)->flagu & CU_CYCLIC) ? (nu)->pntsu : (nu)->pntsu-1 ) +#define SEGMENTSV(nu) ( ((nu)->flagv & CU_CYCLIC) ? (nu)->pntsv : (nu)->pntsv-1 ) void unlink_curve( struct Curve *cu); void free_curve( struct Curve *cu); |