Layout3D Module
A fluent DSL for composing 3D layouts. All operations return the modified section to allow chaining (pipeline style).
Functions and values
| Function or value |
Description
|
Full Usage:
center w h d f parent
Parameters:
int
h : int
d : int
f : GridSection3D<'T> -> GridSection3D<'T>
parent : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Centers a block of a specific size within the current section.
|
Full Usage:
checker3D odd even section
Parameters:
'T
even : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Fills the section with a 3D checkerboard pattern.
|
Full Usage:
checkerShell x y z w h d odd even section'
Parameters:
int
y : int
z : int
w : int
h : int
d : int
odd : 'T
even : 'T
section' : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Applies a checkerboard pattern to the 6 outer faces of a cuboid.
|
Full Usage:
checkerXY z odd even section
Parameters:
int
odd : 'T
even : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Fills an XY plane with a checkerboard pattern at a specific Z level.
|
Full Usage:
checkerXZ y odd even section
Parameters:
int
odd : 'T
even : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Fills an XZ plane with a checkerboard pattern at a specific Y level. Ideal for tiled floors or patterned ceilings.
|
Full Usage:
checkerYZ x odd even section
Parameters:
int
odd : 'T
even : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Fills a YZ plane with a checkerboard pattern at a specific X level.
|
Full Usage:
clear x y z w h d section
Parameters:
int
y : int
z : int
w : int
h : int
d : int
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Clears (sets to ValueNone) a cuboid volume.
|
Full Usage:
column x y z height content section
Parameters:
int
y : int
z : int
height : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Creates a vertical column at (x, z) from y=0 to specified height. Alias for repeatY starting at y=0.
|
Full Usage:
cylinder cx cz y radius height filled content section
Parameters:
int
cz : int
y : int
radius : int
height : int
filled : bool
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Draws a vertical cylinder (Y-axis aligned).
|
Full Usage:
edges x y z w h d content section
Parameters:
int
y : int
z : int
w : int
h : int
d : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Creates only the 12 edges of a box (no faces).
|
Full Usage:
fill x y z w h d content section
Parameters:
int
y : int
z : int
w : int
h : int
d : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Fills a cuboid volume with content.
|
Full Usage:
floorXZ x y z w d content section
Parameters:
int
y : int
z : int
w : int
d : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Creates a horizontal floor plane (XZ plane) at a specific Y level.
|
Full Usage:
flowX step stamps parent
Parameters:
int
stamps : (GridSection3D<'T> -> GridSection3D<'T>) seq
parent : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Places a sequence of stamps along X axis with a fixed step.
|
Full Usage:
flowY step stamps parent
Parameters:
int
stamps : (GridSection3D<'T> -> GridSection3D<'T>) seq
parent : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Places a sequence of stamps along Y axis with a fixed step.
|
Full Usage:
flowZ step stamps parent
Parameters:
int
stamps : (GridSection3D<'T> -> GridSection3D<'T>) seq
parent : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Places a sequence of stamps along Z axis with a fixed step.
|
Full Usage:
generate x y z w h d generator section
Parameters:
int
y : int
z : int
w : int
h : int
d : int
generator : int -> int -> int -> 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Fills a volume by calling a generator function for each cell.
|
Full Usage:
generateXY z generator section
Parameters:
int
generator : int -> int -> 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Generates content for an XY plane using a generator function.
|
Full Usage:
generateXZ y generator section
Parameters:
int
generator : int -> int -> 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Generates content for an XZ plane using a generator function.
|
Full Usage:
generateYZ x generator section
Parameters:
int
generator : int -> int -> 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Generates content for a YZ plane using a generator function.
|
Full Usage:
iter x y z w h d action section
Parameters:
int
y : int
z : int
w : int
h : int
d : int
action : int -> int -> int -> 'T voption -> unit
section : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Iterates over a volume, providing read access to the cells.
|
Full Usage:
line x1 y1 z1 x2 y2 z2 content section
Parameters:
int
y1 : int
z1 : int
x2 : int
y2 : int
z2 : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Draws a 3D line using Bresenham's algorithm extended to 3D.
|
Full Usage:
map x y z w h d mapping section
Parameters:
int
y : int
z : int
w : int
h : int
d : int
mapping : 'T -> 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Transforms existing content in a volume. Empty cells are skipped.
|
Full Usage:
padding n f parent
Parameters:
int
f : GridSection3D<'T> -> GridSection3D<'T>
parent : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Creates a sub-section that is shrunk by 'n' on all sides.
|
Full Usage:
paddingEx left bottom back right top front f parent
Parameters:
int
bottom : int
back : int
right : int
top : int
front : int
f : GridSection3D<'T> -> GridSection3D<'T>
parent : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Creates a sub-section with explicit padding for each side. Order: left, bottom, back, right, top, front
|
Full Usage:
repeatX x y z count content section
Parameters:
int
y : int
z : int
count : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Repeats content along X axis starting at (x, y, z).
|
Full Usage:
repeatY x y z count content section
Parameters:
int
y : int
z : int
count : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Repeats content along Y axis starting at (x, y, z).
|
Full Usage:
repeatZ x y z count content section
Parameters:
int
y : int
z : int
count : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Repeats content along Z axis starting at (x, y, z).
|
Full Usage:
replace oldContent newContent section
Parameters:
'T
newContent : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Replaces all occurrences of 'oldContent' with 'newContent'.
|
Full Usage:
replaceScatter oldContent newContent probability seed section
Parameters:
'T
newContent : 'T
probability : float32
seed : int
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Probabilistically replaces occurrences of 'oldContent' with 'newContent'. Perfect for "weathering" or "distressing" large surfaces (e.g. 5% of walls are cracked).
|
Full Usage:
run f grid
Parameters:
GridSection3D<'T> -> GridSection3D<'T>
grid : CellGrid3D<'T>
Returns: CellGrid3D<'T>
Modifiers: inline Type parameters: 'T |
The entry point for the layout DSL. Lifts a Grid into a Section, executes the layout function, and returns the modified Grid.
|
Full Usage:
scatter3D count seed content section
Parameters:
int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Randomly places 'count' items within the section volume. Uses a deterministic seed for reproducible results.
|
Full Usage:
scatterEdges x y z w h d count seed content section
Parameters:
int
y : int
z : int
w : int
h : int
d : int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Scatters content randomly on the 12 edges of a box. Ideal for adding localized "noise" (dust, moss, vines) to corners and edges.
|
Full Usage:
scatterLine x1 y1 z1 x2 y2 z2 count seed content section
Parameters:
int
y1 : int
z1 : int
x2 : int
y2 : int
z2 : int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Scatters content along a 3D line. Useful for decorating paths, wires, or structural beams.
|
Full Usage:
scatterShell x y z w h d count seed content section
Parameters:
int
y : int
z : int
w : int
h : int
d : int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Scatters content randomly on the 6 outer faces of a cuboid. Perfect for adding "noise" (cracks, moss, barnacles) to rooms or boxes.
|
Full Usage:
scatterStamp count seed stamp section'
Parameters:
int
seed : int
stamp : GridSection3D<'T> -> GridSection3D<'T>
section' : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Randomly applies a stamp (a component function) 'count' times within the section. Use this to populate a volume with complex multi-cell objects (e.g. trees, props).
|
Full Usage:
scatterXY z count seed content section
Parameters:
int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Scatters content on an XY plane at a specific Z level. Useful for decorating front/back walls.
|
Full Usage:
scatterXZ y count seed content section
Parameters:
int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Scatters content on an XZ plane at a specific Y level. Useful for floors or ceilings at any height.
|
Full Usage:
scatterYZ x count seed content section
Parameters:
int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Scatters content on a YZ plane at a specific X level. Useful for decorating side walls.
|
Full Usage:
section x y z f parent
Parameters:
int
y : int
z : int
f : GridSection3D<'T> -> GridSection3D<'T>
parent : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Creates a sub-section (nested view) at the specified relative coordinates. Useful for defining reusable components that don't know their absolute position.
|
Full Usage:
set x y z content section
Parameters:
int
y : int
z : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
Modifiers: inline Type parameters: 'T |
Sets a single cell at (x, y, z).
|
Full Usage:
setIfEmpty x y z content section
Parameters:
int
y : int
z : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Sets a cell only if it is currently empty (ValueNone).
|
Full Usage:
shell x y z w h d content section
Parameters:
int
y : int
z : int
w : int
h : int
d : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Creates a hollow box (6 faces, empty interior).
|
Full Usage:
sphere cx cy cz radius filled content section
Parameters:
int
cy : int
cz : int
radius : int
filled : bool
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Draws a sphere using distance-based rasterization.
|
Full Usage:
wallXY x y z w h content section
Parameters:
int
y : int
z : int
w : int
h : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Creates a vertical wall plane (XY plane) at a specific Z level.
|
Full Usage:
wallYZ x y z h d content section
Parameters:
int
y : int
z : int
h : int
d : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>
|
Creates a vertical wall plane (YZ plane) at a specific X level.
|
Mibo