Documentation
JSCAD v2 (upcoming)
JSCAD V2 User Guide
JSCAD V2 Documentation
Note on import syntax: the examples in the linked documentation use
require()imports. On stl.parts, shapes are written as ES modules, so for JSCAD v2 the imports look like this:import { primitives } from "@jscad/modeling"; const { cuboid } = primitives;
JSCAD v3 (upcoming)
The upcoming JSCAD v3 will simplify imports — functions can be imported directly (flat) instead of via namespaces:
import { cuboid } from "@jscad/modeling";
You can already use the v3 syntax today by importing the alpha version:
import { cuboid } from "@jscad/modeling@3.0.7-alpha.0";
export default function main(params) {
const shape = cuboid({ size: [params.width, params.length, params.height] });
return shape;
}
You can learn more about JSCAD v3 in the JSCAD V3 wiki.