Header menu logo Mibo

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

center w h d f parent

Full Usage: center w h d f parent

Parameters:
Returns: GridSection3D<'T>
Modifiers: inline
Type parameters: 'T

Centers a block of a specific size within the current section.

w : int
h : int
d : int
f : GridSection3D<'T> -> GridSection3D<'T>
parent : GridSection3D<'T>
Returns: GridSection3D<'T>

checker3D odd even section

Full Usage: checker3D odd even section

Parameters:
Returns: GridSection3D<'T>

Fills the section with a 3D checkerboard pattern.

odd : 'T
even : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

checkerShell x y z w h d odd even section'

Full Usage: checkerShell x y z w h d odd even section'

Parameters:
    x : 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.

x : int
y : int
z : int
w : int
h : int
d : int
odd : 'T
even : 'T
section' : GridSection3D<'T>
Returns: GridSection3D<'T>

checkerXY z odd even section

Full Usage: checkerXY z odd even section

Parameters:
Returns: GridSection3D<'T>

Fills an XY plane with a checkerboard pattern at a specific Z level.

z : int
odd : 'T
even : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

checkerXZ y odd even section

Full Usage: checkerXZ y odd even section

Parameters:
Returns: GridSection3D<'T>

Fills an XZ plane with a checkerboard pattern at a specific Y level. Ideal for tiled floors or patterned ceilings.

y : int
odd : 'T
even : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

checkerYZ x odd even section

Full Usage: checkerYZ x odd even section

Parameters:
Returns: GridSection3D<'T>

Fills a YZ plane with a checkerboard pattern at a specific X level.

x : int
odd : 'T
even : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

clear x y z w h d section

Full Usage: clear x y z w h d section

Parameters:
    x : int
    y : int
    z : int
    w : int
    h : int
    d : int
    section : GridSection3D<'T>

Returns: GridSection3D<'T>

Clears (sets to ValueNone) a cuboid volume.

x : int
y : int
z : int
w : int
h : int
d : int
section : GridSection3D<'T>
Returns: GridSection3D<'T>

column x y z height content section

Full Usage: column x y z height content section

Parameters:
    x : 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.

x : int
y : int
z : int
height : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

cylinder cx cz y radius height filled content section

Full Usage: cylinder cx cz y radius height filled content section

Parameters:
    cx : 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).

cx : int
cz : int
y : int
radius : int
height : int
filled : bool
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

edges x y z w h d content section

Full Usage: edges x y z w h d content section

Parameters:
    x : 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).

x : int
y : int
z : int
w : int
h : int
d : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

fill x y z w h d content section

Full Usage: fill x y z w h d content section

Parameters:
    x : 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.

x : int
y : int
z : int
w : int
h : int
d : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

floorXZ x y z w d content section

Full Usage: floorXZ x y z w d content section

Parameters:
    x : 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.

x : int
y : int
z : int
w : int
d : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

flowX step stamps parent

Full Usage: flowX step stamps parent

Parameters:
Returns: GridSection3D<'T>
Modifiers: inline
Type parameters: 'T

Places a sequence of stamps along X axis with a fixed step.

step : int
stamps : (GridSection3D<'T> -> GridSection3D<'T>) seq
parent : GridSection3D<'T>
Returns: GridSection3D<'T>

flowY step stamps parent

Full Usage: flowY step stamps parent

Parameters:
Returns: GridSection3D<'T>
Modifiers: inline
Type parameters: 'T

Places a sequence of stamps along Y axis with a fixed step.

step : int
stamps : (GridSection3D<'T> -> GridSection3D<'T>) seq
parent : GridSection3D<'T>
Returns: GridSection3D<'T>

flowZ step stamps parent

Full Usage: flowZ step stamps parent

Parameters:
Returns: GridSection3D<'T>
Modifiers: inline
Type parameters: 'T

Places a sequence of stamps along Z axis with a fixed step.

step : int
stamps : (GridSection3D<'T> -> GridSection3D<'T>) seq
parent : GridSection3D<'T>
Returns: GridSection3D<'T>

generate x y z w h d generator section

Full Usage: generate x y z w h d generator section

Parameters:
    x : 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.

x : int
y : int
z : int
w : int
h : int
d : int
generator : int -> int -> int -> 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

generateXY z generator section

Full Usage: generateXY z generator section

Parameters:
    z : 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.

z : int
generator : int -> int -> 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

generateXZ y generator section

Full Usage: generateXZ y generator section

Parameters:
    y : 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.

y : int
generator : int -> int -> 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

generateYZ x generator section

Full Usage: generateYZ x generator section

Parameters:
    x : 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.

x : int
generator : int -> int -> 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

iter x y z w h d action section

Full Usage: iter x y z w h d action section

Parameters:
    x : 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.

x : int
y : int
z : int
w : int
h : int
d : int
action : int -> int -> int -> 'T voption -> unit
section : GridSection3D<'T>
Returns: GridSection3D<'T>

line x1 y1 z1 x2 y2 z2 content section

Full Usage: line x1 y1 z1 x2 y2 z2 content section

Parameters:
    x1 : 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.

x1 : int
y1 : int
z1 : int
x2 : int
y2 : int
z2 : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

