aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/grid-geometry.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/grid-geometry.lisp')
-rw-r--r--src/grid-geometry.lisp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/grid-geometry.lisp b/src/grid-geometry.lisp
index 218cdf2..b23b207 100644
--- a/src/grid-geometry.lisp
+++ b/src/grid-geometry.lisp
@@ -99,3 +99,15 @@ top right corners of the bounding box for POLY "
(loop for ,y from (- ,sy ,rad) to (+ ,sy ,rad) do
(when (,comparator ,rad (round (euclidean-dist ,x ,y ,sx ,sy)))
,@body)))))))
+
+
+(defmacro with-grid-bezier
+ ((x y) (control-pts &key (step 0.001)) &body body)
+ (with-gensyms (fn points a)
+ `(let* ((,points
+ ,control-pts)
+ (,fn
+ (apply #'bezier-lambda ,points)))
+ (loop for ,a from 0.0 to 1.0 by ,step
+ for (,x ,y) = (mapcar #'round (funcall ,fn ,a))
+ do ,@body))))