aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/grid-geometry.lisp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/grid-geometry.lisp b/src/grid-geometry.lisp
index b23b207..c046032 100644
--- a/src/grid-geometry.lisp
+++ b/src/grid-geometry.lisp
@@ -102,9 +102,19 @@ top right corners of the bounding box for POLY "
(defmacro with-grid-bezier
- ((x y) (control-pts &key (step 0.001)) &body body)
- (with-gensyms (fn points a)
- `(let* ((,points
+ ((x y) (control-pts &key (count 1000)) &body body)
+ "CONTROL-POINTS is an expression that evalueates to a list of (X Y)
+pairs, these are the control points for the curve.. COUNT is the
+number of points on the bezier curve that will be calclated. The first
+point is always the first control point and the last point is always
+the last control point. Use high counts for smooth curves, as needed.
+
+Evaluates the BODY with X Y bound to a point on the bezier curve.
+"
+ (with-gensyms (fn points a step)
+ `(let* ((,step
+ (/ 1.0 ,count))
+ (,points
,control-pts)
(,fn
(apply #'bezier-lambda ,points)))