1 ;;;; cl-vectors -- Rasterizer and paths manipulation library
2 ;;;; Copyright (C) 2007 Frédéric Jolliton <frederic@jolliton.com>
4 ;;;; This library is free software; you can redistribute it and/or
5 ;;;; modify it under the terms of the Lisp Lesser GNU Public License
6 ;;;; (http://opensource.franz.com/preamble.html), known as the LLGPL.
8 ;;;; This library is distributed in the hope that it will be useful, but
9 ;;;; WITHOUT ANY WARRANTY; without even the implied warranty of
10 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lisp
11 ;;;; Lesser GNU Public License for more details.
13 (defpackage #:net.tuxee.vectors
14 (:use
#:cl
#:net.tuxee.aa
#:net.tuxee.paths
)
15 (:nicknames
#:vectors
)
16 (:export
#:update-state
))
18 (in-package #:net.tuxee.vectors
)
20 (defun update-state (state paths
)
21 (dolist (path (if (listp paths
) paths
(list paths
)))
22 (let ((iterator (path-iterator-segmented path
)))
23 (multiple-value-bind (i1 k1 e1
) (path-iterator-next iterator
)
25 (when (and k1
(not e1
))
27 (let ((first-knot k1
))
29 (multiple-value-bind (i2 k2 e2
) (path-iterator-next iterator
)
32 (point-x k1
) (point-y k1
)
33 (point-x k2
) (point-y k2
))
38 (point-x k1
) (point-y k1
)
39 (point-x first-knot
) (point-y first-knot
)))))))