Skip to content

1.5.0

Choose a tag to compare

@matas-bitbybit-dev matas-bitbybit-dev released this 12 Oct 09:05
· 82 commits to master since this release
40a0b05

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. computeNormals on DrawManifoldOrCrossSectionDto and DrawManifoldsOrCrossSectionsDto is now true, was false. A new minSharpAngle (default 40°) keeps sharper edges crisp. Pass computeNormals: false for 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 fillet2d leaves a straight corner as it is instead of failing on it.
  • Types:
    • Base.Polyline2 and Base.Polyline3 take a color of string | number[], so code that reads color as number[] needs a check.
    • createWorkersFromUrls takes WorkerUrls, which adds an optional ifcWorkerUrl.

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 .ifczip archives. An IFC2X3 file is read through IFC4, and model.upgradeToIfc4 makes 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.writeBytes copies untouched entities byte for byte.
  • 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.recipe describes what a model draws;
    • toShapes, toStep and toDocument build exact OpenCascade shapes and a STEP file nested by site, building, storey and IFC class;
    • model.georeference reads a model's map conversion.
  • @bitbybit-dev/ifc-worker runs the same API in a web worker. The BabylonJS, three.js and PlayCanvas packages start it beside the other workers and expose it as bitbybit.ifc.
  • Checked against IfcOpenShell on a corpus of 52 public, licensed IFC files, twice a week in CI (npm run ifc:corpus).
  • Examples:

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, or offset) 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.referenceFor names 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.clashes finds 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;
    • setMeshRetention caps the triangulations a kernel keeps.
  • The schema ships in @bitbybit-dev/occt under schemas/design-document/ and on the release CDN, one per release. The format is experimental: documents carry "schemaVersion": 1 and 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, pushPullFacesWithHistory and removeFacesWithHistory;
    • operations: loftWithHistory, loftAdvancedWithHistory, pipeWithHistory, makeThickSolidSimpleWithHistory and makeThickSolidByJoinWithHistory;
    • 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.saveShapeBrepBinary and io.loadBrepBinary: compact binary BREP.
  • analysis.signatures: shape signatures that tell whether two shapes are the same.
  • purgeInternalEdges works 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, meshes and surfaceMeshes.
  • OCCT builds it exactly: occt.recipes.build and buildDocument.
  • The three renderers draw it batched and instanced, and pick, colour and hide its elements: draw.optionsRecipeMeshes, recipeElementOfPick, setRecipeElementsColour and setRecipeElementsVisible.

Manifold cross sections gain operations.loft and operations.sweep.


Base

  • mesh.triangulatePolygon, mesh.signedVolume, polyline.polygonNormal, polyline.polygonArea and point.arcThroughThreePoints.
  • Polyline colours may be hex text.
  • Manifold meshes take their drawing normals from the kernel, smooth below minSharpAngle and 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.addControls takes a full-screen or a mesh UI.
  • adjustYtoZ is 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):

    • describe answers 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-house template.

  • 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, and LINT.md holds the lint policy.
    • Lint is stricter, with a ratchet.
    • base shares vector and placement maths, hashing and sRGB conversion.
  • 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/ifc and @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.json carries their download URLs.