export default model | parts | (params) => model | parts
What the program builds. The CLI, the dev viewer and the playground all read it the same way.
modelSolid | Shape2 | arrays of them- A solid or a 2D shape, or an array of them. Arrays may nest. The program then has one part, named
default. parts{ [name]: model | (params) => model }- Named parts. The first one is the default. A function value is only called for the part being shown or exported, so expensive parts cost nothing until you pick them.
paramsobject- When the default export is a function, it is called with
paramsmerged with any--setoverrides.
A 2D shape in a part is drawn in the viewer and in PNGs as a sketch on Z=0 (a see-through blue fill with a bold outline), to check a profile before extruding it. STL leaves it out, and a part with no solids at all fails to export.
The STL of a part merges all its solids into one body. In the viewer and in PNGs each solid keeps its own color and transparency.
Functions may be async.
export default (p) => ({
assembly: () => [box(p).color('steelblue'), lid(p).color('orange', 0.6)],
box: () => box(p),
lid: () => lid(p),
});