Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Luís Oliveira
cl-vectors
Commits
3cdc5c7d
Commit
3cdc5c7d
authored
May 20, 2007
by
Frédéric Jolliton
Browse files
Added paths:path-transform-as-marker.
parent
6b7dc4c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
paths-package.lisp
View file @
3cdc5c7d
...
...
@@ -40,6 +40,7 @@
#:path-translate
#:path-rotate
#:path-scale
#:path-transform-as-marker
;; Interpolators
#:make-straight-line
#:make-arc
...
...
paths.lisp
View file @
3cdc5c7d
...
...
@@ -550,6 +550,34 @@ support non uniform scaling (when scale-x /= scale-y)."
(
path-reverse
path
))))
path
)
(
defun
path-end-info
(
path
side
)
(
when
(
>=
(
path-size
path
)
2
)
(
if
(
not
side
)
(
values
(
aref
(
path-knots
path
)
0
)
(
interpolation-normal
(
aref
(
path-interpolations
path
)
1
)
(
aref
(
path-knots
path
)
0
)
(
aref
(
path-knots
path
)
1
)
nil
))
(
let
((
ks
(
length
(
path-knots
path
)))
(
is
(
length
(
path-interpolations
path
))))
(
values
(
aref
(
path-knots
path
)
(
1-
ks
))
(
interpolation-normal
(
aref
(
path-interpolations
path
)
(
1-
is
))
(
aref
(
path-knots
path
)
(
-
is
2
))
(
aref
(
path-knots
path
)
(
-
is
1
))
t
))))))
(
defun
path-transform-as-marker
(
path
path-reference
side
&key
(
offset
0.0
)
(
scale
1.0
)
(
angle
0.0
))
"Translate, rotate and scale PATH representing a marker such
that it is adapted to the PATH-REFERENCE. If SIDE is false, it is
placed at the start of the path, otherwise it is placed at the
end of the path."
(
multiple-value-bind
(
knot
normal
)
(
path-end-info
path-reference
side
)
(
when
knot
(
path-rotate
path
(
+
(
/
pi
-2
)
angle
(
point-angle
normal
)))
(
path-scale
path
scale
scale
)
(
path-translate
path
(
p+
knot
(
p*
normal
offset
)))
path
)))
;;;--[ Interpolations ]------------------------------------------------------
(
defgeneric
interpolation-segment
(
interpolation
k1
k2
function
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment