BetaBetaBetaChecks a design document without building it and lists every problem found.
Each problem carries the JSON pointer of the value it is about, such as /features/2/radius,
and a message. An assembly is checked with the documents it places, whose problems come
under their position, such as /documents/2. Undefined properties and bad expressions count.
The document to check
The problems, empty when there are none
BetaWorks out the version of a design document, the value a component's version pins its source
with.
The version is the SHA-256 of the document's canonical JSON (RFC 8785) without what only
editors and tools read, such as meta but its name, extras, labels, descriptions and
reference hints, so editing those keeps it.
The document; documents is not read
The version, 64 lower-case hexadecimal digits
BetaBuilds the parts of a design document, with a configuration's values and then parameters
replacing the document's own.
A document validate faults is refused; a failed feature is reported and what uses it skipped.
The caller deletes every shape returned, and an identical call returns the same ones while they
live, so one delete frees both answers.
The document, the configuration and the parameter values to build it with
The parts, a report per feature, the problems found after the features ran, the parameter values used, and the structure that assembly.manager.buildAssemblyDocument exports to STEP and glTF; an assembly adds its components and bill of materials
const { parts, report } = await bitbybit.occt.design.build({
document: { schemaVersion: 1, parameters: { width: 40, height: 10 }, features: [
{ id: "base", type: "sketch", on: { plane: "XY" }, pen: [{ type: "hLine", length: "width" }, { type: "vLine", length: 20 }, { type: "hLine", length: "-width" }, { type: "close" }] },
{ id: "plate", type: "extrude", profile: "base", distance: "height" },
], parts: [{ id: "plate", body: "plate", properties: { partNumber: "PL-{width}x{height}" } }] },
parameters: { width: 60 },
});
console.log(parts[0]?.properties.partNumber);
Builds parametric parts and assemblies kept as data: a part document holds typed parameters, configurations, an ordered list of features and the parts they make, with materials, appearance, properties such as part numbers and connectors; an assembly document places parts and other assemblies, fastened by their connectors.
Features find faces and edges by the feature that made them and the role it made them in, so a reference keeps pointing at the same face when the parameters change. Sketches come from
sketch, the operations fromoperations,booleans,filletsandfeatures.Experimental: the document format may still change before its first stable version, and documents written before then are not migrated.