Liking cljdoc? Tell your friends :D

lambdaisland.witchcraft.shapes


ballclj

(ball {:keys [radius center inner-radius material fill] :as opts})

Create a ball shape. By default the inner-radius is one block less than the outer radius, so you get a ball with a "wall" that is one block thick. Set inner-radius to 0 to get a solid ball.

:material is either a keyword, or a function which receives the [x y z] position and returns a keyword.

Returns a sequence of [x y z] or [x y z material], to be passed to [[wc/set-blocks]].

Create a ball shape.
By default the inner-radius is one block less than the outer radius, so you
get a ball with a "wall" that is one block thick. Set inner-radius to 0 to
get a solid ball.

`:material` is either a keyword, or a function which receives the `[x y z]`
position and returns a keyword.

Returns a sequence of `[x y z]` or `[x y z material]`, to be passed
to [[wc/set-blocks]].
sourceraw docstring

ball-fnclj

(ball-fn {:keys [radius center inner-radius]
          :or {inner-radius (- radius 1) center [0 0 0]}})

Return a predicate that checks if the location is part of the ball.

Return a predicate that checks if the location is part of the ball.
sourceraw docstring

boxclj

(box {:keys [east-west-length north-south-length height material start]})

Create a simple box. We also use this as the base shape to carve out other shapes.

If the start position is omitted you get a box which starts at [0 0 0] and you need to position the result yourself.

:material is either a keyword, or a function which receives the [x y z] position and returns a keyword. :material is optional, you can add materials on the result yourself instead.

Returns a sequence of [x y z] or [x y z material], to be passed to [[wc/set-blocks]].

Create a simple box.
We also use this as the base shape to carve out other shapes.

If the start position is omitted you get a box which starts at [0 0 0] and you
need to position the result yourself.

`:material` is either a keyword, or a function which receives the `[x y z]`
position and returns a keyword. `:material` is optional, you can add materials
on the result yourself instead.

Returns a sequence of `[x y z]` or `[x y z material]`, to be passed
to [[wc/set-blocks]].
sourceraw docstring

lineclj

(line {:keys [start end length direction material]})

Draw a straight line between two points. Specify either end or direction+length, not both.

:material is either a keyword, or a function which receives the [x y z] position and returns a keyword.

Returns a sequence of [x y z] or [x y z material], to be passed to [[wc/set-blocks]].

Draw a straight line between two points.
Specify either end or direction+length, not both.

`:material` is either a keyword, or a function which receives the `[x y z]`
position and returns a keyword.

Returns a sequence of `[x y z]` or `[x y z material]`, to be passed
to [[wc/set-blocks]].
sourceraw docstring

torusclj

(torus {:keys [radius tube-radius material margin start] :or {margin 15}})

Draw a torus shape. :radius is the radius of the "ring", :tube-radius is the radius of the tube/pipe. :material is optional and can be a keyword or a function from [x y z] to keyword. :margin determines the "thickness", experiment with different values depending on the size of your torus.

Returns a sequence of [x y z] or [x y z material], to be passed to [[wc/set-blocks]].

Draw a torus shape.
`:radius` is the radius of the "ring", `:tube-radius` is the radius of the
tube/pipe. `:material` is optional and can be a keyword or a function from `[x
y z]` to keyword. `:margin` determines the "thickness", experiment with
different values depending on the size of your torus.

Returns a sequence of `[x y z]` or `[x y z material]`, to be passed
to [[wc/set-blocks]].
sourceraw docstring

tubeclj

(tube {:keys [start end length direction radius inner-radius material fill
              distance-fn]
       :or {inner-radius -0.1 distance-fn wc/distance}})

Draw a tube, pipe, cylinder, or tunnel.

This can be arbitrarily rotated, it does not have to be axis-aligned.

:start and :end are the two ends of the central axis of the cylinder. :radius is the radius of the cylinder, :inner-radius is the space inside the "tube" that is hollow (or filled in if you specify a :fill material).

Alternatively to specifying :end you can specify a :direction + :length.

:material and :fill are either keywords, or functions which receive the [x y z] position and returns a keyword.

For best result experiment with fractional numbers, e.g. a :radius 6.1 :inner-radius 4.9 may look better than :radius 6 :inner-radius 5.

To compute this we determine the bounding box, then iterate over all blocks, project them onto the central axis, and then see if the distance between the block and this projected point equals the radius. You can specify the :distance-fn to use something other than euclidian distance here, e.g. Manhatten ([[m/manhatten]]) distance or Chebyshev ([[m/chebyshev]]) distance, which will give you more of a square pipe.

Returns a sequence of [x y z] or [x y z material], to be passed to [[wc/set-blocks]].

Draw a tube, pipe, cylinder, or tunnel.

This can be arbitrarily rotated, it does not have to be axis-aligned.

`:start` and `:end` are the two ends of the central axis of the cylinder.
`:radius` is the radius of the cylinder, `:inner-radius` is the space inside
the "tube" that is hollow (or filled in if you specify a `:fill` material).

Alternatively to specifying `:end` you can specify a `:direction` + `:length`.

`:material` and `:fill` are either keywords, or functions which receive the
`[x y z]` position and returns a keyword.

For best result experiment with fractional numbers, e.g. a `:radius
6.1 :inner-radius 4.9` may look better than `:radius 6 :inner-radius 5`.

To compute this we determine the bounding box, then iterate over all blocks,
project them onto the central axis, and then see if the distance between the
block and this projected point equals the radius. You can specify the
`:distance-fn` to use something other than euclidian distance here, e.g.
Manhatten ([[m/manhatten]]) distance or Chebyshev ([[m/chebyshev]]) distance,
which will give you more of a square pipe.

Returns a sequence of `[x y z]` or `[x y z material]`, to be passed
to [[wc/set-blocks]].
sourceraw docstring

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

× close