Collection of functions for generating various shapes. Each of these
methods creates a shape generator function; that is, a function
which takes x, y, and z coordinates and returns true or false.
To use these functions in the Add/Remove voxel tool, you need to simply enter a function call, like this:
cuboid 7, 4, 3, 10, 10, 10
The call to cuboid will return a function that will be called on each
voxel position (each x,y, and z in the lattice), returning true
if the position is on the shape, or false otherwise.
Call methods with.name(),.name(arguments)or just .name arguments .
r, cx, cy, cz)
-> Function#Builds a generator function to make cubes
NumberRadius (in voxels) = width = height = depth
NumberCenter X lattice position
NumberCenter Y lattice position
NumberCenter Z lattice position
Functiongenerator Generator function to make the cube
w, h, d, cx, cy, cz, [hollow])
-> Function#Builds a generator function to make cuboids (rectangular prisms)
NumberWidth (in voxels)
NumberHeight (in voxels)
NumberDepth (in voxels)
NumberCenter X lattice position
NumberCenter Y lattice position
NumberCenter Z lattice position
BooleanTrue to create a hollow cuboid
(Optional; defaults tofalse)Functiongenerator Generator function to make the cuboid
funcs)
-> Function#Returns a new shape generator function that is the intersection (overlapping part) of several other shape generator functions.
Example: overlap between a sphere and a cuboid:
intersect(
cuboid(4,5,7, 10,10,10),
sphere(5, 10,10,15)
)
Note that generator functions need not be builtin:
intersect(
cuboid(4,5,7, 10,10,10),
(x, y, z) -> x % 2 is 0
)
Function[]... Pass any number of shape generator functions as arguments
Functiongenerator New union shape generator function
funcs)
-> Function#Returns a new shape generator function that is the negation of another shape generator function
Example: Hollow a sphere out of the lattice
negate sphereoid(4,5,7, 10,10,10)
Function[]... Pass any number of shape generator functions as arguments
Functiongenerator New union shape generator function
r, cx, cy, cz)
-> Function#Builds a generator function to make spheres
NumberRadius (in voxels) = width = height = depth
NumberCenter X lattice position
NumberCenter Y lattice position
NumberCenter Z lattice position
Functiongenerator Generator function to make the sphere
w, h, d, cx, cy, cz, [hollow])
-> Function#Builds a generator function to make sphereoids/ellipsoids
NumberWidth (in voxels) = X diameter
NumberHeight (in voxels) = Y diameter
NumberDepth (in voxels) = Z diameter
NumberCenter X lattice position
NumberCenter Y lattice position
NumberCenter Z lattice position
BooleanTrue to create a hollow sphereoid
(Optional; defaults tofalse)Functiongenerator Generator function to make the sphereoid
funcs)
-> Function#Returns a new shape generator function that is the union of several other shape generator functions.
Example: union of a sphere and a cuboid:
union(
cuboid(4,5,7, 10,10,10),
sphere(5, 10,10,15)
)
Note that generator functions need not be builtin:
union(
cuboid(4,5,7, 10,10,10),
(x, y, z) -> x % 2 is 0
)
Function[]... Pass any number of shape generator functions as arguments
Functiongenerator New union shape generator function