Helper functions for dealing with 2D polylines. A polyline is just a vector of 2D (x y) vectors.
Example: A polyline with 4 vertices.
[[0 0][0 1][0 2][0 3]]
Helper functions for dealing with 2D polylines. A polyline is just a vector of 2D (x y) vectors. **Example:** A polyline with 4 vertices. ```clojure [[0 0][0 1][0 2][0 3]] ```
(length polyline)
Returns the length of a polyline.
Returns the length of a polyline.
(lengths polyline)
Returns the lengths between each vertex of a polyline. The size of the output is N-1.
Returns the lengths between each vertex of a polyline. The size of the output is N-1.
(lerp polyline t)
Returns a point on the polyline at t (float between 0-1).
Returns a point on the polyline at t (float between 0-1).
(normals polyline)
Returns the normals of each vertex in the polyline.
Returns the normals of each vertex in the polyline.
(resample-by-count polyline n)
Resamples the polyline evenly
Resamples the polyline evenly
(resample-by-length polyline len)
Resamples the polyline by a length
Resamples the polyline by a length
(scale n start1 stop1 start2 stop2)
scales a number to a new range
scales a number to a new range
(smooth polyline size & closed)
Returns a smoothed polyline. The size indicates how many verices to the left and right of each vertex to take when smoothing. This is a basic rolling average of a line. Optional third argument indicates if line is wrapped.
Returns a smoothed polyline. The size indicates how many verices to the left and right of each vertex to take when smoothing. This is a basic rolling average of a line. Optional third argument indicates if line is wrapped.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close