Liking cljdoc? Tell your friends :D

patterning.library.std


arcclj/s

(arc radius start-angle offset)
(arc radius start-angle offset second-arg)
(arc radius start-angle offset resolution style)
(arc radius start-angle offset resolution style cx cy)

Creates an arc (fraction of a circle). radius: radius of the arc start-angle: starting angle in radians offset: angular span of the arc in radians (can be negative to go backwards) resolution: number of points in the arc (default: 30) style: optional style map (default: {:stroke (p-color 0) :stroke-weight 1}) cx: center X coordinate (default: 0) cy: center Y coordinate (default: 0)

Supports multiple arities: (arc radius start-angle offset) - uses default resolution (30) and default style (arc radius start-angle offset resolution) - explicit resolution, default style (arc radius start-angle offset resolution style) - all parameters (arc radius start-angle offset style) - if 4th arg is a map, it's style, resolution defaults to 30

Creates an arc (fraction of a circle).
radius: radius of the arc
start-angle: starting angle in radians
offset: angular span of the arc in radians (can be negative to go backwards)
resolution: number of points in the arc (default: 30)
style: optional style map (default: {:stroke (p-color 0) :stroke-weight 1})
cx: center X coordinate (default: 0)
cy: center Y coordinate (default: 0)

Supports multiple arities:
(arc radius start-angle offset) - uses default resolution (30) and default style
(arc radius start-angle offset resolution) - explicit resolution, default style
(arc radius start-angle offset resolution style) - all parameters
(arc radius start-angle offset style) - if 4th arg is a map, it's style, resolution defaults to 30
sourceraw docstring

bez-curveclj/s

(bez-curve points)
(bez-curve points style)
source

centered-rectclj/s

(centered-rect cx cy w h style)
source

clockclj/s

(clock time-map style)
source

clock-faceclj/s

(clock-face style)
source

clock-handsclj/s

(clock-hands time-map)
source

crossclj/s

(cross color x y)

A cross, can only be made as a pattern (because sshapes are continuous lines) which is why we only define it now

A cross, can only be made as a pattern (because sshapes are continuous lines) which is why we only define it now
sourceraw docstring

diamondclj/s

source

drunk-lineclj/s

(drunk-line steps stepsize & args)
source

drunk-line-internalclj/s

(drunk-line-internal steps stepsize random angle-range)
source

find-all-cyclesclj/s

(find-all-cycles points step)

Find all distinct cycles when stepping through points by step size

Find all distinct cycles when stepping through points by step size
sourceraw docstring

find-cycleclj/s

(find-cycle point-vec step start-idx visited)

Find a single cycle starting from start-idx, returning [cycle-points new-visited]

Find a single cycle starting from start-idx, returning [cycle-points new-visited]
sourceraw docstring

h-sinclj/s

source

hex-side-centerclj/s

(hex-side-center radius side-index)

Get the center point of a hexagon side. radius: distance from center to side center side-index: 0-5, where 0 is right side (angle 0), increasing counterclockwise

For a hexagon, side centers are evenly spaced at d60 (60°) intervals: side 0: angle 0 (right) side 1: angle d60 (top-right) side 2: angle (* 2 d60) (top-left) side 3: angle d180 (left) side 4: angle (* 4 d60) (bottom-left) side 5: angle (* 5 d60) (bottom-right)

Get the center point of a hexagon side.
radius: distance from center to side center
side-index: 0-5, where 0 is right side (angle 0), increasing counterclockwise

For a hexagon, side centers are evenly spaced at d60 (60°) intervals:
side 0: angle 0 (right)
side 1: angle d60 (top-right)
side 2: angle (* 2 d60) (top-left)
side 3: angle d180 (left)
side 4: angle (* 4 d60) (bottom-left)
side 5: angle (* 5 d60) (bottom-right)
sourceraw docstring

horizontal-lineclj/s

source

multilineclj/s

source

nangleclj/s

(nangle n rad)
(nangle n rad style)
(nangle n rad cx cy)
(nangle n rad cx cy style)
source

