@bitbybit-dev/mcp 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @bitbybit-dev/mcp: the Bitbybit CAD MCP server
2
2
 
3
- An [MCP](https://modelcontextprotocol.io) server that documents the [Bitbybit](https://bitbybit.dev) 3D CAD API for AI coding agents: every function, its parameters, defaults, return type and examples, for the exact version your project uses. Bitbybit has 2205 functions across three CAD kernels - more than any model holds in memory - so an agent working from memory invents plausible names that do not exist. An agent with this server looks each one up instead, and writes code that compiles the first time.
3
+ An [MCP](https://modelcontextprotocol.io) server that documents the [Bitbybit](https://bitbybit.dev) 3D CAD API for AI coding agents: every function, its parameters, defaults, return type and examples, for the exact version your project uses. Bitbybit has 2240 functions across three CAD kernels - more than any model holds in memory - so an agent working from memory invents plausible names that do not exist. An agent with this server looks each one up instead, and writes code that compiles the first time.
4
4
 
5
5
  It answers from the API index Bitbybit publishes with every release (`https://git-cdn.bitbybit.dev/v<version>/ai-context/index.json`), never from memory, and never from a moving "latest".
6
6
 
@@ -73,7 +73,7 @@ export const GUIDES = [
73
73
  "id": "pro-algorithms",
74
74
  "title": "Pro algorithms",
75
75
  "level": 2,
76
- "body": "Some algorithms are available on CAD Cloud only, such as sheet-metal unfolding. They are verified against reference parts, expensive to maintain, and priced for it. An agent discovers them the same way as everything else: `describe` reports the tier `cloud-pro`, the endpoint and the API key scope. The [CAD Cloud page](https://bitbybit.dev/cad-cloud) lists the plans.",
76
+ "body": "Some algorithms are available on CAD Cloud only, such as sheet-metal unfolding and true-shape nesting of flat parts on sheets. They are verified against reference parts, expensive to maintain, and priced for it. An agent discovers them the same way as everything else: `describe` reports the tier `cloud-pro`, the endpoint and the API key scope. The [CAD Cloud page](https://bitbybit.dev/cad-cloud) lists the plans.",
77
77
  "page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/agentic-cad"
78
78
  },
79
79
  {
@@ -129,7 +129,7 @@ export const GUIDES = [
129
129
  "id": "how-the-bitbybit-occt-kernel-thinks",
130
130
  "title": "How the Bitbybit OCCT Kernel thinks",
131
131
  "level": 2,
132
- "body": "- **Y is up.** The ground is the XZ plane. A box's `height` runs along Y, a cylinder grows along its `direction`, `[0, 1, 0]` unless given, and a rectangle or circle wire lies flat on the ground unless its `direction`, the normal of its plane, says otherwise. Manifold and JSCAD build along Z instead: their cylinders stand on the XY plane.\n- **Shapes nest.** A vertex is a point, an edge a curve between vertices, a wire a chain of edges, a face a surface bounded by wires, a shell faces joined at their edges, a solid the volume a closed shell bounds, and a compound a group of shapes kept apart. Each method says which kinds it takes and gives: `operations.extrude` turns a face into a solid, but a wire only into a shell.\n- **Units are plain numbers.** Model in whichever unit the part is drawn in; angles are degrees, and tolerances are in the model's units. A file says its unit only when told it: give `io.saveShapeSTEP` the `unit` the part is modelled in (`Bit.Inputs.Base.unitOfLengthEnum.inch`, say) and it is written at its true size, in millimetres; `io.loadSTEPorIGES` takes the `unit` to bring a file in at, and `io.fileLengthUnit` tells the unit a STEP or IGES file states.\n- **Right-handed.** OpenCascade is right-handed, as three.js and PlayCanvas are. A Babylon.js scene is left-handed, and shows every part mirrored, unless `scene.useRightHandedSystem` is set when it is created.\n- **Colours** are hex strings such as `\"#ff8000\"`, or arrays of three numbers from 0 to 1.",
132
+ "body": "- **Y is up.** The ground is the XZ plane. A box's `height` runs along Y, a cylinder grows along its `direction`, `[0, 1, 0]` unless given, and a rectangle or circle wire lies flat on the ground unless its `direction`, the normal of its plane, says otherwise. Manifold and JSCAD build along Z instead: their cylinders stand on the XY plane.\n- **Shapes nest.** A vertex is a point, an edge a curve between vertices, a wire a chain of edges, a face a surface bounded by wires, a shell faces joined at their edges, a solid the volume a closed shell bounds, and a compound a group of shapes kept apart. Each method says which kinds it takes and gives: `operations.extrude` turns a face into a solid, but a wire only into a shell.\n- **Units are plain numbers.** Model in whichever unit the part is drawn in; angles are degrees, and tolerances are in the model's units. A file says its unit only when told it: give `io.saveShapeSTEP` the `unit` the part is modelled in (`Bit.Inputs.Base.unitOfLengthEnum.inch`, say) and it is written at its true size, in millimetres; `io.loadSTEPorIGES` takes the `unit` to bring a file in at, and `io.fileLengthUnit` tells the unit a STEP or IGES file states.\n- **Right-handed.** OpenCascade is right-handed, as three.js and PlayCanvas are. A Babylon.js scene is left-handed and draws the kernel's numbers as they are, which is the mirror image of the model. Set the conventions once, `await bitbybit.setConventions(1)` after `init` or `conventions: 1` in the options of `initBitByBit`, and the library speaks the engine's own coordinate system: a file matches the screen, and a shape that names a hand, a thread or a helix's `clockwise`, shows that hand. Left out, the libraries behave as they did before the setting existed, so an existing app never changes on its own.\n- **Colours** are hex strings such as `\"#ff8000\"`, or arrays of three numbers from 0 to 1.",
133
133
  "page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/cad-geometry"
134
134
  },
135
135
  {
@@ -164,7 +164,7 @@ export const GUIDES = [
164
164
  "id": "drawing-and-exporting-a-part",
165
165
  "title": "Drawing and exporting a part",
166
166
  "level": 2,
167
- "body": "- **Drawing.** In the browser and in the editors, `draw.drawAnyAsync({ entity: shape, options })` draws any shape, mesh or point list; for OpenCascade shapes `options` is an `Inputs.Draw.DrawOcctShapeOptions`, with `faceColour`, `edgeColour`, `edgeWidth` and `precision`, the meshing tolerance. Draw the finished part rather than every step.\n- **STEP**, the exact format other CAD tools open: `io.saveShapeSTEPAndReturn` through the worker, `io.saveShapeSTEP` on the in-process service in Node, both giving the file's text in millimetres, the shape scaled from the `unit` it is modelled in when one is given. Most CAD tools are Z-up: turn the part first with `transforms.rotate({ shape, axis: [1, 0, 0], angle: 90 })`, which takes Y up to Z and keeps the part as it was built. The `adjustYtoZ` option swaps Y and Z instead, which mirrors the part: it matches what a left-handed Babylon.js scene shows.\n- **STL** for printing: `io.saveShapeStlAndReturn` through the worker, `io.saveShapeStl` in Node, with `precision` as the meshing tolerance and `binary` for the smaller form. Turn the part as for STEP.\n- **Drawings and assemblies.** `io.shapeToDxfPaths` and `io.dxfCreate` write a DXF of flat geometry, and the documents of `occt.assembly.manager` hold several parts with names, colours and placements, written to one STEP file with `occt.assembly.manager.exportDocumentToStep`.",
167
+ "body": "- **Drawing.** In the browser and in the editors, `draw.drawAnyAsync({ entity: shape, options })` draws any shape, mesh or point list; for OpenCascade shapes `options` is an `Inputs.Draw.DrawOcctShapeOptions`, with `faceColour`, `edgeColour`, `edgeWidth` and `precision`, the meshing tolerance. Draw the finished part rather than every step.\n- **STEP**, the exact format other CAD tools open: `io.saveShapeSTEPAndReturn` through the worker, `io.saveShapeSTEP` on the in-process service in Node, both giving the file's text in millimetres, the shape scaled from the `unit` it is modelled in when one is given. Most CAD tools are Z-up. With the conventions set, `adjustYtoZ: true` writes a Z-up file that shows what the screen shows, in every engine. Without them, turn the part first with `transforms.rotate({ shape, axis: [1, 0, 0], angle: 90 })`, which takes Y up to Z and keeps the part as it was built; there `adjustYtoZ` swaps Y and Z instead, which mirrors the part and matches what a left-handed Babylon.js scene shows.\n- **STL** for printing: `io.saveShapeStlAndReturn` through the worker, `io.saveShapeStl` in Node, with `precision` as the meshing tolerance and `binary` for the smaller form. Turn the part as for STEP.\n- **Drawings and assemblies.** `io.shapeToDxfPaths` and `io.dxfCreate` write a DXF of flat geometry, and the documents of `occt.assembly.manager` hold several parts with names, colours and placements, written to one STEP file with `occt.assembly.manager.exportDocumentToStep`.",
168
168
  "page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/cad-geometry"
169
169
  },
170
170
  {
@@ -199,7 +199,7 @@ export const GUIDES = [
199
199
  "id": "a-first-document",
200
200
  "title": "A first document",
201
201
  "level": 2,
202
- "body": "A plate with two holes and rounded top edges, made of aluminium, with a part number written from its size:\n\n```json title=\"bracket.design.json\"\n{\n \"$schema\": \"https://git-cdn.bitbybit.dev/v1.6.1/schemas/design-document/experimental.json\",\n \"schemaVersion\": 1,\n \"id\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\",\n \"meta\": { \"name\": \"Bracket\" },\n \"parameters\": {\n \"width\": { \"value\": 60, \"min\": 30, \"unit\": \"mm\" },\n \"depth\": { \"value\": 40, \"min\": 20, \"unit\": \"mm\" },\n \"thickness\": { \"value\": 6, \"min\": 2, \"unit\": \"mm\" },\n \"hole\": { \"value\": 6, \"min\": 2, \"max\": 12, \"unit\": \"mm\" }\n },\n \"features\": [\n {\n \"id\": \"base\", \"type\": \"sketch\", \"on\": { \"plane\": \"XY\" }, \"start\": [0, 0],\n \"pen\": [\n { \"type\": \"hLine\", \"id\": \"south\", \"length\": \"width\" },\n { \"type\": \"vLine\", \"id\": \"east\", \"length\": \"depth\" },\n { \"type\": \"hLine\", \"id\": \"north\", \"length\": \"-width\" },\n { \"type\": \"close\", \"id\": \"west\" }\n ]\n },\n { \"id\": \"plate\", \"type\": \"extrude\", \"profile\": \"base\", \"distance\": \"thickness\" },\n {\n \"id\": \"holes\", \"type\": \"hole\", \"body\": \"plate\",\n \"on\": { \"of\": \"plate\", \"role\": \"end\", \"count\": 1 },\n \"at\": [{ \"id\": \"left\", \"x\": 10, \"y\": \"depth / 2\" }, { \"id\": \"right\", \"x\": \"width - 10\", \"y\": \"depth / 2\" }],\n \"diameter\": \"hole\"\n },\n {\n \"id\": \"round\", \"type\": \"fillet\", \"body\": \"plate\", \"radius\": 2,\n \"edges\": { \"between\": [{ \"of\": \"plate\", \"role\": \"end\" }, { \"of\": \"plate\", \"role\": \"side\" }], \"count\": 4 }\n }\n ],\n \"materials\": [\n { \"id\": \"aluminium\", \"density\": 2700, \"appearance\": { \"color\": \"#b0b4b8\", \"metallic\": 0.8, \"roughness\": 0.4 } }\n ],\n \"parts\": [\n {\n \"id\": \"bracket\", \"name\": \"Bracket\", \"body\": \"plate\", \"material\": \"aluminium\",\n \"properties\": { \"partNumber\": \"BRK-{width}x{depth}\" },\n \"connectors\": [\n { \"id\": \"pivotTop\", \"on\": { \"of\": \"plate\", \"role\": \"end\", \"count\": 1 }, \"axis\": { \"of\": \"holes\", \"role\": \"wall\", \"from\": \"left\" } },\n { \"id\": \"pivotBottom\", \"on\": { \"of\": \"plate\", \"role\": \"start\", \"count\": 1 }, \"axis\": { \"of\": \"holes\", \"role\": \"wall\", \"from\": \"left\" } }\n ]\n }\n ]\n}\n```\n\n- The sketch draws a rectangle with a pen: each command moves from where the last one ended, and `close` returns to `start`. The command ids name the four side faces the extrude sweeps from them.\n- The extrude starts a body named `plate`. Its bottom face is `start`, its top `end` and its walls `side`.\n- The holes are placed on the face the reference `{ \"of\": \"plate\", \"role\": \"end\", \"count\": 1 }` names, at x and y on that face. Each position has an id, so a later reference can name one hole's wall.\n- The fillet rounds the edges between the top and the walls: exactly 4, or the build reports otherwise.\n- The connectors are frames where an assembly fastens the part: on the top and the bottom face, at the left hole's axis.",
202
+ "body": "A plate with two holes and rounded top edges, made of aluminium, with a part number written from its size:\n\n```json title=\"bracket.design.json\"\n{\n \"$schema\": \"https://git-cdn.bitbybit.dev/v1.7.0/schemas/design-document/experimental.json\",\n \"schemaVersion\": 1,\n \"id\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\",\n \"meta\": { \"name\": \"Bracket\" },\n \"parameters\": {\n \"width\": { \"value\": 60, \"min\": 30, \"unit\": \"mm\" },\n \"depth\": { \"value\": 40, \"min\": 20, \"unit\": \"mm\" },\n \"thickness\": { \"value\": 6, \"min\": 2, \"unit\": \"mm\" },\n \"hole\": { \"value\": 6, \"min\": 2, \"max\": 12, \"unit\": \"mm\" }\n },\n \"features\": [\n {\n \"id\": \"base\", \"type\": \"sketch\", \"on\": { \"plane\": \"XY\" }, \"start\": [0, 0],\n \"pen\": [\n { \"type\": \"hLine\", \"id\": \"south\", \"length\": \"width\" },\n { \"type\": \"vLine\", \"id\": \"east\", \"length\": \"depth\" },\n { \"type\": \"hLine\", \"id\": \"north\", \"length\": \"-width\" },\n { \"type\": \"close\", \"id\": \"west\" }\n ]\n },\n { \"id\": \"plate\", \"type\": \"extrude\", \"profile\": \"base\", \"distance\": \"thickness\" },\n {\n \"id\": \"holes\", \"type\": \"hole\", \"body\": \"plate\",\n \"on\": { \"of\": \"plate\", \"role\": \"end\", \"count\": 1 },\n \"at\": [{ \"id\": \"left\", \"x\": 10, \"y\": \"depth / 2\" }, { \"id\": \"right\", \"x\": \"width - 10\", \"y\": \"depth / 2\" }],\n \"diameter\": \"hole\"\n },\n {\n \"id\": \"round\", \"type\": \"fillet\", \"body\": \"plate\", \"radius\": 2,\n \"edges\": { \"between\": [{ \"of\": \"plate\", \"role\": \"end\" }, { \"of\": \"plate\", \"role\": \"side\" }], \"count\": 4 }\n }\n ],\n \"materials\": [\n { \"id\": \"aluminium\", \"density\": 2700, \"appearance\": { \"color\": \"#b0b4b8\", \"metallic\": 0.8, \"roughness\": 0.4 } }\n ],\n \"parts\": [\n {\n \"id\": \"bracket\", \"name\": \"Bracket\", \"body\": \"plate\", \"material\": \"aluminium\",\n \"properties\": { \"partNumber\": \"BRK-{width}x{depth}\" },\n \"connectors\": [\n { \"id\": \"pivotTop\", \"on\": { \"of\": \"plate\", \"role\": \"end\", \"count\": 1 }, \"axis\": { \"of\": \"holes\", \"role\": \"wall\", \"from\": \"left\" } },\n { \"id\": \"pivotBottom\", \"on\": { \"of\": \"plate\", \"role\": \"start\", \"count\": 1 }, \"axis\": { \"of\": \"holes\", \"role\": \"wall\", \"from\": \"left\" } }\n ]\n }\n ]\n}\n```\n\n- The sketch draws a rectangle with a pen: each command moves from where the last one ended, and `close` returns to `start`. The command ids name the four side faces the extrude sweeps from them.\n- The extrude starts a body named `plate`. Its bottom face is `start`, its top `end` and its walls `side`.\n- The holes are placed on the face the reference `{ \"of\": \"plate\", \"role\": \"end\", \"count\": 1 }` names, at x and y on that face. Each position has an id, so a later reference can name one hole's wall.\n- The fillet rounds the edges between the top and the walls: exactly 4, or the build reports otherwise.\n- The connectors are frames where an assembly fastens the part: on the top and the bottom face, at the left hole's axis.",
203
203
  "page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/design-documents"
204
204
  },
205
205
  {
@@ -248,7 +248,7 @@ export const GUIDES = [
248
248
  "id": "assemblies",
249
249
  "title": "Assemblies",
250
250
  "level": 2,
251
- "body": "An assembly places parts of other documents. The documents are given to the build beside it, keyed by their `id`; the runner fetches nothing.\n\n```json title=\"hinge.design.json\"\n{\n \"$schema\": \"https://git-cdn.bitbybit.dev/v1.6.1/schemas/design-document/experimental.json\",\n \"schemaVersion\": 1,\n \"kind\": \"assembly\",\n \"meta\": { \"name\": \"Swivel pair\" },\n \"parameters\": {\n \"swing\": { \"value\": 30, \"min\": 0, \"max\": 90, \"unit\": \"deg\" }\n },\n \"components\": [\n { \"id\": \"lower\", \"source\": { \"document\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\", \"part\": \"bracket\" } },\n { \"id\": \"upper\", \"source\": { \"document\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\", \"part\": \"bracket\", \"parameters\": { \"width\": 80 } } }\n ],\n \"joints\": [\n {\n \"id\": \"pivot\", \"type\": \"revolute\", \"component\": \"upper\", \"connector\": \"pivotBottom\",\n \"to\": { \"component\": \"lower\", \"connector\": \"pivotTop\" },\n \"angle\": \"swing\", \"limits\": { \"angle\": [0, 90] }\n }\n ]\n}\n```\n\n- Build it with the documents it places: `build({ document: hinge, documents: [bracket] })`. The result has the parts, every placed occurrence with its matrix, the bill of materials, and the structure that `assembly.manager.buildAssemblyDocument` exports to STEP and glTF.\n- **Joints** put a component's connector against another's, faces meeting and facing each other: `fastened` moves nothing, `revolute` turns by `angle` about the shared axis, `slider` moves by `offset` along it, `cylindrical` does both. `flip` makes the faces face the same way, `limits` bound what may move, and joints form a tree.\n- **`replicate`** places a component on every member of a connector set, such as a bolt in every hole of a flange: `\"replicate\": { \"connector\": \"seat\", \"to\": { \"component\": \"flange\", \"connector\": \"bolts\" } }`.\n- **`pattern`** places copies of a component where it is placed, turned about an axis or stepped along a direction, such as the blades of a fan: `\"pattern\": { \"polar\": { \"axis\": { \"origin\": [0, 0, 0], \"direction\": [1, 0, 0] }, \"count\": \"blades\" } }`, or `{ \"linear\": { \"direction\": [1, 0, 0], \"spacing\": 25, \"count\": 4 } }`. A polar pattern spaces its copies as the `polarPattern` feature does: a whole turn shared out, a part of one (`angle`) with both ends included, the first turned by `start`. Each copy is an occurrence of its own, `blade.1`, `blade.2` and so on, counted in the bill of materials. A patterned component is not moved by a joint or joined to; to turn a row of blades, pattern them inside a sub-assembly and join that.\n- A component's `source.parameters` drive the placed document's values from the assembly's own, so one parameter can size several parts.\n- **A gear pair** is one gear part document placed twice: its `module`, `teeth`, `width`, `bore` and `backlash` parameters feed a `gear` loop and a `circle` bore, an extrude, and a connector `{ \"id\": \"axis\", \"on\": { \"of\": \"gear\", \"role\": \"start\" } }`. Each component sets its `teeth` in `source.parameters`, and a revolute joint per gear holds its `axis` against a frame or a plate, `module * (teeth + otherTeeth) / 2` apart. Drive both angles from one parameter: `\"turn\"` on the first, `\"180 / 30 - turn * 20 / 30\"` on a 30-tooth second for a 20-tooth first, so the teeth fall into each other's gaps; `design.clashes` at a few values of `turn` through one tooth of the first proves they mesh.\n- **A standard part document** is one `operation` feature of `occt.parts` sized by its parameters, such as `{ \"id\": \"screw\", \"type\": \"operation\", \"operation\": \"occt.parts.mechanical.fasteners.iso.socketHeadCapScrew\", \"params\": { \"size\": { \"expr\": \"size\" }, \"length\": { \"expr\": \"length\" } } }` with `size` a choice parameter of `\"M3\"`, `\"M4\"` and so on (`fasteners.ansi` takes `\"#10\"`, `\"1/4\"` and a `series`), built in the document's unit, and connectors on the roles it names: a screw's `{ \"on\": { \"of\": \"screw\", \"role\": \"seat\" }, \"axis\": { \"of\": \"screw\", \"role\": \"thread\" } }`, a nut's or a washer's `seat` and `top`, a bearing's `innerStart` or `outerStart` with the `bore` or `outside` axis, a spring's `bottom` and `top`. Each component sets its own size, so one document places every screw of an assembly, and `replicate` puts one in every hole of a set.\n- An assembly may publish `connectors` of its components, so a larger assembly can join it as one unit.\n- **From a STEP file:** `occt.design.fromStep({ step, name })` writes an assembly document per assembly and a part document per part, placed `at` the file's frames, with names and colours, every part importing one shapes file by `child`. The documents are in `unit`, millimetres unless you choose centimetres, metres or inches, the shapes and placements scaled from the file's own. Store `assets[0].data` at its `uri`, then build the `root` document with `documents` and `assets: { [assets[0].id]: assets[0].data }`; `report.notes` says what changed on the way, such as a mirrored placement built into a part of its own.\n- **Section a build:** `occt.design.section({ build, frame })` cuts what `build` returned with the plane of a frame, taking away what lies on the side its normal points to, and gives a cap for each part the plane passes through, the faces it cuts with their `area`. With `cut: true` the pieces behind the plane and the parts wholly behind it come too, each with its `volume`. The result is placed like the build's parts, so `draw.drawAnyAsync({ entity: section })` draws it, and the same frame given to `operations.hiddenLines` looks at the cut.",
251
+ "body": "An assembly places parts of other documents. The documents are given to the build beside it, keyed by their `id`; the runner fetches nothing.\n\n```json title=\"hinge.design.json\"\n{\n \"$schema\": \"https://git-cdn.bitbybit.dev/v1.7.0/schemas/design-document/experimental.json\",\n \"schemaVersion\": 1,\n \"kind\": \"assembly\",\n \"meta\": { \"name\": \"Swivel pair\" },\n \"parameters\": {\n \"swing\": { \"value\": 30, \"min\": 0, \"max\": 90, \"unit\": \"deg\" }\n },\n \"components\": [\n { \"id\": \"lower\", \"source\": { \"document\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\", \"part\": \"bracket\" } },\n { \"id\": \"upper\", \"source\": { \"document\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\", \"part\": \"bracket\", \"parameters\": { \"width\": 80 } } }\n ],\n \"joints\": [\n {\n \"id\": \"pivot\", \"type\": \"revolute\", \"component\": \"upper\", \"connector\": \"pivotBottom\",\n \"to\": { \"component\": \"lower\", \"connector\": \"pivotTop\" },\n \"angle\": \"swing\", \"limits\": { \"angle\": [0, 90] }\n }\n ]\n}\n```\n\n- Build it with the documents it places: `build({ document: hinge, documents: [bracket] })`. The result has the parts, every placed occurrence with its matrix, the bill of materials, and the structure that `assembly.manager.buildAssemblyDocument` exports to STEP and glTF.\n- **Joints** put a component's connector against another's, faces meeting and facing each other: `fastened` moves nothing, `revolute` turns by `angle` about the shared axis, `slider` moves by `offset` along it, `cylindrical` does both. `flip` makes the faces face the same way, `limits` bound what may move, and joints form a tree.\n- **`replicate`** places a component on every member of a connector set, such as a bolt in every hole of a flange: `\"replicate\": { \"connector\": \"seat\", \"to\": { \"component\": \"flange\", \"connector\": \"bolts\" } }`.\n- **`pattern`** places copies of a component where it is placed, turned about an axis or stepped along a direction, such as the blades of a fan: `\"pattern\": { \"polar\": { \"axis\": { \"origin\": [0, 0, 0], \"direction\": [1, 0, 0] }, \"count\": \"blades\" } }`, or `{ \"linear\": { \"direction\": [1, 0, 0], \"spacing\": 25, \"count\": 4 } }`. A polar pattern spaces its copies as the `polarPattern` feature does: a whole turn shared out, a part of one (`angle`) with both ends included, the first turned by `start`. Each copy is an occurrence of its own, `blade.1`, `blade.2` and so on, counted in the bill of materials. A patterned component is not moved by a joint or joined to; to turn a row of blades, pattern them inside a sub-assembly and join that.\n- A component's `source.parameters` drive the placed document's values from the assembly's own, so one parameter can size several parts.\n- **A gear pair** is one gear part document placed twice: its `module`, `teeth`, `width`, `bore` and `backlash` parameters feed a `gear` loop and a `circle` bore, an extrude, and a connector `{ \"id\": \"axis\", \"on\": { \"of\": \"gear\", \"role\": \"start\" } }`. Each component sets its `teeth` in `source.parameters`, and a revolute joint per gear holds its `axis` against a frame or a plate, `module * (teeth + otherTeeth) / 2` apart. Drive both angles from one parameter: `\"turn\"` on the first, `\"180 / 30 - turn * 20 / 30\"` on a 30-tooth second for a 20-tooth first, so the teeth fall into each other's gaps; `design.clashes` at a few values of `turn` through one tooth of the first proves they mesh.\n- **A standard part document** is one `operation` feature of `occt.parts` sized by its parameters, such as `{ \"id\": \"screw\", \"type\": \"operation\", \"operation\": \"occt.parts.mechanical.fasteners.iso.socketHeadCapScrew\", \"params\": { \"size\": { \"expr\": \"size\" }, \"length\": { \"expr\": \"length\" } } }` with `size` a choice parameter of `\"M3\"`, `\"M4\"` and so on (`fasteners.ansi` takes `\"#10\"`, `\"1/4\"` and a `series`), built in the document's unit, and connectors on the roles it names: a screw's `{ \"on\": { \"of\": \"screw\", \"role\": \"seat\" }, \"axis\": { \"of\": \"screw\", \"role\": \"thread\" } }`, a nut's or a washer's `seat` and `top`, a bearing's `innerStart` or `outerStart` with the `bore` or `outside` axis, a spring's `bottom` and `top`. Each component sets its own size, so one document places every screw of an assembly, and `replicate` puts one in every hole of a set.\n- An assembly may publish `connectors` of its components, so a larger assembly can join it as one unit.\n- **From a STEP file:** `occt.design.fromStep({ step, name })` writes an assembly document per assembly and a part document per part, placed `at` the file's frames, with names and colours, every part importing one shapes file by `child`. The documents are in `unit`, millimetres unless you choose centimetres, metres or inches, the shapes and placements scaled from the file's own. Store `assets[0].data` at its `uri`, then build the `root` document with `documents` and `assets: { [assets[0].id]: assets[0].data }`; `report.notes` says what changed on the way, such as a mirrored placement built into a part of its own.\n- **Section a build:** `occt.design.section({ build, frame })` cuts what `build` returned with the plane of a frame, taking away what lies on the side its normal points to, and gives a cap for each part the plane passes through, the faces it cuts with their `area`. With `cut: true` the pieces behind the plane and the parts wholly behind it come too, each with its `volume`. The result is placed like the build's parts, so `draw.drawAnyAsync({ entity: section })` draws it, and the same frame given to `operations.hiddenLines` looks at the cut.",
252
252
  "page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/design-documents"
253
253
  },
254
254
  {
@@ -1 +1 @@
1
- {"version":3,"file":"guides.generated.js","sourceRoot":"","sources":["../src/guides.generated.ts"],"names":[],"mappings":"AAEA,oFAAoF;AACpF,MAAM,CAAC,MAAM,cAAc,GAAG,qEAAqE,CAAC;AAEpG;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAA4B;IAC3C;QACI,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,CAAC;QACV,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iCAAiC;QACvC,OAAO,EAAE,iCAAiC;QAC1C,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,83DAA83D;QACt4D,MAAM,EAAE,oEAAoE;KAC/E;CACJ,CAAC"}
1
+ {"version":3,"file":"guides.generated.js","sourceRoot":"","sources":["../src/guides.generated.ts"],"names":[],"mappings":"AAEA,oFAAoF;AACpF,MAAM,CAAC,MAAM,cAAc,GAAG,qEAAqE,CAAC;AAEpG;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAA4B;IAC3C;QACI,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,0jBAA0jB;QAClkB,MAAM,EAAE,qEAAqE;KAChF;IACD;QACI,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,0BAA0B;QACnC,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,6lCAA6lC;QACrmC,MAAM,EAAE,qEAAqE;KAChF;IACD;QACI,IAAI,EAAE,wCAAwC;QAC9C,OAAO,EAAE,wCAAwC;QACjD,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,qyGAAqyG;QAC7yG,MAAM,EAAE,qEAAqE;KAChF;IACD;QACI,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,oBAAoB;QAC7B,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,yOAAyO;QACjP,MAAM,EAAE,qEAAqE;KAChF;IACD;QACI,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,2YAA2Y;QACnZ,MAAM,EAAE,qEAAqE;KAChF;IACD;QACI,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,sBAAsB;QAC/B,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,6XAA6X;QACrY,MAAM,EAAE,qEAAqE;KAChF;IACD;QACI,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,4BAA4B;QAC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AAE,uBAAuB;QAChC,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,iqDAAiqD;QACzqD,MAAM,EAAE,oEAAoE;KAC/E;IACD;QACI,IAAI,EAAE,gCAAgC;QACtC,OAAO,EAAE,gCAAgC;QACzC,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,ilDAAilD;QACzlD,MAAM,EAAE,oEAAoE;KAC/E;IACD;QACI,IAAI,EAAE,yCAAyC;QAC/C,OAAO,EAAE,yCAAyC;QAClD,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,0/BAA0/B;QAClgC,MAAM,EAAE,oEAAoE;KAC/E;IACD;QACI,IAAI,EAAE,iCAAiC;QACvC,OAAO,EAAE,iCAAiC;QAC1C,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,83DAA83D;QACt4D,MAAM,EAAE,oEAAoE;KAC/E;CACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitbybit-dev/mcp",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "MCP server for the Bitbybit 3D CAD API: version-exact lookups of every function, its parameters, defaults and examples, for AI coding agents",
5
5
  "author": "Bit By Bit Developers",
6
6
  "license": "MIT",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "dev.bitbybit/cad",
4
4
  "title": "Bitbybit CAD MCP",
5
5
  "description": "Bitbybit 3D parametric CAD API, version-exact, for coding agents: search, describe, examples, guide",
6
- "version": "1.6.1",
6
+ "version": "1.7.0",
7
7
  "repository": {
8
8
  "url": "https://github.com/bitbybit-dev/bitbybit",
9
9
  "source": "github",
@@ -19,7 +19,7 @@
19
19
  "registryBaseUrl": "https://registry.npmjs.org",
20
20
  "identifier": "@bitbybit-dev/mcp",
21
21
  "runtimeHint": "npx",
22
- "version": "1.6.1",
22
+ "version": "1.7.0",
23
23
  "transport": {
24
24
  "type": "stdio"
25
25
  }
@@ -76,7 +76,7 @@ export const GUIDES: readonly GuideSection[] = [
76
76
  "id": "pro-algorithms",
77
77
  "title": "Pro algorithms",
78
78
  "level": 2,
79
- "body": "Some algorithms are available on CAD Cloud only, such as sheet-metal unfolding. They are verified against reference parts, expensive to maintain, and priced for it. An agent discovers them the same way as everything else: `describe` reports the tier `cloud-pro`, the endpoint and the API key scope. The [CAD Cloud page](https://bitbybit.dev/cad-cloud) lists the plans.",
79
+ "body": "Some algorithms are available on CAD Cloud only, such as sheet-metal unfolding and true-shape nesting of flat parts on sheets. They are verified against reference parts, expensive to maintain, and priced for it. An agent discovers them the same way as everything else: `describe` reports the tier `cloud-pro`, the endpoint and the API key scope. The [CAD Cloud page](https://bitbybit.dev/cad-cloud) lists the plans.",
80
80
  "page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/agentic-cad"
81
81
  },
82
82
  {
@@ -132,7 +132,7 @@ export const GUIDES: readonly GuideSection[] = [
132
132
  "id": "how-the-bitbybit-occt-kernel-thinks",
133
133
  "title": "How the Bitbybit OCCT Kernel thinks",
134
134
  "level": 2,
135
- "body": "- **Y is up.** The ground is the XZ plane. A box's `height` runs along Y, a cylinder grows along its `direction`, `[0, 1, 0]` unless given, and a rectangle or circle wire lies flat on the ground unless its `direction`, the normal of its plane, says otherwise. Manifold and JSCAD build along Z instead: their cylinders stand on the XY plane.\n- **Shapes nest.** A vertex is a point, an edge a curve between vertices, a wire a chain of edges, a face a surface bounded by wires, a shell faces joined at their edges, a solid the volume a closed shell bounds, and a compound a group of shapes kept apart. Each method says which kinds it takes and gives: `operations.extrude` turns a face into a solid, but a wire only into a shell.\n- **Units are plain numbers.** Model in whichever unit the part is drawn in; angles are degrees, and tolerances are in the model's units. A file says its unit only when told it: give `io.saveShapeSTEP` the `unit` the part is modelled in (`Bit.Inputs.Base.unitOfLengthEnum.inch`, say) and it is written at its true size, in millimetres; `io.loadSTEPorIGES` takes the `unit` to bring a file in at, and `io.fileLengthUnit` tells the unit a STEP or IGES file states.\n- **Right-handed.** OpenCascade is right-handed, as three.js and PlayCanvas are. A Babylon.js scene is left-handed, and shows every part mirrored, unless `scene.useRightHandedSystem` is set when it is created.\n- **Colours** are hex strings such as `\"#ff8000\"`, or arrays of three numbers from 0 to 1.",
135
+ "body": "- **Y is up.** The ground is the XZ plane. A box's `height` runs along Y, a cylinder grows along its `direction`, `[0, 1, 0]` unless given, and a rectangle or circle wire lies flat on the ground unless its `direction`, the normal of its plane, says otherwise. Manifold and JSCAD build along Z instead: their cylinders stand on the XY plane.\n- **Shapes nest.** A vertex is a point, an edge a curve between vertices, a wire a chain of edges, a face a surface bounded by wires, a shell faces joined at their edges, a solid the volume a closed shell bounds, and a compound a group of shapes kept apart. Each method says which kinds it takes and gives: `operations.extrude` turns a face into a solid, but a wire only into a shell.\n- **Units are plain numbers.** Model in whichever unit the part is drawn in; angles are degrees, and tolerances are in the model's units. A file says its unit only when told it: give `io.saveShapeSTEP` the `unit` the part is modelled in (`Bit.Inputs.Base.unitOfLengthEnum.inch`, say) and it is written at its true size, in millimetres; `io.loadSTEPorIGES` takes the `unit` to bring a file in at, and `io.fileLengthUnit` tells the unit a STEP or IGES file states.\n- **Right-handed.** OpenCascade is right-handed, as three.js and PlayCanvas are. A Babylon.js scene is left-handed and draws the kernel's numbers as they are, which is the mirror image of the model. Set the conventions once, `await bitbybit.setConventions(1)` after `init` or `conventions: 1` in the options of `initBitByBit`, and the library speaks the engine's own coordinate system: a file matches the screen, and a shape that names a hand, a thread or a helix's `clockwise`, shows that hand. Left out, the libraries behave as they did before the setting existed, so an existing app never changes on its own.\n- **Colours** are hex strings such as `\"#ff8000\"`, or arrays of three numbers from 0 to 1.",
136
136
  "page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/cad-geometry"
137
137
  },
138
138
  {
@@ -167,7 +167,7 @@ export const GUIDES: readonly GuideSection[] = [
167
167
  "id": "drawing-and-exporting-a-part",
168
168
  "title": "Drawing and exporting a part",
169
169
  "level": 2,
170
- "body": "- **Drawing.** In the browser and in the editors, `draw.drawAnyAsync({ entity: shape, options })` draws any shape, mesh or point list; for OpenCascade shapes `options` is an `Inputs.Draw.DrawOcctShapeOptions`, with `faceColour`, `edgeColour`, `edgeWidth` and `precision`, the meshing tolerance. Draw the finished part rather than every step.\n- **STEP**, the exact format other CAD tools open: `io.saveShapeSTEPAndReturn` through the worker, `io.saveShapeSTEP` on the in-process service in Node, both giving the file's text in millimetres, the shape scaled from the `unit` it is modelled in when one is given. Most CAD tools are Z-up: turn the part first with `transforms.rotate({ shape, axis: [1, 0, 0], angle: 90 })`, which takes Y up to Z and keeps the part as it was built. The `adjustYtoZ` option swaps Y and Z instead, which mirrors the part: it matches what a left-handed Babylon.js scene shows.\n- **STL** for printing: `io.saveShapeStlAndReturn` through the worker, `io.saveShapeStl` in Node, with `precision` as the meshing tolerance and `binary` for the smaller form. Turn the part as for STEP.\n- **Drawings and assemblies.** `io.shapeToDxfPaths` and `io.dxfCreate` write a DXF of flat geometry, and the documents of `occt.assembly.manager` hold several parts with names, colours and placements, written to one STEP file with `occt.assembly.manager.exportDocumentToStep`.",
170
+ "body": "- **Drawing.** In the browser and in the editors, `draw.drawAnyAsync({ entity: shape, options })` draws any shape, mesh or point list; for OpenCascade shapes `options` is an `Inputs.Draw.DrawOcctShapeOptions`, with `faceColour`, `edgeColour`, `edgeWidth` and `precision`, the meshing tolerance. Draw the finished part rather than every step.\n- **STEP**, the exact format other CAD tools open: `io.saveShapeSTEPAndReturn` through the worker, `io.saveShapeSTEP` on the in-process service in Node, both giving the file's text in millimetres, the shape scaled from the `unit` it is modelled in when one is given. Most CAD tools are Z-up. With the conventions set, `adjustYtoZ: true` writes a Z-up file that shows what the screen shows, in every engine. Without them, turn the part first with `transforms.rotate({ shape, axis: [1, 0, 0], angle: 90 })`, which takes Y up to Z and keeps the part as it was built; there `adjustYtoZ` swaps Y and Z instead, which mirrors the part and matches what a left-handed Babylon.js scene shows.\n- **STL** for printing: `io.saveShapeStlAndReturn` through the worker, `io.saveShapeStl` in Node, with `precision` as the meshing tolerance and `binary` for the smaller form. Turn the part as for STEP.\n- **Drawings and assemblies.** `io.shapeToDxfPaths` and `io.dxfCreate` write a DXF of flat geometry, and the documents of `occt.assembly.manager` hold several parts with names, colours and placements, written to one STEP file with `occt.assembly.manager.exportDocumentToStep`.",
171
171
  "page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/cad-geometry"
172
172
  },
173
173
  {
@@ -202,7 +202,7 @@ export const GUIDES: readonly GuideSection[] = [
202
202
  "id": "a-first-document",
203
203
  "title": "A first document",
204
204
  "level": 2,
205
- "body": "A plate with two holes and rounded top edges, made of aluminium, with a part number written from its size:\n\n```json title=\"bracket.design.json\"\n{\n \"$schema\": \"https://git-cdn.bitbybit.dev/v1.6.1/schemas/design-document/experimental.json\",\n \"schemaVersion\": 1,\n \"id\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\",\n \"meta\": { \"name\": \"Bracket\" },\n \"parameters\": {\n \"width\": { \"value\": 60, \"min\": 30, \"unit\": \"mm\" },\n \"depth\": { \"value\": 40, \"min\": 20, \"unit\": \"mm\" },\n \"thickness\": { \"value\": 6, \"min\": 2, \"unit\": \"mm\" },\n \"hole\": { \"value\": 6, \"min\": 2, \"max\": 12, \"unit\": \"mm\" }\n },\n \"features\": [\n {\n \"id\": \"base\", \"type\": \"sketch\", \"on\": { \"plane\": \"XY\" }, \"start\": [0, 0],\n \"pen\": [\n { \"type\": \"hLine\", \"id\": \"south\", \"length\": \"width\" },\n { \"type\": \"vLine\", \"id\": \"east\", \"length\": \"depth\" },\n { \"type\": \"hLine\", \"id\": \"north\", \"length\": \"-width\" },\n { \"type\": \"close\", \"id\": \"west\" }\n ]\n },\n { \"id\": \"plate\", \"type\": \"extrude\", \"profile\": \"base\", \"distance\": \"thickness\" },\n {\n \"id\": \"holes\", \"type\": \"hole\", \"body\": \"plate\",\n \"on\": { \"of\": \"plate\", \"role\": \"end\", \"count\": 1 },\n \"at\": [{ \"id\": \"left\", \"x\": 10, \"y\": \"depth / 2\" }, { \"id\": \"right\", \"x\": \"width - 10\", \"y\": \"depth / 2\" }],\n \"diameter\": \"hole\"\n },\n {\n \"id\": \"round\", \"type\": \"fillet\", \"body\": \"plate\", \"radius\": 2,\n \"edges\": { \"between\": [{ \"of\": \"plate\", \"role\": \"end\" }, { \"of\": \"plate\", \"role\": \"side\" }], \"count\": 4 }\n }\n ],\n \"materials\": [\n { \"id\": \"aluminium\", \"density\": 2700, \"appearance\": { \"color\": \"#b0b4b8\", \"metallic\": 0.8, \"roughness\": 0.4 } }\n ],\n \"parts\": [\n {\n \"id\": \"bracket\", \"name\": \"Bracket\", \"body\": \"plate\", \"material\": \"aluminium\",\n \"properties\": { \"partNumber\": \"BRK-{width}x{depth}\" },\n \"connectors\": [\n { \"id\": \"pivotTop\", \"on\": { \"of\": \"plate\", \"role\": \"end\", \"count\": 1 }, \"axis\": { \"of\": \"holes\", \"role\": \"wall\", \"from\": \"left\" } },\n { \"id\": \"pivotBottom\", \"on\": { \"of\": \"plate\", \"role\": \"start\", \"count\": 1 }, \"axis\": { \"of\": \"holes\", \"role\": \"wall\", \"from\": \"left\" } }\n ]\n }\n ]\n}\n```\n\n- The sketch draws a rectangle with a pen: each command moves from where the last one ended, and `close` returns to `start`. The command ids name the four side faces the extrude sweeps from them.\n- The extrude starts a body named `plate`. Its bottom face is `start`, its top `end` and its walls `side`.\n- The holes are placed on the face the reference `{ \"of\": \"plate\", \"role\": \"end\", \"count\": 1 }` names, at x and y on that face. Each position has an id, so a later reference can name one hole's wall.\n- The fillet rounds the edges between the top and the walls: exactly 4, or the build reports otherwise.\n- The connectors are frames where an assembly fastens the part: on the top and the bottom face, at the left hole's axis.",
205
+ "body": "A plate with two holes and rounded top edges, made of aluminium, with a part number written from its size:\n\n```json title=\"bracket.design.json\"\n{\n \"$schema\": \"https://git-cdn.bitbybit.dev/v1.7.0/schemas/design-document/experimental.json\",\n \"schemaVersion\": 1,\n \"id\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\",\n \"meta\": { \"name\": \"Bracket\" },\n \"parameters\": {\n \"width\": { \"value\": 60, \"min\": 30, \"unit\": \"mm\" },\n \"depth\": { \"value\": 40, \"min\": 20, \"unit\": \"mm\" },\n \"thickness\": { \"value\": 6, \"min\": 2, \"unit\": \"mm\" },\n \"hole\": { \"value\": 6, \"min\": 2, \"max\": 12, \"unit\": \"mm\" }\n },\n \"features\": [\n {\n \"id\": \"base\", \"type\": \"sketch\", \"on\": { \"plane\": \"XY\" }, \"start\": [0, 0],\n \"pen\": [\n { \"type\": \"hLine\", \"id\": \"south\", \"length\": \"width\" },\n { \"type\": \"vLine\", \"id\": \"east\", \"length\": \"depth\" },\n { \"type\": \"hLine\", \"id\": \"north\", \"length\": \"-width\" },\n { \"type\": \"close\", \"id\": \"west\" }\n ]\n },\n { \"id\": \"plate\", \"type\": \"extrude\", \"profile\": \"base\", \"distance\": \"thickness\" },\n {\n \"id\": \"holes\", \"type\": \"hole\", \"body\": \"plate\",\n \"on\": { \"of\": \"plate\", \"role\": \"end\", \"count\": 1 },\n \"at\": [{ \"id\": \"left\", \"x\": 10, \"y\": \"depth / 2\" }, { \"id\": \"right\", \"x\": \"width - 10\", \"y\": \"depth / 2\" }],\n \"diameter\": \"hole\"\n },\n {\n \"id\": \"round\", \"type\": \"fillet\", \"body\": \"plate\", \"radius\": 2,\n \"edges\": { \"between\": [{ \"of\": \"plate\", \"role\": \"end\" }, { \"of\": \"plate\", \"role\": \"side\" }], \"count\": 4 }\n }\n ],\n \"materials\": [\n { \"id\": \"aluminium\", \"density\": 2700, \"appearance\": { \"color\": \"#b0b4b8\", \"metallic\": 0.8, \"roughness\": 0.4 } }\n ],\n \"parts\": [\n {\n \"id\": \"bracket\", \"name\": \"Bracket\", \"body\": \"plate\", \"material\": \"aluminium\",\n \"properties\": { \"partNumber\": \"BRK-{width}x{depth}\" },\n \"connectors\": [\n { \"id\": \"pivotTop\", \"on\": { \"of\": \"plate\", \"role\": \"end\", \"count\": 1 }, \"axis\": { \"of\": \"holes\", \"role\": \"wall\", \"from\": \"left\" } },\n { \"id\": \"pivotBottom\", \"on\": { \"of\": \"plate\", \"role\": \"start\", \"count\": 1 }, \"axis\": { \"of\": \"holes\", \"role\": \"wall\", \"from\": \"left\" } }\n ]\n }\n ]\n}\n```\n\n- The sketch draws a rectangle with a pen: each command moves from where the last one ended, and `close` returns to `start`. The command ids name the four side faces the extrude sweeps from them.\n- The extrude starts a body named `plate`. Its bottom face is `start`, its top `end` and its walls `side`.\n- The holes are placed on the face the reference `{ \"of\": \"plate\", \"role\": \"end\", \"count\": 1 }` names, at x and y on that face. Each position has an id, so a later reference can name one hole's wall.\n- The fillet rounds the edges between the top and the walls: exactly 4, or the build reports otherwise.\n- The connectors are frames where an assembly fastens the part: on the top and the bottom face, at the left hole's axis.",
206
206
  "page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/design-documents"
207
207
  },
208
208
  {
@@ -251,7 +251,7 @@ export const GUIDES: readonly GuideSection[] = [
251
251
  "id": "assemblies",
252
252
  "title": "Assemblies",
253
253
  "level": 2,
254
- "body": "An assembly places parts of other documents. The documents are given to the build beside it, keyed by their `id`; the runner fetches nothing.\n\n```json title=\"hinge.design.json\"\n{\n \"$schema\": \"https://git-cdn.bitbybit.dev/v1.6.1/schemas/design-document/experimental.json\",\n \"schemaVersion\": 1,\n \"kind\": \"assembly\",\n \"meta\": { \"name\": \"Swivel pair\" },\n \"parameters\": {\n \"swing\": { \"value\": 30, \"min\": 0, \"max\": 90, \"unit\": \"deg\" }\n },\n \"components\": [\n { \"id\": \"lower\", \"source\": { \"document\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\", \"part\": \"bracket\" } },\n { \"id\": \"upper\", \"source\": { \"document\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\", \"part\": \"bracket\", \"parameters\": { \"width\": 80 } } }\n ],\n \"joints\": [\n {\n \"id\": \"pivot\", \"type\": \"revolute\", \"component\": \"upper\", \"connector\": \"pivotBottom\",\n \"to\": { \"component\": \"lower\", \"connector\": \"pivotTop\" },\n \"angle\": \"swing\", \"limits\": { \"angle\": [0, 90] }\n }\n ]\n}\n```\n\n- Build it with the documents it places: `build({ document: hinge, documents: [bracket] })`. The result has the parts, every placed occurrence with its matrix, the bill of materials, and the structure that `assembly.manager.buildAssemblyDocument` exports to STEP and glTF.\n- **Joints** put a component's connector against another's, faces meeting and facing each other: `fastened` moves nothing, `revolute` turns by `angle` about the shared axis, `slider` moves by `offset` along it, `cylindrical` does both. `flip` makes the faces face the same way, `limits` bound what may move, and joints form a tree.\n- **`replicate`** places a component on every member of a connector set, such as a bolt in every hole of a flange: `\"replicate\": { \"connector\": \"seat\", \"to\": { \"component\": \"flange\", \"connector\": \"bolts\" } }`.\n- **`pattern`** places copies of a component where it is placed, turned about an axis or stepped along a direction, such as the blades of a fan: `\"pattern\": { \"polar\": { \"axis\": { \"origin\": [0, 0, 0], \"direction\": [1, 0, 0] }, \"count\": \"blades\" } }`, or `{ \"linear\": { \"direction\": [1, 0, 0], \"spacing\": 25, \"count\": 4 } }`. A polar pattern spaces its copies as the `polarPattern` feature does: a whole turn shared out, a part of one (`angle`) with both ends included, the first turned by `start`. Each copy is an occurrence of its own, `blade.1`, `blade.2` and so on, counted in the bill of materials. A patterned component is not moved by a joint or joined to; to turn a row of blades, pattern them inside a sub-assembly and join that.\n- A component's `source.parameters` drive the placed document's values from the assembly's own, so one parameter can size several parts.\n- **A gear pair** is one gear part document placed twice: its `module`, `teeth`, `width`, `bore` and `backlash` parameters feed a `gear` loop and a `circle` bore, an extrude, and a connector `{ \"id\": \"axis\", \"on\": { \"of\": \"gear\", \"role\": \"start\" } }`. Each component sets its `teeth` in `source.parameters`, and a revolute joint per gear holds its `axis` against a frame or a plate, `module * (teeth + otherTeeth) / 2` apart. Drive both angles from one parameter: `\"turn\"` on the first, `\"180 / 30 - turn * 20 / 30\"` on a 30-tooth second for a 20-tooth first, so the teeth fall into each other's gaps; `design.clashes` at a few values of `turn` through one tooth of the first proves they mesh.\n- **A standard part document** is one `operation` feature of `occt.parts` sized by its parameters, such as `{ \"id\": \"screw\", \"type\": \"operation\", \"operation\": \"occt.parts.mechanical.fasteners.iso.socketHeadCapScrew\", \"params\": { \"size\": { \"expr\": \"size\" }, \"length\": { \"expr\": \"length\" } } }` with `size` a choice parameter of `\"M3\"`, `\"M4\"` and so on (`fasteners.ansi` takes `\"#10\"`, `\"1/4\"` and a `series`), built in the document's unit, and connectors on the roles it names: a screw's `{ \"on\": { \"of\": \"screw\", \"role\": \"seat\" }, \"axis\": { \"of\": \"screw\", \"role\": \"thread\" } }`, a nut's or a washer's `seat` and `top`, a bearing's `innerStart` or `outerStart` with the `bore` or `outside` axis, a spring's `bottom` and `top`. Each component sets its own size, so one document places every screw of an assembly, and `replicate` puts one in every hole of a set.\n- An assembly may publish `connectors` of its components, so a larger assembly can join it as one unit.\n- **From a STEP file:** `occt.design.fromStep({ step, name })` writes an assembly document per assembly and a part document per part, placed `at` the file's frames, with names and colours, every part importing one shapes file by `child`. The documents are in `unit`, millimetres unless you choose centimetres, metres or inches, the shapes and placements scaled from the file's own. Store `assets[0].data` at its `uri`, then build the `root` document with `documents` and `assets: { [assets[0].id]: assets[0].data }`; `report.notes` says what changed on the way, such as a mirrored placement built into a part of its own.\n- **Section a build:** `occt.design.section({ build, frame })` cuts what `build` returned with the plane of a frame, taking away what lies on the side its normal points to, and gives a cap for each part the plane passes through, the faces it cuts with their `area`. With `cut: true` the pieces behind the plane and the parts wholly behind it come too, each with its `volume`. The result is placed like the build's parts, so `draw.drawAnyAsync({ entity: section })` draws it, and the same frame given to `operations.hiddenLines` looks at the cut.",
254
+ "body": "An assembly places parts of other documents. The documents are given to the build beside it, keyed by their `id`; the runner fetches nothing.\n\n```json title=\"hinge.design.json\"\n{\n \"$schema\": \"https://git-cdn.bitbybit.dev/v1.7.0/schemas/design-document/experimental.json\",\n \"schemaVersion\": 1,\n \"kind\": \"assembly\",\n \"meta\": { \"name\": \"Swivel pair\" },\n \"parameters\": {\n \"swing\": { \"value\": 30, \"min\": 0, \"max\": 90, \"unit\": \"deg\" }\n },\n \"components\": [\n { \"id\": \"lower\", \"source\": { \"document\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\", \"part\": \"bracket\" } },\n { \"id\": \"upper\", \"source\": { \"document\": \"3f1c2a7e-8b4d-4c1a-9e2f-5d6b7a8c9e01\", \"part\": \"bracket\", \"parameters\": { \"width\": 80 } } }\n ],\n \"joints\": [\n {\n \"id\": \"pivot\", \"type\": \"revolute\", \"component\": \"upper\", \"connector\": \"pivotBottom\",\n \"to\": { \"component\": \"lower\", \"connector\": \"pivotTop\" },\n \"angle\": \"swing\", \"limits\": { \"angle\": [0, 90] }\n }\n ]\n}\n```\n\n- Build it with the documents it places: `build({ document: hinge, documents: [bracket] })`. The result has the parts, every placed occurrence with its matrix, the bill of materials, and the structure that `assembly.manager.buildAssemblyDocument` exports to STEP and glTF.\n- **Joints** put a component's connector against another's, faces meeting and facing each other: `fastened` moves nothing, `revolute` turns by `angle` about the shared axis, `slider` moves by `offset` along it, `cylindrical` does both. `flip` makes the faces face the same way, `limits` bound what may move, and joints form a tree.\n- **`replicate`** places a component on every member of a connector set, such as a bolt in every hole of a flange: `\"replicate\": { \"connector\": \"seat\", \"to\": { \"component\": \"flange\", \"connector\": \"bolts\" } }`.\n- **`pattern`** places copies of a component where it is placed, turned about an axis or stepped along a direction, such as the blades of a fan: `\"pattern\": { \"polar\": { \"axis\": { \"origin\": [0, 0, 0], \"direction\": [1, 0, 0] }, \"count\": \"blades\" } }`, or `{ \"linear\": { \"direction\": [1, 0, 0], \"spacing\": 25, \"count\": 4 } }`. A polar pattern spaces its copies as the `polarPattern` feature does: a whole turn shared out, a part of one (`angle`) with both ends included, the first turned by `start`. Each copy is an occurrence of its own, `blade.1`, `blade.2` and so on, counted in the bill of materials. A patterned component is not moved by a joint or joined to; to turn a row of blades, pattern them inside a sub-assembly and join that.\n- A component's `source.parameters` drive the placed document's values from the assembly's own, so one parameter can size several parts.\n- **A gear pair** is one gear part document placed twice: its `module`, `teeth`, `width`, `bore` and `backlash` parameters feed a `gear` loop and a `circle` bore, an extrude, and a connector `{ \"id\": \"axis\", \"on\": { \"of\": \"gear\", \"role\": \"start\" } }`. Each component sets its `teeth` in `source.parameters`, and a revolute joint per gear holds its `axis` against a frame or a plate, `module * (teeth + otherTeeth) / 2` apart. Drive both angles from one parameter: `\"turn\"` on the first, `\"180 / 30 - turn * 20 / 30\"` on a 30-tooth second for a 20-tooth first, so the teeth fall into each other's gaps; `design.clashes` at a few values of `turn` through one tooth of the first proves they mesh.\n- **A standard part document** is one `operation` feature of `occt.parts` sized by its parameters, such as `{ \"id\": \"screw\", \"type\": \"operation\", \"operation\": \"occt.parts.mechanical.fasteners.iso.socketHeadCapScrew\", \"params\": { \"size\": { \"expr\": \"size\" }, \"length\": { \"expr\": \"length\" } } }` with `size` a choice parameter of `\"M3\"`, `\"M4\"` and so on (`fasteners.ansi` takes `\"#10\"`, `\"1/4\"` and a `series`), built in the document's unit, and connectors on the roles it names: a screw's `{ \"on\": { \"of\": \"screw\", \"role\": \"seat\" }, \"axis\": { \"of\": \"screw\", \"role\": \"thread\" } }`, a nut's or a washer's `seat` and `top`, a bearing's `innerStart` or `outerStart` with the `bore` or `outside` axis, a spring's `bottom` and `top`. Each component sets its own size, so one document places every screw of an assembly, and `replicate` puts one in every hole of a set.\n- An assembly may publish `connectors` of its components, so a larger assembly can join it as one unit.\n- **From a STEP file:** `occt.design.fromStep({ step, name })` writes an assembly document per assembly and a part document per part, placed `at` the file's frames, with names and colours, every part importing one shapes file by `child`. The documents are in `unit`, millimetres unless you choose centimetres, metres or inches, the shapes and placements scaled from the file's own. Store `assets[0].data` at its `uri`, then build the `root` document with `documents` and `assets: { [assets[0].id]: assets[0].data }`; `report.notes` says what changed on the way, such as a mirrored placement built into a part of its own.\n- **Section a build:** `occt.design.section({ build, frame })` cuts what `build` returned with the plane of a frame, taking away what lies on the side its normal points to, and gives a cap for each part the plane passes through, the faces it cuts with their `area`. With `cut: true` the pieces behind the plane and the parts wholly behind it come too, each with its `volume`. The result is placed like the build's parts, so `draw.drawAnyAsync({ entity: section })` draws it, and the same frame given to `operations.hiddenLines` looks at the cut.",
255
255
  "page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/design-documents"
256
256
  },
257
257
  {