Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 5281f6dd-3…

Construction

Hand-built geometry and the builders behind it, for the excavator sim in `scenes/main.scene`.

by◐sdfsdf·posted 1mo ago
What it does

Construction

Hand-built geometry and the builders behind it, for the excavator sim in scenes/main.scene.

Nothing stock reads as an excavator, so the machine is authored: a bucket is an open curved shell, a track is a swept loop with grousers, a dirt heap is a lumpy dome. Each function returns the flat-array geometry asset.create("mesh", name, geom) takes, so a scene build turns them into durable mesh assets.

What it provides

CallWhat you get
builder()A mesh accumulator: tri, faceNormal, build.
boxInto(b, centre, half, [rx])A box, optionally turned about the X axis.
beamInto(b, stations)A tapered rectangular beam swept through {z, y, hw, hh} stations.
loopInto(b, path, hw, thickness)A band swept round a closed Z/Y path.
track(opts)A whole track — belt loop plus tread plates — standing on y = 0.
bucket(opts)The bucket shell and teeth. Pivot at the top of the back plate, opening toward +Z.
mound(opts)A lumpy closed dirt heap, deterministic from seed.

The convention that keeps winding correct

Every quad goes in through faceNormal(a, b, c, d, want), stating the direction it should face. The builder works out which way the corners as given actually run and reverses them when they disagree, then emits both triangles with want as the flat face normal. Winding a hand-built mesh backwards is the classic bug that makes a solid render inside-out; this makes it unreachable. Normals are per-face, which is what plate and box look like under light.

Callers

scenes/main.scene/build.luau — it makes the machine and the site from these. Read the module before adding a part, so a new shape goes in as another sweep or box rather than as a one-off vertex list.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

Construction.module — geometry for the excavator sim. Hand-built meshes, because no stock primitive reads as an excavator: a bucket is an open curved shell, a track is a swept loop, a dirt heap is a lumpy dome. Everything here returns the flat-array geometry that `asset.create("mesh", name, geom)` takes, so a scene build can turn these into durable assets. Two rules make hand-authoring geometry safe: 1. Every quad states the direction it should face (`faceNormal`), and the builder reverses the corners when the order as given disagrees. Getting winding backwards is the classic hand-mesh bug; this makes it unreachable. 2. Normals are per-face and flat, which is what plate and box look like.

sub(a: ?, b: ?) → void

Small vector helpers (local; nothing outside needs them)

argtypedescription
a?
b?

cross(a: ?, b: ?) → void

argtypedescription
a?
b?

unit(a: ?) → void

argtypedescription
a?

scale(a: ?, s: ?) → void

argtypedescription
a?
s?

hash1(n: ?) → void

Deterministic pseudo-random in [-1, 1], so the same seed builds the same heap on every peer and after every reload.

argtypedescription
n?

minY(geom: ?) → void

argtypedescription
geom?

shiftY(geom: ?, dy: ?) → void

argtypedescription
geom?
dy?

builder( ) → void

tri(a: ?, b: ?, c: ?, nrm: ?) → void

argtypedescription
a?
b?
c?
nrm?

faceNormal(a: ?, b: ?, c: ?, d: ?, want: ?) → void

A quad that must face `want`. Works out which way its corners run and emits them the other way round when they disagree, with `want` as the normal. A quad with no area is dropped: with no surface there is nothing to face, and the normal its winding would report is arbitrary, which is how a hand-built mesh ends up with a handful of triangles the engine reports as wound away from their own normals.

argtypedescription
a?
b?
c?
d?
want?

build( ) → void

boxInto(b: ?, c: ?, h: ?, rx: ?) → void

A box centred on `c` with half-extents `h`, optionally turned about the X axis by `rx` radians — which is all a tread plate or a hydraulic ram needs.

argtypedescription
b?
c?
h?
rx?

beamInto(b: ?, stations: ?, caps: ?) → void

A beam swept through `stations`, each `{ z, y, hw, hh }` in the entity's own frame: a rectangular cross-section moving along a path in the Z/Y plane. The boom, the arm, the tipper's sides and a ladder frame are all this.

argtypedescription
b?
stations?
caps?

corners(s: ?) → void

argtypedescription
s?

loopInto(b: ?, path: ?, hw: ?, thickness: ?) → void

A rectangular band swept along a closed path of `{ z, y }` points, the outward side being the path's normal. Used for the track belt.

argtypedescription
b?
path?
hw?
thickness?

ring(p: ?, tangent: ?) → void

argtypedescription
p?
tangent?

stadiumPath(halfLen: ?, radius: ?, cy: ?, arcSteps: ?) → void

A stadium outline (two straights joined by two half-circle ends) in the Z/Y plane, traversed so the left normal points outward.

argtypedescription
halfLen?
radius?
cy?
arcSteps?

track(opts: ?) → void

The machine's major parts A whole track: the belt loop plus the tread plates that make it read as a track rather than as a rubber band. Local frame: origin at the middle of the track, ground at y = 0.

argtypedescription
opts?

bucket(opts: ?) → void

The bucket: an open shell whose cross-section is the profile below, swept across the bucket's width. Local frame: the pivot sits at the top of the back plate, the opening faces +Z, and the cutting edge is at the far end.

argtypedescription
opts?

seg(a: ?, bb: ?) → void

argtypedescription
a?
bb?

mound(opts: ?) → void

A dirt heap: a lumpy dome standing on the ground, closed underneath. Deterministic from `seed`.

argtypedescription
opts?

wobble(theta: ?, ring: ?) → void

argtypedescription
theta?
ring?

at(ring: ?, sector: ?) → void

argtypedescription
ring?
sector?

solidBox(half: ?) → void

Wrappers

argtypedescription
half?

beam(stations: ?) → void

argtypedescription
stations?

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.