ogeeclj/s

(ogee stretch)
(ogee stretch second-arg)
(ogee stretch resolution style)

An ogee shape. stretch: controls the stretch of the ogee curve resolution: step size for generating points (default: 0.1) style: optional style map (default: {:stroke (p-color 0) :stroke-weight 1})

Supports multiple arities: (ogee stretch) - uses default resolution (0.1) and default style (ogee stretch resolution) - if second arg is a number, it's resolution (ogee stretch style) - if second arg is a map, it's style (ogee stretch resolution style) - all parameters

   An ogee shape.
stretch: controls the stretch of the ogee curve
resolution: step size for generating points (default: 0.1)
style: optional style map (default: {:stroke (p-color 0) :stroke-weight 1})

Supports multiple arities:
(ogee stretch) - uses default resolution (0.1) and default style
(ogee stretch resolution) - if second arg is a number, it's resolution
(ogee stretch style) - if second arg is a map, it's style
(ogee stretch resolution style) - all parameters
sourceraw docstring

on-backgroundclj/s

(on-background color pattern)
source

pixelclj/s

(pixel n pixels palette)

Create an n x n pixel-art grid from a flat vector of numbers. 0 = empty, positive numbers map to palette entries.

Example: (pixel 2 [0 0 1 1] palette) The palette can be a map keyed by number, or a vector/sequence indexed by (value-1).

Create an n x n pixel-art grid from a flat vector of numbers.
0 = empty, positive numbers map to palette entries.

Example:
(pixel 2 [0 0 1 1] palette)
The palette can be a map keyed by number, or a vector/sequence
indexed by (value-1).
sourceraw docstring

polyclj/s

(poly n radius)
(poly n radius style)
(poly n radius cx cy)
(poly n radius cx cy style)
source

quarter-ogeeclj/s

source

random-rectclj/s

(random-rect style & {:keys [random] :or {random default-random}})
source

rectclj/s

source

spiralclj/s

(spiral nopoints dr-per-cycle num-cycles)
(spiral nopoints dr-per-cycle num-cycles style)
(spiral nopoints dr-per-cycle num-cycles r a)
(spiral nopoints dr-per-cycle num-cycles r a style)

Creates a spiral shape. nopoints: number of points per full cycle (like poly, nangle, star) dr-per-cycle: how much the radius increases over one full cycle num-cycles: number of full cycles to draw

The parameters are independent:

  • Resolution: nopoints controls how smooth the spiral is
  • Tightness: dr-per-cycle controls how tightly the spiral coils (independent of resolution)
  • Length: num-cycles controls how many full rotations (independent of resolution)

Supports multiple arities: (spiral nopoints dr-per-cycle num-cycles) - starts at r=0, a=0, default style (spiral nopoints dr-per-cycle num-cycles style) - starts at r=0, a=0 (spiral nopoints dr-per-cycle num-cycles r a) - explicit start position, default style (spiral nopoints dr-per-cycle num-cycles r a style) - all parameters

Creates a spiral shape.
nopoints: number of points per full cycle (like poly, nangle, star)
dr-per-cycle: how much the radius increases over one full cycle
num-cycles: number of full cycles to draw

The parameters are independent:
- Resolution: nopoints controls how smooth the spiral is
- Tightness: dr-per-cycle controls how tightly the spiral coils (independent of resolution)
- Length: num-cycles controls how many full rotations (independent of resolution)

Supports multiple arities:
(spiral nopoints dr-per-cycle num-cycles) - starts at r=0, a=0, default style
(spiral nopoints dr-per-cycle num-cycles style) - starts at r=0, a=0
(spiral nopoints dr-per-cycle num-cycles r a) - explicit start position, default style
(spiral nopoints dr-per-cycle num-cycles r a style) - all parameters
sourceraw docstring

spiral-pointsclj/s

(spiral-points r a dr da)
source

squareclj/s

source

starclj/s

(star n rads)
(star n rads style)
(star n rads cx cy)
(star n rads cx cy style)
source

truchetclj/s

source

vertical-lineclj/s

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close