Creating a Mesh Model Variant
A static meshed asset-generation test case
(asset_kind = "mc-model", "sn-model", or "dc-model") sculpts one 3D model by
compositing a continuous signed-distance field — a CSG paradigm — with a meshing
binary (mc, sn, or dc), which extracts a triangle mesh; the model builds toward a
goal described in a brief (there is no target model). Its version offers one or
more variants, and a run selects exactly one.
Every variant seeds the version’s common specs (the brief) plus its own
additive specs. The chosen variant’s slug is recorded in the run record, so every
result is attributed to a specific build.
This guide is the full procedure for adding a variant to an existing static-meshed asset-generation version. The authoritative rules live in Manifests (the Voxel cases section) and the tool interface in Mesh binaries; read them first.
For a variant of an animated meshed case — one whose [model] table declares a rig
of parts and joints (any -animation kind) — see
Creating a Mesh Animation Variant. For a
variant of a static VOXEL (cube) case see
Creating a Voxel Model Variant; for a 2D
case see Creating a Sprite Variant. To add a mode
to an end-to-end case instead, see
Creating an End-to-End Variant. To author a
brand-new case, see
Authoring a Mesh Model Test Case.
What a mesh-model variant can (and cannot) change
Section titled “What a mesh-model variant can (and cannot) change”This is where asset-generation variants differ sharply from end-to-end ones. There is
no target model at all, and resolution forbids any [[reference]] (common or
per-variant). The model is human-reviewed against the brief, so a variant has nothing
to “change the target” of — there is none.
The asset_kind (which fixes the algorithm and its surface character — an mc
low-poly, sn smooth, or dc sharp mesh) and the [voxel] volume are fixed at the
version level — a variant cannot switch the meshing binary, turn a static model into
an animation, change the field bounds, or change the preview background.
What a variant can do is vary the brief the model sculpts toward, via an additive spec:
- a tighter palette (a subset of the base colors);
- a stricter operation budget (fewer primitives / CSG operations allowed);
- a required technique (symmetric via the
mirrorop only; hard unions only — no--blend— or, fordc, mandatory--sharpon all armor edges; a primitive count cap); - another observable stylistic constraint visible in the extracted mesh.
If you need a genuinely different subject, a different algorithm, or a different volume, that is a new case (or a new version), not a variant.
A variant’s spec entries are additive — they layer on top of the common ones
rather than replacing them. A variant adds no review items: an asset-generation
case has no reviewer checklist at all, and the produced asset is judged as a whole
against the brief the run was seeded with, on the case’s single overall domain
(see
Judged on one overall rating).
The variant brief is therefore the only place its constraint is recorded — write
it precisely enough that a reviewer can weigh it.
Procedure
Section titled “Procedure”1. Choose the variation
Section titled “1. Choose the variation”Decide the constraint the variant imposes and keep it consistent everywhere:
- slug — lowercase, used in
test-case.tomland the spec filename (e.g.symmetric); - display name — title case, the variant’s
name(e.g.Mirror-Symmetric); - description — one line naming the constraint.
Favor a single constraint a reviewer can observe in the extracted mesh (rotating in the 3D viewer, or in the wgpu preview).
2. Write the variant brief
Section titled “2. Write the variant brief”Create specs/<slug>.md, stated as a delta against the common brief:
- open by stating it builds on the common brief, by name;
- state the added or tightened constraint with precise, testable terms (exact colors, an operation cap, the CSG technique required);
- reaffirm it sculpts toward the same brief in the same
[voxel]volume with the same meshing binary — the subject and the surface character described do not change, only the added constraint.
A variant spec may reference the common specs freely (they are always seeded) but must not reference another variant’s spec.
3. Create the variant file and list it
Section titled “3. Create the variant file and list it”Write variants/<slug>.toml as a standalone TOML document whose top-level keys are the
variant’s fields, then add its path to the variants array in test-case.toml (the
first entry is the default). Do not add or change a [voxel] table or asset_kind
here — both are version-level. Paths inside resolve against the version folder, and
dest defaults to source:
slug = "symmetric"name = "Mirror-Symmetric"description = "Same subject, volume, and mesher, built left/right symmetric using the mirror op."spec = [{ source = "specs/symmetric.md" }]# test-case.toml — add the new file to the ordered list (first = default)variants = ["variants/base.toml", "variants/symmetric.toml"]Rules enforced at resolution:
specentries are additive on the common specs; within one variant, no two seeded specs (common + own) may share adest.- No
referenceentry — an asset-generation case declares no references at all, so any reference (common or per-variant) is rejected. - No per-variant
[voxel]/asset_kind— both are version-level; a variant cannot redeclare them or switch the meshing binary. - No
review_itementries — an asset-generation case declares no reviewer checklist, on the case or on a variant.
Also update the human-readable comment in the manifest that enumerates the variants so the list stays accurate.
Validate your work
Section titled “Validate your work”From the repository root:
npm run lint:specs # markdownlint-cli2 + cspell over test-cases/**If cspell flags a legitimate domain term, add it to .cspell/project-words.txt — do
not reword good prose to dodge the dictionary.
Then seed and render the new variant, and re-check the existing ones to confirm your edits changed nothing for them:
tcab seed --test-case <slug> --version <version> --variant <new-variant>tcab prompt --test-case <slug> --version <version> --variant <new-variant>Read the seeded output to confirm the new variant’s brief is self-contained (no target
model is seeded), and that it leaves the [voxel] volume and the meshing binary intact.
Re-ingest after editing
Section titled “Re-ingest after editing”A backend-driven run resolves its definition from the backend’s store, which skips a version it already holds — so after adding the variant, force a re-ingest or the new variant will not appear in a run:
curl -X POST http://127.0.0.1:8787/ingest \ -H 'content-type: application/json' \ -d '{"testCases": ["<slug>"], "force": true}'Force-re-ingest overwrites the stored version in place and is for development only. Adding a variant edits an existing version, so do it only while that version is unpublished; once a published run references the version it is immutable and a variant change requires a new version instead. See Running the services locally.
Commit on the repository’s default branch with a conventional-commit message scoped to
the case, e.g. feat(<slug>): add symmetric variant …. Do not commit node_modules/ or
local seed output. Then exercise it with Run a Test Case.