Liking cljdoc? Tell your friends :D

some.polyline

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]]
```
raw docstring

clampclj/s

(clamp n lower upper)
source

lengthclj/s

(length polyline)

Returns the length of a polyline.

Returns the length of a polyline.
sourceraw docstring

lengthsclj/s

(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.
sourceraw docstring

lerpclj/s

(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).
sourceraw docstring

normalsclj/s

(normals polyline)

Returns the normals of each vertex in the polyline.

Returns the normals of each vertex in the polyline.
sourceraw docstring

resample-by-countclj/s

(resample-by-count polyline n)

Resamples the polyline evenly

Resamples the polyline evenly
sourceraw docstring

resample-by-lengthclj/s

(resample-by-length polyline len)

Resamples the polyline by a length

Resamples the polyline by a length
sourceraw docstring

scaleclj/s

(scale n start1 stop1 start2 stop2)

scales a number to a new range

scales a number to a new range
sourceraw docstring

smoothclj/s

(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.
sourceraw docstring

within-rangeclj/s

(within-range range num)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close