Repository navigation
1.6.0
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 therecipesservice:recipes.check,read,surfaceMeshesandsourceOf, which take DTOs. The./lib/api/recipessubpath is gone. - Running OCCT without the worker:
new OccHelper(occ)takes only the kernel, andVectorHelperServiceis gone.new OCCTService(occ)no longer needs a helper. BaseBitByBitcomes from@bitbybit-dev/base.@bitbybit-dev/occt/lib/baseand@bitbybit-dev/manifold/lib/baseare 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
srgbToLinearandlinearToSrgb. Usecolor.srgbToLinearandcolor.linearToSrgb; the old ones leave the index in the next major version.
- base's beta recipe functions (
- Types:
- core's
MeshDatatakesArrayLike<number>for positions, indices, normals and colours, so code that calls array methods on them needsArray.from; - the renderers'
DrawHelpertakesDecomposedMeshDto | DecomposedMeshBuffersDtowherever it took a decomposed mesh, so subclasses need to follow; Base.RecipeNodegains abrepnode, and design features gain the six machining features, so exhaustive switches need new cases.
- core's
- Outputs that change:
- IFC
geometry.toStepandtoDocumentwrite each product's property sets by default (propertySets: true).geometry.recipeleaves them out unless asked. - IFC advanced breps are read exactly, no longer as triangles.
pipeWireCylindricalandpipeWiresCylindricalbuild 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
downloadGeometry3MFis 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.clearAllDrawndisposes only the textures the drawing holds. Pipeline, post-process, probe and lookup textures stay.
- IFC
- Inputs that are now refused:
- radii, pitches, heights and turn counts must be above zero;
- a bad input throws an
InputErrorthat 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.tooTightandocct.pipe.bendDoesNotFit.
- Custom workers must be built from
occt-worker1.6. The renderers call new worker commands:shapeToMeshBuffers,shapesToMeshBuffersanddeleteUnsharedShapes. - 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/occtdeclaresMIT 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.gearPairreports interference, tip shortening and clearance.internalGearPair,planetarySetandmoduleFromDiametralPitchare 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
...WithRolesversion that returns{ shape, roles, frames }; rolesname every face: a bolt's head, seat, shank and thread, or a gear's tips, flanks, roots and bore;framesare named places to put the next part, such as a bolt'sseator a gear'saxis.
- every part takes a frame: a fastener's origin is where it bears, and a gear is centred with a tooth along
- 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.clashesignores 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, andmath.toFractionTextfor inch fractions. - Files:
- STEP:
io.saveShapeSTEPwrites millimetres, scaling the shape from itsunit, andio.loadSTEPorIGESreturns the shape scaled into aunit; - reading a file's unit:
io.fileLengthUnitreads the unit a STEP or IGES file states, gzipped too; - SVG states its true size, DXF writes
$INSUNITS, and glTF and GLB exports with aunitare written in metres.
- STEP:
- Design documents:
- they carry
units.length, and parameters, operations and standard parts follow it; - imports and
design.fromStepscale into it; fraction()writes inch sizes;- TypeScript exports name the unit.
- they carry
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,makeDraftandmakeDraftToShape;features: groove, rib, revolved and tapered bosses and pockets;operations: offset, advanced offset, pipes, rotated extrusion and split;shapes:unifySameDomain,sewFacesand the newsolid.fromFaces.
-
design.fromStepturns 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.sectioncuts a design build with a frame's plane and caps every part it crosses. Withcut, the parts behind the plane come too, and the drawers draw it all. -
operations.sectionByFramesandcutByFrames:- cut faces or wires through several planes, or keep what lies behind them (
behindAllfor a section box, orbehindAny); - cut solids stay closed, and a compound may mix solids and sheets.
- cut faces or wires through several planes, or keep what lies behind them (
-
Also new:
face.createFaceBoundedByWiresOnFace;recipes.describe, which gives any shape as one exact recipe step;bendRadiuson cylindrical pipes;- a clash
prefilter.
-
Meshes as typed buffers. Shapes can be meshed into
Float32ArrayandUint32Arraybuffers (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.parametersand every wall edit work on them. - Clippings are listed so that Bonsai keeps them.
model.upgradeToIfc4handles 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.addwrites an element of any class from a recipe body, andifc.elements.addShapedoes it from an OCCT shape in one call.- Property sets reach recipes (when asked) and STEP (by default).
model.removetakes a removed shape's aspects with it.
Recipes (beta)
-
An exact
brepstep:- 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.buildbuilds brep steps exactly.occt.recipes.describeturns any shape into one. -
The format checks are now the
recipesservice (check,read,sourceOf,surfaceMeshes). Recipes.
Base
mesh:fromIndexed,toIndexed,icosphere,frustum,smoothNormals,creasedNormals,orientConsistently,windingPieces,isPointInsideandmeshesWithin.polyline:perimeter2d,signedArea2d,orient2d,isPointInside2d,roundCorners,roundCorners2d,tangents,sweepFramesandsweepPlacements.color.srgbToLinearandcolor.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.buildreturns are yours to delete. An identical call returns the same shapes while they live.cleanAllCachealso 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.angleBetweenno longer gives NaN for parallel vectors, andvector.normalizednever 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-housedraws 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.unitwith aLengthUnittype,uniton STEP and IGES loading, and pipeline types for the standard parts, sections andrecipes.describe. - Lint:
no-local-mathskeeps 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/jscaddrops@jscad/3mf-serializerand takesfflate0.8.3.@bitbybit-dev/mcp: MCP server SDK 2.3.1 and zod 4.6.7.- No new packages.
@bitbybit-dev/baseexports./lib/api/services/engineeringand./lib/api/services/engineering/mechanical. - OCCT kernels rebuilt, all three variants, with new hashed files.
packages/dev/occt/kernels.jsoncarries their download URLs.