Skip to content

1.6.0

Choose a tag to compare

@matas-bitbybit-dev matas-bitbybit-dev released this 29 Oct 05:17
· 8 commits to master since this release
2ab11c8

Release Notes v1.6.0

This release adds standard mechanical parts: fasteners, gears, bearings, keys, retaining rings, springs and machining features to ISO, DIN and ANSI tables. bitbybit.engineering.mechanical holds the tables and needs no kernel. bitbybit.occt.parts.mechanical builds the solids from them. Units of length (millimetres, centimetres, metres and inches) now run through files and design documents. History versions of fillets, chamfers, drafts, features and operations say what became of every face. Design documents import STEP assemblies and cut section views, and IFC4X3 ADD2 models can now be edited. A memory round frees everything a call makes. The library gains 188 new functions (2,205 in all, up from 2,017).

No function was removed. A few package exports moved, though, and some outputs change. Read Upgrading from 1.5 below.


Upgrading from 1.5: what changes

  • Exports that moved or went:
    • base's beta recipe functions (checkRecipe, assertRecipe, toRecipe, recipeSurfaceMeshes, recipeSourceOf) are replaced by the recipes service: recipes.check, read, surfaceMeshes and sourceOf, which take DTOs. The ./lib/api/recipes subpath is gone.
    • Running OCCT without the worker: new OccHelper(occ) takes only the kernel, and VectorHelperService is gone. new OCCTService(occ) no longer needs a helper.
    • BaseBitByBit comes from @bitbybit-dev/base. @bitbybit-dev/occt/lib/base and @bitbybit-dev/manifold/lib/base are deleted.
    • base's internal helpers moved into folders by domain. They were never public API, but a deep import of one will break.
    • Deprecated: base's top-level srgbToLinear and linearToSrgb. Use color.srgbToLinear and color.linearToSrgb; the old ones leave the index in the next major version.
  • Types:
    • core's MeshData takes ArrayLike<number> for positions, indices, normals and colours, so code that calls array methods on them needs Array.from;
    • the renderers' DrawHelper takes DecomposedMeshDto | DecomposedMeshBuffersDto wherever it took a decomposed mesh, so subclasses need to follow;
    • Base.RecipeNode gains a brep node, and design features gain the six machining features, so exhaustive switches need new cases.
  • Outputs that change:
    • IFC geometry.toStep and toDocument write each product's property sets by default (propertySets: true). geometry.recipe leaves them out unless asked.
    • IFC advanced breps are read exactly, no longer as triangles.
    • pipeWireCylindrical and pipeWiresCylindrical build exact tubes, so results can differ slightly from 1.5.
    • A part placed in a design assembly exports to STEP as a part of its own, no longer as an instance.
    • JSCAD downloadGeometry3MF is written by the package itself. Each solid is its own object with its name and colour, 2D shapes and paths are left out, and it throws when there is no solid to write.
    • Babylon scene.clearAllDrawn disposes only the textures the drawing holds. Pipeline, post-process, probe and lookup textures stay.
  • Inputs that are now refused:
    • radii, pitches, heights and turn counts must be above zero;
    • a bad input throws an InputError that names the property, where 1.5 gave a kernel exception, a null shape or NaN;
    • new failure codes: occt.boolean.inconsistent, occt.draft.failed, occt.pipe.tooTight and occt.pipe.bendDoesNotFit.
  • Custom workers must be built from occt-worker 1.6. The renderers call new worker commands: shapeToMeshBuffers, shapesToMeshBuffers and deleteUnsharedShapes.
  • What stays the same when the new inputs are left out:
    • STEP and IGES still default to millimetres;
    • SVG, DXF and glTF write what they wrote before;
    • the clash prefilter (on by default) finds the same clashes, only faster.
  • Licence field: @bitbybit-dev/occt declares MIT AND Apache-2.0 AND LGPL-2.1-only WITH OCCT-exception-1.0, and its NOTICE lists the third-party licences its kernel carries. Licence scanners will see the new expression.

New: standard parts

