generative-toolbelt.path
A set of functions to create, manage, and draw Paths.
Paths are lists of Points like this: ({:x 100 :y 100} {:x 200 :y 100} {:x 300 :y 100} {:x 300 :y 200} ).
chaikin-path
(chaikin-path path iteration chaikParam)
Approximate a Path with the chaikin subdivision alorithm, smoothing the original Path.
`iteration` defines the desired iterations number.
`chaikparam` defines the chaikin parameter to use.
A single number will define a fixed parameter through all iterations, a list of two point will define a range in which a random value will be extracted for each iteration.
Returns a new Path.
chaikin-segment
(chaikin-segment pointA pointB segmentationPoint)
Subfunction of `generative-toolbelt.path/chaikinSubdivision.
Takes two Points and a chaikparam.
Returns a list of two interpolated points.
dispose-fixed-path
(dispose-fixed-path p noiseX noiseY)
Add random noise to all the inner path's points, keeping the first and last point stable.
`noiseX` and `noiseY` defines the aomplitude of the gaussian to generate the noise with.
dispose-path
(dispose-path p noiseX noiseY)
Add random noise to ALL Path's points.
`noiseX` and `noiseY` defines the aomplitude of the gaussian to generate the noise with.
draw-path
(draw-path pointList & [drawOptions])
Draw a Path with both fill and stroke options.
draw-path-fill
(draw-path-fill pointList & [drawOptions])
Draw a Path with only the fill option
draw-path-stroke
(draw-path-stroke pointList & [drawOptions])
Draw a Path with only the stroke operation
line-to-path
(line-to-path line sectionCount)
Convert a Line structure to a Path object
`sectionCount` define how many point the path is made of.