Repository navigation
1.5.0
Release Notes v1.5.0
This release adds two new packages for building models (BIM), a JSON format for parametric parts and assemblies, and a learn site rebuilt from the front door in. @bitbybit-dev/ifc and @bitbybit-dev/ifc-worker read, write, author and edit IFC files, in the browser and in Node. bitbybit.occt.design builds design documents: parameters, sketches, features, parts, configurations and assemblies with joints, kept as plain JSON that a person or an AI agent can write. Underneath both sit geometry recipes, a kernel-neutral description that Manifold builds into meshes and OCCT builds into exact shapes. The library gains 98 new functions (2,017 in all, up from 1,919).
Nothing was removed, and no engine version moved. One default changes what you see: Manifold solids are now drawn with smooth normals. Read Upgrading from 1.4 below.
Upgrading from 1.4: what changes
- Manifold drawing shades smoothly by default.
computeNormalsonDrawManifoldOrCrossSectionDtoandDrawManifoldsOrCrossSectionsDtois nowtrue, wasfalse. A newminSharpAngle(default 40°) keeps sharper edges crisp. PasscomputeNormals: falsefor the old flat look. - Workers refuse a call with no method name. The OCCT, JSCAD and Manifold workers answer an empty or missing method name with an input error naming an example method, as the IFC worker does, instead of leaving it unanswered.
- An empty text where a DTO has no default counts as not given.
- Small geometry changes: curve interpolation ignores tangents shorter than the tolerance, and
fillet2dleaves a straight corner as it is instead of failing on it. - Types:
Base.Polyline2andBase.Polyline3take acolorofstring | number[], so code that readscolorasnumber[]needs a check.createWorkersFromUrlstakesWorkerUrls, which adds an optionalifcWorkerUrl.
New: IFC building models, @bitbybit-dev/ifc and @bitbybit-dev/ifc-worker (beta)
IFC is the open exchange format for building information models. The new packages build standard elements the way IFC defines them, so other BIM tools open the files and edit the walls as walls.
- Read, write and edit.
- Formats: IFC4 files, IFC4X3 ADD2 and
.ifcziparchives. An IFC2X3 file is read through IFC4, andmodel.upgradeToIfc4makes it editable. - Immutable models: a model is an immutable value, so keeping an earlier one is undo.
- Large files: they open in seconds. Elements decode only when asked for, and
model.writeBytescopies untouched entities byte for byte.
- Formats: IFC4 files, IFC4X3 ADD2 and
- Author (
walls,doors,windows,openings,slabs,roofs,columns,beams,members,spaces,spatial,assemblies,site):- walls joined at corners and clipped by roofs;
- door and window types with handles and per-part materials;
- flat, mono-pitch, gable and hip roofs;
- terrain and trees;
- materials, property sets and base quantities (
quantities.compute).
- Geometry:
ifc.geometry.recipedescribes what a model draws;toShapes,toStepandtoDocumentbuild exact OpenCascade shapes and a STEP file nested by site, building, storey and IFC class;model.georeferencereads a model's map conversion.
@bitbybit-dev/ifc-workerruns the same API in a web worker. The BabylonJS, three.js and PlayCanvas packages start it beside the other workers and expose it asbitbybit.ifc.- Checked against IfcOpenShell on a corpus of 52 public, licensed IFC files, twice a week in CI (
npm run ifc:corpus). - Examples:
- a family house with its garden, written to IFC and drawn from it (three.js, Node);
- an
ifc-housetemplate in create-app; - a guide for agents: IFC building models.
New: design documents, bitbybit.occt.design (experimental)
A design document is a parametric CAD model as JSON: named parameters and expressions, an ordered list of features, and the parts they make. design.validate checks one against its schema with JSON pointers, and design.build turns it into shapes, in the browser, in Node, or as one CAD Cloud pipeline step.
- Features:
- sketches;
- extrude, revolve, sweep and loft;
- fillets, chamfers and shells;
- holes;
- linear and polar patterns;
- push/pull (
extrude, the default, oroffset) and face removal; - transforms, imports and script features.
- Parts and assemblies:
- parts with materials and mass;
- configurations;
- assemblies of sub-assemblies with connectors, joints with limits and component patterns.
- References that survive edits. Faces and edges are named with hints and rebound when the model changes. A rebound feature lists its repairs.
design.referenceFornames a pick and checks it against nudged parameter values. - For interactive editing:
- a build reuses outcomes it already holds and reports the features it has made as progress;
design.clashesfinds placed parts that overlap or come too close;- a kernel crash names the feature it was making (
occt.design.crashed); - the drawers keep part meshes across builds and redraw only what changed;
setMeshRetentioncaps the triangulations a kernel keeps.
- The schema ships in
@bitbybit-dev/occtunderschemas/design-document/and on the release CDN, one per release. The format is experimental: documents carry"schemaVersion": 1and are not migrated when it is frozen.
OCCT: features with history, binary BREP, signatures
- History for features and operations. Each of these says what became of each face:
features:holesWithHistory,counterboredHolesWithHistory,countersunkHolesWithHistory,bossWithHistory,pocketWithHistory,pushPullFacesWithHistoryandremoveFacesWithHistory;operations:loftWithHistory,loftAdvancedWithHistory,pipeWithHistory,makeThickSolidSimpleWithHistoryandmakeThickSolidByJoinWithHistory;booleans.intersectionWithHistory.
- Push/pull moves any face, curved ones included, by offset, and faces come off with their neighbours closing the gap. A shell OCCT cannot hollow next to tangent rounds is cut from the solid's inward offset.
io.saveShapeBrepBinaryandio.loadBrepBinary: compact binary BREP.analysis.signatures: shape signatures that tell whether two shapes are the same.purgeInternalEdgesworks again and removes the edges a split leaves inside a face.- A pipe with an invalid trihedron is refused with a message that names it.
Geometry recipes (beta)
A recipe (Base.Recipe, format bitbybit.recipe) describes geometry without a kernel:
- shapes: extrusions, faceted breps, surface models, polygonal face sets, curve outlines and half-spaces, with surface styles;
- steps: union, intersection, revolve and loft.
How each package uses one:
- base validates it.
- Manifold builds it into meshes in one kernel call:
manifold.recipes.build,meshesandsurfaceMeshes. - OCCT builds it exactly:
occt.recipes.buildandbuildDocument. - The three renderers draw it batched and instanced, and pick, colour and hide its elements:
draw.optionsRecipeMeshes,recipeElementOfPick,setRecipeElementsColourandsetRecipeElementsVisible.
Manifold cross sections gain operations.loft and operations.sweep.
Base
mesh.triangulatePolygon,mesh.signedVolume,polyline.polygonNormal,polyline.polygonAreaandpoint.arcThroughThreePoints.- Polyline colours may be hex text.
- Manifold meshes take their drawing normals from the kernel, smooth below
minSharpAngleand sharp above it, and decomposed meshes keep the normals on their own vertices.
Fixes
- Workers:
- the JSCAD and Manifold workers now hold a call that arrives before their kernel has loaded, as the OCCT worker does since 1.4.1;
- all three name the call when a failure cannot be reported;
- without shared memory, the OCCT worker posts a design build's steps as progress messages.
- Kernel exceptions are reported by type and message.
gui.container.addControlstakes a full-screen or a mesh UI.adjustYtoZis documented as the mirroring axis swap it is.
Tooling, packaging & docs
-
learn.bitbybit.dev, rebuilt:
- a new front door with a map of the platform, How Bitbybit Works, a glossary and a plans page;
- search built into the site (Ctrl+K or /);
- Getting Started rewritten, with each coding editor in its own section and a drone built in seven chapters in Rete, Blockly and TypeScript;
- the Code section rewritten, each idea shown in all three editors;
- a Designer section with step-by-step tutorials;
- GUI Elements at a Glance for 3D Bits.
-
New blog post: The Coding Editors, Rebuilt, with a drone built three ways and a video.
-
MCP server (
@bitbybit-dev/mcp):describeanswers the types a member takes or returns;- new guides to CAD geometry and IFC models, whose worked examples the test suites run;
- the instructions tell an agent to check which version the project has installed and to ask for that one.
-
create-app gains the
ifc-housetemplate. -
CAD Cloud SDK pipeline types:
- a design build as one step that returns BREP;
design.clashes;- the history and recipe methods.
The pipeline budgets for design steps are documented.
-
The code carries no comments but the public API's JSDoc.
- Each package has an
ARCHITECTURE.md, andLINT.mdholds the lint policy. - Lint is stricter, with a ratchet.
baseshares vector and placement maths, hashing and sRGB conversion.
- Each package has an
-
Every drawing option in the three renderers is documented from the code that reads it.
-
The help text for every function, input and output is translated in full into all 17 languages, IFC and recipes included, and parameter labels read as words.
Dependencies
- Two new packages,
@bitbybit-dev/ifcand@bitbybit-dev/ifc-worker, published at 1.5.0 like the rest of the workspace. - No engine version changes: BabylonJS 9.26, three.js 0.186, PlayCanvas 2.22, Manifold 3.5.3 and JSCAD 2.13, as in 1.4.
- OCCT kernels rebuilt (OCCT 8.0.1), all three variants, carrying push/pull, face removal with history and the design builds. They come with new hashed files, and
packages/dev/occt/kernels.jsoncarries their download URLs.