Standard parts come in two halves that read the same tables. engineering.mechanical gives sizes, clearance holes and designations as plain data. occt.parts.mechanical builds the solids.

  • Families:
    • fasteners: socket head cap screws, hex bolts, hex nuts, washers, set screws (ISO and ANSI) and dowel pins;
    • gears: spur, helical, bevel and ring gears and racks, with their profiles;
    • bearings: ball bearings (ISO and ANSI);
    • keys and retaining rings (DIN and ANSI);
    • springs: compression springs and their paths;
    • machining: threads, keyways, ring grooves, knurls, splined shafts and hubs, and flats. Most come with a tool solid too, for cuts of your own.
  • Sizes:
    • threads run from M1.6 to M24 (ISO) and from #0 to 1" (Unified);
    • every lookup takes a unit, and defaults to millimetres for ISO and DIN, and inches for ANSI;
    • designations (sizes, pitches, modules, threads per inch, diametral pitch) stay in the standard's own terms.
  • Gear maths: gears.gearPair reports interference, tip shortening and clearance. internalGearPair, planetarySet and moduleFromDiametralPitch are there too.
  • Placing parts:
    • every part takes a frame: a fastener's origin is where it bears, and a gear is centred with a tooth along direction;
    • each part has a ...WithRoles version that returns { shape, roles, frames };
    • roles name every face: a bolt's head, seat, shank and thread, or a gear's tips, flanks, roots and bore;
    • frames are named places to put the next part, such as a bolt's seat or a gear's axis.
  • In design documents:
    • gear and rack sketch elements;
    • holes sized by a fastener, picked by standard, size, series and fit;
    • keyway, flat, ring groove, knurl, spline and thread features, which size themselves to the cylinder they are put on;
    • design.clashes ignores a fastener's thread resting in a tapped hole.

New: units of length

Base.unitOfLengthEnum is mm, cm, m or in. Learn more.

  • Conversion: math.convertLength, math.millimetresPerUnit, and math.toFractionText for inch fractions.
  • Files:
    • STEP: io.saveShapeSTEP writes millimetres, scaling the shape from its unit, and io.loadSTEPorIGES returns the shape scaled into a unit;
    • reading a file's unit: io.fileLengthUnit reads the unit a STEP or IGES file states, gzipped too;
    • SVG states its true size, DXF writes $INSUNITS, and glTF and GLB exports with a unit are written in metres.
  • Design documents:
    • they carry units.length, and parameters, operations and standard parts follow it;
    • imports and design.fromStep scale into it;
    • fraction() writes inch sizes;
    • TypeScript exports name the unit.

OCCT: histories, sections, STEP to design documents

  • 30 new history versions. Each returns { shape, history }, saying what became of every face, edge and vertex as the indexes selectors and fillets take. How to use a history.

    • fillets: every fillet and chamfer variant, variable radius included;
    • draft: draftAngle, makeDraft and makeDraftToShape;
    • features: groove, rib, revolved and tapered bosses and pockets;
    • operations: offset, advanced offset, pipes, rotated extrusion and split;
    • shapes: unifySameDomain, sewFaces and the new solid.fromFaces.
  • design.fromStep turns a STEP file into design documents:

    • one per assembly and one per part, placed as the file places them, with names and colours;
    • a part placed many times stays one document, while a mirrored or scaled one gets its own.
  • design.section cuts a design build with a frame's plane and caps every part it crosses. With cut, the parts behind the plane come too, and the drawers draw it all.

  • operations.sectionByFrames and cutByFrames:

    • cut faces or wires through several planes, or keep what lies behind them (behindAll for a section box, or behindAny);
    • cut solids stay closed, and a compound may mix solids and sheets.

    Section views.

  • Also new:

    • face.createFaceBoundedByWiresOnFace;
    • recipes.describe, which gives any shape as one exact recipe step;
    • bendRadius on cylindrical pipes;
    • a clash prefilter.
  • Meshes as typed buffers. Shapes can be meshed into Float32Array and Uint32Array buffers (DecomposedMeshBuffersDto) that the worker hands over without copying. The three renderers draw from them.


IFC

  • IFC4X3 ADD2 models are editable in their own schema.
  • Edits to files with owner histories are recorded as added or modified.
  • Revit-style walls take their offset and thickness from their body, so walls.parameters and every wall edit work on them.
  • Clippings are listed so that Bonsai keeps them.
  • model.upgradeToIfc4 handles more of IFC2X3:
    • dates as text and renamed enums;
    • door and window styles as types;
    • 2D true north;
    • surface models and virtual space boundaries.
  • ifc.elements.add writes an element of any class from a recipe body, and ifc.elements.addShape does it from an OCCT shape in one call.
  • Property sets reach recipes (when asked) and STEP (by default).
  • model.remove takes a removed shape's aspects with it.

Recipes (beta)

  • An exact brep step:

    • edges: lines, circles, ellipses and B-splines;
    • faces: planes, cylinders, cones, spheres, tori, B-splines, and surfaces of revolution and extrusion.

    A brep step may list its solids and shells. It carries a fallback that Manifold builds into meshes.

  • occt.recipes.build builds brep steps exactly. occt.recipes.describe turns any shape into one.

  • The format checks are now the recipes service (check, read, sourceOf, surfaceMeshes). Recipes.


Base

  • mesh: fromIndexed, toIndexed, icosphere, frustum, smoothNormals, creasedNormals, orientConsistently, windingPieces, isPointInside and meshesWithin.
  • polyline: perimeter2d, signedArea2d, orient2d, isPointInside2d, roundCorners, roundCorners2d, tangents, sweepFrames and sweepPlacements.
  • color.srgbToLinear and color.linearToSrgb.
  • The maths lives once, in base. The other packages now use base's vector, matrix and angle arithmetic. Vectors, lengths and 2D orientation stay exact far from the origin.
  • The zip and gzip readers bound what an untrusted file can cost, for example an .ifczip. Output is capped, and overlapping entries are refused.