map x y z w h d mapping section

Full Usage: map x y z w h d mapping section

Parameters:
    x : 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.

x : int
y : int
z : int
w : int
h : int
d : int
mapping : 'T -> 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

padding n f parent

Full Usage: padding n f parent

Parameters:
Returns: GridSection3D<'T>
Modifiers: inline
Type parameters: 'T

Creates a sub-section that is shrunk by 'n' on all sides.

n : int
f : GridSection3D<'T> -> GridSection3D<'T>
parent : GridSection3D<'T>
Returns: GridSection3D<'T>

paddingEx left bottom back right top front f parent

Full Usage: paddingEx left bottom back right top front f parent

Parameters:
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

left : int
bottom : int
back : int
right : int
top : int
front : int
f : GridSection3D<'T> -> GridSection3D<'T>
parent : GridSection3D<'T>
Returns: GridSection3D<'T>

repeatX x y z count content section

Full Usage: repeatX x y z count content section

Parameters:
    x : 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).

x : int
y : int
z : int
count : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

repeatY x y z count content section

Full Usage: repeatY x y z count content section

Parameters:
    x : 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).

x : int
y : int
z : int
count : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

repeatZ x y z count content section

Full Usage: repeatZ x y z count content section

Parameters:
    x : 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).

x : int
y : int
z : int
count : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

replace oldContent newContent section

Full Usage: replace oldContent newContent section

Parameters:
Returns: GridSection3D<'T>

Replaces all occurrences of 'oldContent' with 'newContent'.

oldContent : 'T
newContent : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

replaceScatter oldContent newContent probability seed section

Full Usage: replaceScatter oldContent newContent probability seed section

Parameters:
    oldContent : '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).

oldContent : 'T
newContent : 'T
probability : float32
seed : int
section : GridSection3D<'T>
Returns: GridSection3D<'T>

run f grid

Full Usage: run f grid

Parameters:
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.

f : GridSection3D<'T> -> GridSection3D<'T>
grid : CellGrid3D<'T>
Returns: CellGrid3D<'T>

scatter3D count seed content section

Full Usage: scatter3D count seed content section

Parameters:
    count : 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.

count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

scatterEdges x y z w h d count seed content section

Full Usage: scatterEdges x y z w h d count seed content section

Parameters:
    x : 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.

x : int
y : int
z : int
w : int
h : int
d : int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

scatterLine x1 y1 z1 x2 y2 z2 count seed content section

Full Usage: scatterLine x1 y1 z1 x2 y2 z2 count seed content section

Parameters:
    x1 : 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.

x1 : int
y1 : int
z1 : int
x2 : int
y2 : int
z2 : int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

scatterShell x y z w h d count seed content section

Full Usage: scatterShell x y z w h d count seed content section

Parameters:
    x : 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.

x : int
y : int
z : int
w : int
h : int
d : int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

scatterStamp count seed stamp section'

Full Usage: scatterStamp count seed stamp section'

Parameters:
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).

count : int
seed : int
stamp : GridSection3D<'T> -> GridSection3D<'T>
section' : GridSection3D<'T>
Returns: GridSection3D<'T>

scatterXY z count seed content section

Full Usage: scatterXY z count seed content section

Parameters:
    z : 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.

z : int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

scatterXZ y count seed content section

Full Usage: scatterXZ y count seed content section

Parameters:
    y : 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.

y : int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

scatterYZ x count seed content section

Full Usage: scatterYZ x count seed content section

Parameters:
    x : 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.

x : int
count : int
seed : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

section x y z f parent

Full Usage: section x y z f parent

Parameters:
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.

x : int
y : int
z : int
f : GridSection3D<'T> -> GridSection3D<'T>
parent : GridSection3D<'T>
Returns: GridSection3D<'T>

set x y z content section

Full Usage: set x y z content section

Parameters:
    x : 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).

x : int
y : int
z : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

setIfEmpty x y z content section

Full Usage: setIfEmpty x y z content section

Parameters:
    x : int
    y : int
    z : int
    content : 'T
    section : GridSection3D<'T>

Returns: GridSection3D<'T>

Sets a cell only if it is currently empty (ValueNone).

x : int
y : int
z : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

shell x y z w h d content section

Full Usage: shell x y z w h d content section

Parameters:
    x : 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).

x : int
y : int
z : int
w : int
h : int
d : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

sphere cx cy cz radius filled content section

Full Usage: sphere cx cy cz radius filled content section

Parameters:
    cx : int
    cy : int
    cz : int
    radius : int
    filled : bool
    content : 'T
    section : GridSection3D<'T>

Returns: GridSection3D<'T>

Draws a sphere using distance-based rasterization.

cx : int
cy : int
cz : int
radius : int
filled : bool
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

wallXY x y z w h content section

Full Usage: wallXY x y z w h content section

Parameters:
    x : 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.

x : int
y : int
z : int
w : int
h : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

wallYZ x y z h d content section

Full Usage: wallYZ x y z h d content section

Parameters:
    x : 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.

x : int
y : int
z : int
h : int
d : int
content : 'T
section : GridSection3D<'T>
Returns: GridSection3D<'T>

Type something to start searching.