Memory

  • Every OCCT call frees what it made, including when it fails or is cancelled. A list method frees its earlier results when a later item fails.
  • Sweeps, slices and lofts work on a copy, so repeated calls no longer grow the shapes passed in.
  • The shapes design.build returns are yours to delete. An identical call returns the same shapes while they live. cleanAllCache also frees the design caches.
  • Redraws free what they made, and only that:
    • Babylon materials go with their last mesh;
    • three.js points and PlayCanvas instance buffers are freed on redraw;
    • Manifold frees the intermediates of extrusions, splits and transforms.
  • Manifold and JSCAD draws send the worker only their inputs. A colour change no longer re-meshes the shape, and the "is not an input of this operation" warnings are gone.
  • A malformed mesh is refused before anything is added to the scene.
  • A kernel ledger and a heap probe in the test suites keep it this way.

Fixes

  • OCCT:
    • lofts between sections with different edge counts give valid solids;
    • faces from wires cut their holes whichever way the wires run;
    • periodic interpolation is smooth (C2) at the seam;
    • degenerate edges answer with their point, so tracing spheres and cones works.
  • Base:
    • vector.angleBetween no longer gives NaN for parallel vectors, and vector.normalized never overflows;
    • curved faces mesh without flipping edges, and a B-spline cone meshes 20 times faster;
    • the DXF writer numbers each file's handles from the start.
  • IFC:
    • wall quantities stay exact at survey coordinates, where a clipped gable wall far out used to measure 0;
    • a placement with its axis along X and no reference direction builds;
    • holes touching an outline are accepted on every side.
  • Renderers:
    • a face of about 50,000 points no longer overflows the call stack;
    • faces sharing an index are all drawn;
    • updatable points take a new colour, opacity and size;
    • Babylon updatable surfaces no longer vanish;
    • three.js JSCAD solids redrawn in place keep their transform;
    • PlayCanvas draws mirrored JSCAD solids mirrored.
  • JSCAD 3MF: files open in strict readers, meshes are closed and oriented, and names are escaped.
  • Manifold loads under a Content Security Policy without unsafe-eval.

Tooling, packaging & docs

  • learn.bitbybit.dev:
    • a Standard parts section: fasteners, gears, bearings, keys, rings and springs, and machining, with examples that run in Rete, Blockly and TypeScript;
    • units on the Designer's units page and on the STEP, export and base maths pages;
    • the base pages rewritten for colour, maths, meshes, polylines and recipes;
    • histories explained once and named on every page that has one;
    • the IFC page covers reading files, .ifczip, upgrades and property sets;
    • the Designer pages cover machining, gears, the standard parts library, Measure, Section view and the single-cylinder engine;
    • the 3D Bits pages cover the screenshot element, page-address elements, pinned panel zones and pricing with the merchant's own products;
    • moved pages redirect permanently.
  • New blog post: Introducing the Designer, parametric CAD by clicking, built for people and agents.
  • MCP server (@bitbybit-dev/mcp): the guides cover units, standard parts with their roles, the machining features, reading IFC4X3 and property sets. They point at the 1.6.0 design document schema.
  • create-app: every template runs on the new engines and new OCCTService(occ), and passes the nightly smoke test. ifc-house draws the house in batched, instanced calls.
  • Examples: Next.js 16.4.1 and Nuxt 4.6.2. The Angular, webpack and Node examples are set up for manifold-3d 3.5.
  • CAD Cloud SDK: outputs.unit with a LengthUnit type, unit on STEP and IGES loading, and pipeline types for the standard parts, sections and recipes.describe.
  • Lint: no-local-maths keeps vector, matrix and angle arithmetic in base. Property tests use fast-check.
  • Translations: 1,751 new help texts in each of the 17 languages; every language covers every English text.

Dependencies

  • Engines:
    • Babylon.js 9.32.0, was 9.26.0;
    • three.js 0.186.1, was 0.186.0;
    • PlayCanvas 2.23.3, was 2.22.2;
    • manifold-3d 3.5.4, was 3.5.3;
    • JSCAD 2.13 and Havok 1.3.13 are unchanged.
  • @bitbybit-dev/jscad drops @jscad/3mf-serializer and takes fflate 0.8.3.
  • @bitbybit-dev/mcp: MCP server SDK 2.3.1 and zod 4.6.7.
  • No new packages. @bitbybit-dev/base exports ./lib/api/services/engineering and ./lib/api/services/engineering/mechanical.
  • OCCT kernels rebuilt, all three variants, with new hashed files. packages/dev/occt/kernels.json carries their download URLs.