@bitbybit-dev/mcp 1.7.0 → 1.8.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 +1 -1
- package/dist/descriptions.d.ts.map +1 -1
- package/dist/descriptions.js +3 -2
- package/dist/descriptions.js.map +1 -1
- package/dist/guides.generated.d.ts.map +1 -1
- package/dist/guides.generated.js +12 -5
- package/dist/guides.generated.js.map +1 -1
- package/dist/index-types.d.ts +10 -0
- package/dist/index-types.d.ts.map +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +31 -2
- package/dist/render.js.map +1 -1
- package/dist/tools/get-guide.d.ts.map +1 -1
- package/dist/tools/get-guide.js +6 -1
- package/dist/tools/get-guide.js.map +1 -1
- package/dist/tools/list-namespace.d.ts.map +1 -1
- package/dist/tools/list-namespace.js +4 -1
- package/dist/tools/list-namespace.js.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/__fixtures__/index.sample.json +35 -1
- package/src/descriptions.ts +3 -2
- package/src/guides.generated.ts +12 -5
- package/src/index-types.ts +12 -0
- package/src/render.test.ts +52 -0
- package/src/render.ts +33 -3
- package/src/tools/docs-tools.test.ts +29 -0
- package/src/tools/get-guide.ts +6 -1
- package/src/tools/list-namespace.ts +4 -1
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
|
|
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 2267 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
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptions.d.ts","sourceRoot":"","sources":["../src/descriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,eAAO,MAAM,UAAU,uGAAwG,CAAC;AAEhI,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAIvD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CA6C3F,CAAC;AAEF,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"descriptions.d.ts","sourceRoot":"","sources":["../src/descriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,eAAO,MAAM,UAAU,uGAAwG,CAAC;AAEhI,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAIvD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CA6C3F,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAS0H,CAAC"}
|
package/dist/descriptions.js
CHANGED
|
@@ -20,7 +20,7 @@ export const DESCRIPTIONS = {
|
|
|
20
20
|
},
|
|
21
21
|
list_namespace: {
|
|
22
22
|
title: "List a namespace",
|
|
23
|
-
description: "The members one level below a namespace path, for example occt.shapes, each with its kind and summary. Without a path, the top-level namespaces. " +
|
|
23
|
+
description: "The members one level below a namespace path, for example occt.shapes, each with its kind and summary. Without a path, the top-level namespaces and the methods of the bitbybit object itself, such as setConventions. " +
|
|
24
24
|
"Use it to discover what exists before searching for details.",
|
|
25
25
|
},
|
|
26
26
|
get_examples: {
|
|
@@ -32,7 +32,7 @@ export const DESCRIPTIONS = {
|
|
|
32
32
|
title: "Read the guides",
|
|
33
33
|
description: "Sections of the public guides: building with Bitbybit (what runs in the browser, on a server, on a lightweight backend, and what needs CAD Cloud), writing geometry with the kernels (which kernel to use, the order to build a part in, choosing edges, checking and exporting shapes), writing design documents (parametric models as JSON: parameters, sketches, features, references, parts and assemblies), and writing IFC building models (storeys, walls and their joins, doors, windows, slabs, roofs, rooms, properties and quantities). " +
|
|
34
34
|
"Without a topic it lists the sections. Read \"integrate\" before recommending where geometry should run: the npm packages are the default, and CAD Cloud is for algorithms that exist only there or compute the caller cannot provide. " +
|
|
35
|
-
"Read \"geometry\" before writing geometry code, \"design\" before writing a design document, and \"ifc\" before writing an IFC model.",
|
|
35
|
+
"Read \"geometry\" before writing geometry code, \"coordinates\" before setting the library up or writing files, \"design\" before writing a design document, and \"ifc\" before writing an IFC model.",
|
|
36
36
|
},
|
|
37
37
|
search: {
|
|
38
38
|
title: "Search",
|
|
@@ -49,6 +49,7 @@ export const SERVER_INSTRUCTIONS = "This is the Bitbybit CAD MCP: it documents t
|
|
|
49
49
|
"Tiers matter: oss members are in the MIT npm packages and run anywhere; platform-pro members exist only inside bitbybit.dev; cloud-pro members run only on Bitbybit CAD Cloud with an API key. " +
|
|
50
50
|
"When asked where geometry should run, read get_guide(\"integrate\") first: the packages alone are the default, and CAD Cloud is the answer only for algorithms that exist only there or for compute the caller cannot provide. " +
|
|
51
51
|
"Before writing geometry code with the occt, manifold or jscad kernels, read get_guide(\"geometry\"), then get_guide(\"part-order\") and get_guide(\"geometry-mistakes\"). " +
|
|
52
|
+
"Before setting the library up in an app, or writing code that reads or writes files, read get_guide(\"coordinates\"): a new app sets the conventions level it describes, and describe says what that level changes in each operation. " +
|
|
52
53
|
"Before writing a design document, a parametric model as JSON that occt.design builds, read get_guide(\"design\") and the sections it lists. " +
|
|
53
54
|
"Before writing an IFC building model with the ifc namespace, read get_guide(\"ifc\"), then get_guide(\"ifc-order\") and get_guide(\"ifc-mistakes\").";
|
|
54
55
|
//# sourceMappingURL=descriptions.js.map
|
package/dist/descriptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptions.js","sourceRoot":"","sources":["../src/descriptions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAIhI,MAAM,CAAC,MAAM,YAAY,GAAmC;IACxD,GAAG,EAAE,yFAAyF;IAC9F,cAAc,EAAE,iEAAiE;IACjF,WAAW,EAAE,kEAAkE;CAClF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAuE;IAC5F,UAAU,EAAE;QACR,KAAK,EAAE,yBAAyB;QAChC,WAAW,EACP,gIAAgI;YAChI,sIAAsI;YACtI,oGAAoG;KAC3G;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACP,yJAAyJ;YACzJ,oHAAoH;YACpH,qKAAqK;YACrK,wGAAwG;KAC/G;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACP,
|
|
1
|
+
{"version":3,"file":"descriptions.js","sourceRoot":"","sources":["../src/descriptions.ts"],"names":[],"mappings":"AAEA,MAAM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],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,oFAAoF;AACpF,eAAO,MAAM,cAAc,wEAAwE,CAAC;AAEpG;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,YAAY,
|
|
1
|
+
{"version":3,"file":"guides.generated.d.ts","sourceRoot":"","sources":["../src/guides.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,oFAAoF;AACpF,eAAO,MAAM,cAAc,wEAAwE,CAAC;AAEpG;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,YAAY,EAmUzC,CAAC"}
|
package/dist/guides.generated.js
CHANGED
|
@@ -10,7 +10,7 @@ export const GUIDES = [
|
|
|
10
10
|
"id": "what-we-believe",
|
|
11
11
|
"title": "What we believe",
|
|
12
12
|
"level": 2,
|
|
13
|
-
"body": "Agents write the code. Bitbybit provides verified geometry algorithms and, where it is needed, hosted compute. The free packages are the vocabulary that everyone learns, human or agent: one dotted API (`bitbybit.occt.shapes.solid.createBox`, `bitbybit.manifold.booleans.union`, ...) that reads the same in a browser, on a server and in the online editors.\n\nAn agent that knows the API from memory guesses. An agent that looks it up gets the exact signature, defaults and examples for the version your project has installed. That lookup is what the MCP server is for.",
|
|
13
|
+
"body": "Agents write the code. Bitbybit provides verified geometry algorithms and, where it is needed, hosted compute. The free packages are the vocabulary that everyone learns, human or agent: one dotted API (`bitbybit.occt.shapes.solid.createBox`, `bitbybit.manifold.manifold.booleans.union`, ...) that reads the same in a browser, on a server and in the online editors.\n\nAn agent that knows the API from memory guesses. An agent that looks it up gets the exact signature, defaults and examples for the version your project has installed. That lookup is what the MCP server is for.",
|
|
14
14
|
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/agentic-cad"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
@@ -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
|
|
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. Set the conventions level once, `conventions: 1` in the options of `initBitByBit`, so that files, text and named hands follow the engine; the section on coordinate systems below says what it changes.\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
|
{
|
|
@@ -160,6 +160,13 @@ export const GUIDES = [
|
|
|
160
160
|
"body": "Each check is one call. Run them after any step that may have gone wrong:\n\n- `shapeFix.isValid` checks that a shape is well formed, of any kind. An operation can finish without an error and still return an invalid shape: a fillet too large for the faces beside its edge can.\n- `shapes.solid.debugInfo` reports in one answer how many faces and edges a solid has, its area and its volume. Its `valid` is false only for an empty shape; it does not check the geometry, so use `shapeFix.isValid` for that.\n- `shapes.solid.getSolidVolume` and `analysis.measure.tightBoundingBox` measure. Compare them with what the part should be: a cut that misses its shape, or a face whose hole was wound the wrong way, changes the volume by the wrong amount or not at all, without an error. The tight box follows the exact geometry; the older `operations.boundingBoxOfShape` can be loose around curved faces and is deprecated.\n- A method that cannot do what it was asked throws and says why, such as a fillet the faces beside an edge cannot hold. Read the message, change the input and run again.",
|
|
161
161
|
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/cad-geometry"
|
|
162
162
|
},
|
|
163
|
+
{
|
|
164
|
+
"id": "coordinate-systems",
|
|
165
|
+
"title": "Coordinate systems",
|
|
166
|
+
"level": 2,
|
|
167
|
+
"body": "OpenCascade, Manifold and JSCAD are right-handed, as three.js and PlayCanvas are. A Babylon.js scene is left-handed unless it is made right-handed (`scene.useRightHandedSystem = true`) before anything is drawn in it. How files, text and shapes that name a hand map between the kernel and the engine is set once per app, by the conventions level:\n\n- **Level 1, for every new app**: `conventions: 1` in the options of `initBitByBit`, or `await bitbybit.setConventions(1)` once `init` has run. The library then speaks the engine's own coordinate system. A file it writes is a true right-handed file that shows what the screen shows; a file it reads looks as it does in the program that made it, except an assembly document read with `occt.assembly.manager.loadStepToDoc`, which keeps the file's right-handed numbers; IFC models, recipes and design documents are built as their data describes them; and a shape that names a hand, a thread or a helix's `clockwise`, shows that hand.\n- **Left out, or level 0**: the libraries behave as they did before levels existed, so an existing app never changes when it updates the packages.\n- **The scene decides.** The coordinate system is the one the scene had when it was given to `init`, and `bitbybit.engineSettings()` gives the settings that fit it. Make a Babylon.js scene right-handed when it is created; code that switches it later also calls `bitbybit.setSettings` with the new system, or files and text keep the old one.\n- **Without an engine**, a program that runs a kernel itself sets it on that kernel: `occt.settings = { coordinateSystem: Inputs.Base.coordinateSystemEnum.rightHanded }`, with `Inputs` from `@bitbybit-dev/base`.\n\n`describe` shows a \"Conventions level\" section on every operation a level may change, saying what each level changes; a whole service carries it when any of its operations may change, and an open-source operation without the section gives the same at every level. Boxes, booleans, fillets, sweeps and the drawings of them never change, and neither does the way a rotation turns.",
|
|
168
|
+
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/cad-geometry"
|
|
169
|
+
},
|
|
163
170
|
{
|
|
164
171
|
"id": "drawing-and-exporting-a-part",
|
|
165
172
|
"title": "Drawing and exporting a part",
|
|
@@ -199,7 +206,7 @@ export const GUIDES = [
|
|
|
199
206
|
"id": "a-first-document",
|
|
200
207
|
"title": "A first document",
|
|
201
208
|
"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.
|
|
209
|
+
"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.8.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
210
|
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/design-documents"
|
|
204
211
|
},
|
|
205
212
|
{
|
|
@@ -248,7 +255,7 @@ export const GUIDES = [
|
|
|
248
255
|
"id": "assemblies",
|
|
249
256
|
"title": "Assemblies",
|
|
250
257
|
"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.
|
|
258
|
+
"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.8.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
259
|
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/design-documents"
|
|
253
260
|
},
|
|
254
261
|
{
|
|
@@ -311,7 +318,7 @@ export const GUIDES = [
|
|
|
311
318
|
"id": "drawing-an-ifc-model-and-exporting-step",
|
|
312
319
|
"title": "Drawing an IFC model and exporting STEP",
|
|
313
320
|
"level": 2,
|
|
314
|
-
"body": "In the browser, a model's recipe is built by a kernel and drawn:\n\n```typescript\nconst recipe = await bitbybit.ifc.geometry.recipe({ model });\nconst solids = await bitbybit.manifold.recipes.build({ recipe, adjustZtoY: true });\nawait bitbybit.draw.drawAnyAsync({ entity: solids });\n```\n\nThe solids come back one per root of the recipe, and `recipe.roots[i].tag` carries the element's `globalId`, `type`, `name` and, when its material has a colour, `rgba`; `propertySets: true` adds its property set values, named like `Pset_WallCommon.IsExternal`. With the OpenCascade worker enabled as well, `ifc.geometry.toShapes` gives exact shapes and `ifc.geometry.toStep` the bytes of a STEP file, nested by site, building, storey and IFC class, each product carrying its property sets: `await bitbybit.ifc.geometry.toStep({ model, name: \"House\", fileName: \"house.step\" })`.
|
|
321
|
+
"body": "In the browser, a model's recipe is built by a kernel and drawn:\n\n```typescript\nconst recipe = await bitbybit.ifc.geometry.recipe({ model });\nconst solids = await bitbybit.manifold.recipes.build({ recipe, adjustZtoY: true });\nawait bitbybit.draw.drawAnyAsync({ entity: solids });\n```\n\nThe solids come back one per root of the recipe, and `recipe.roots[i].tag` carries the element's `globalId`, `type`, `name` and, when its material has a colour, `rgba`; `propertySets: true` adds its property set values, named like `Pset_WallCommon.IsExternal`. With the OpenCascade worker enabled as well, `ifc.geometry.toShapes` gives exact shapes and `ifc.geometry.toStep` the bytes of a STEP file, nested by site, building, storey and IFC class, each product carrying its property sets: `await bitbybit.ifc.geometry.toStep({ model, name: \"House\", fileName: \"house.step\" })`. Set the conventions level when the library is set up, `conventions: 1` in the options of `initBitByBit`: the building is then built as its data describes it in every engine, a default left-handed Babylon.js scene included. Without it, a left-handed Babylon.js scene shows the building mirrored.",
|
|
315
322
|
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/ifc-models"
|
|
316
323
|
},
|
|
317
324
|
{
|
|
@@ -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,MAAM,EAAE,
|
|
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,mkBAAmkB;QAC3kB,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,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,OAAO,EAAE,wBAAwB;QACjC,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,klDAAklD;QAC1lD,MAAM,EAAE,oEAAoE;KAC/E;IACD;QACI,IAAI,EAAE,kCAAkC;QACxC,OAAO,EAAE,kCAAkC;QAC3C,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,27HAA27H;QACn8H,MAAM,EAAE,oEAAoE;KAC/E;IACD;QACI,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,isJAAisJ;QACzsJ,MAAM,EAAE,oEAAoE;KAC/E;IACD;QACI,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,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,mpCAAmpC;QAC3pC,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/dist/index-types.d.ts
CHANGED
|
@@ -21,6 +21,14 @@ export interface IndexParam {
|
|
|
21
21
|
optional: boolean;
|
|
22
22
|
fields?: IndexField[];
|
|
23
23
|
}
|
|
24
|
+
export interface IndexEngineDoc {
|
|
25
|
+
doc: string;
|
|
26
|
+
examples: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface IndexConventionChange {
|
|
29
|
+
level: number;
|
|
30
|
+
change: string;
|
|
31
|
+
}
|
|
24
32
|
export interface IndexMember {
|
|
25
33
|
path: string;
|
|
26
34
|
kind: MemberKind;
|
|
@@ -47,6 +55,8 @@ export interface IndexMember {
|
|
|
47
55
|
engineSignatures?: Partial<Record<Engine, string | null>>;
|
|
48
56
|
cloudSummary?: string;
|
|
49
57
|
cloudParams?: IndexParam[];
|
|
58
|
+
conventions?: IndexConventionChange[];
|
|
59
|
+
engineDocs?: Partial<Record<Engine, IndexEngineDoc>>;
|
|
50
60
|
}
|
|
51
61
|
export interface IndexEnum {
|
|
52
62
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-types.d.ts","sourceRoot":"","sources":["../src/index-types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,cAAc,GAAG,WAAW,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,iBAAiB,CAAC;AAEjF,MAAM,MAAM,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;AAE5D,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACzD;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,UAAU,E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C,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAC1C"}
|
package/dist/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiD,YAAY,EAAc,WAAW,EAAc,MAAM,kBAAkB,CAAC;AACzI,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAsEnD,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,CAOhG;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,KAAK,GAAE,SAAS,SAAS,EAAO,GAAG,MAAM,CAgErI;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAGtD"}
|
package/dist/render.js
CHANGED
|
@@ -29,6 +29,31 @@ function renderParam(param) {
|
|
|
29
29
|
function renderExample(example) {
|
|
30
30
|
return ["```typescript", example.code, "```"].join("\n");
|
|
31
31
|
}
|
|
32
|
+
function renderConventions(changes) {
|
|
33
|
+
if (changes.length === 0) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
return [
|
|
37
|
+
"## Conventions level",
|
|
38
|
+
"",
|
|
39
|
+
"A conventions level may change what it gives: it is among the operations, or in a service, whose results depend on the level the library runs by. Set the level with `bitbybit.setConventions`, or `conventions` in the options of `initBitByBit`; left unset, the library behaves as it did before levels existed. Describe setConventions for more.",
|
|
40
|
+
...changes.map((change) => `- From level ${change.level}: ${change.change}`),
|
|
41
|
+
"",
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
function renderEngineDocs(engineDocs) {
|
|
45
|
+
return [
|
|
46
|
+
"Each engine documents it differently:",
|
|
47
|
+
"",
|
|
48
|
+
...Object.entries(engineDocs).flatMap(([engine, { doc, examples }]) => [
|
|
49
|
+
`### ${engine}`,
|
|
50
|
+
"",
|
|
51
|
+
doc,
|
|
52
|
+
"",
|
|
53
|
+
...examples.flatMap((code) => [renderExample({ path: "", code }), ""]),
|
|
54
|
+
]),
|
|
55
|
+
];
|
|
56
|
+
}
|
|
32
57
|
function renderTypes(types) {
|
|
33
58
|
return types.length === 0 ? [] : ["## Types", "", "Describe one by its name for its fields:", ...types.map(({ key, type }) => `- \`${key}\`${type.summary ? `: ${type.summary}` : ""}`), ""];
|
|
34
59
|
}
|
|
@@ -68,12 +93,16 @@ export function renderMember(member, version, examples, types = []) {
|
|
|
68
93
|
if (member.engineSignatures) {
|
|
69
94
|
lines.push("Signature by engine:", ...Object.entries(member.engineSignatures).map(([engine, signature]) => `- ${engine}: \`${signature ?? "none"}\``), "");
|
|
70
95
|
}
|
|
71
|
-
if (member.
|
|
96
|
+
if (member.engineDocs) {
|
|
97
|
+
lines.push(...renderEngineDocs(member.engineDocs));
|
|
98
|
+
}
|
|
99
|
+
else if (member.doc) {
|
|
72
100
|
lines.push(member.doc, "");
|
|
73
101
|
}
|
|
74
102
|
else if (member.summary) {
|
|
75
103
|
lines.push(member.summary, "");
|
|
76
104
|
}
|
|
105
|
+
lines.push(...renderConventions(member.conventions ?? []));
|
|
77
106
|
if (member.params.length > 0) {
|
|
78
107
|
lines.push("## Parameters", "");
|
|
79
108
|
for (const param of member.params) {
|
|
@@ -95,7 +124,7 @@ export function renderMember(member, version, examples, types = []) {
|
|
|
95
124
|
lines.push(`## Returns`, "", `\`${member.returns}\`${member.async ? " (async)" : ""}`, "");
|
|
96
125
|
}
|
|
97
126
|
lines.push(...renderTypes(types));
|
|
98
|
-
if (examples.length > 0) {
|
|
127
|
+
if (examples.length > 0 && !member.engineDocs) {
|
|
99
128
|
lines.push("## Examples", "", ...examples.map(renderExample), "");
|
|
100
129
|
}
|
|
101
130
|
if (member.docUrl) {
|
package/dist/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,SAAS,YAAY,CAAC,MAAmB;IACrC,OAAO,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAC9G,CAAC;AAED,SAAS,WAAW,CAAC,KAAiB;IAClC,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3E,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QACrD,KAAK,CAAC,IAA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
|
-
{"version":3,"file":"get-guide.d.ts","sourceRoot":"","sources":["../../src/tools/get-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAMjD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"get-guide.d.ts","sourceRoot":"","sources":["../../src/tools/get-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAMjD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiE1D,CAAC;AAIF,QAAA,MAAM,KAAK;;iBAET,CAAC;AAoBH,eAAO,MAAM,QAAQ,EAAE,cAAc,CAAC,OAAO,KAAK,EAAE,WAAW,CAqB9D,CAAC"}
|
package/dist/tools/get-guide.js
CHANGED
|
@@ -31,6 +31,11 @@ export const GUIDE_ALIASES = {
|
|
|
31
31
|
sketch: "sketches",
|
|
32
32
|
assembly: "assemblies",
|
|
33
33
|
"design-mistakes": "mistakes-to-avoid",
|
|
34
|
+
coordinates: "coordinate-systems",
|
|
35
|
+
handedness: "coordinate-systems",
|
|
36
|
+
"right-handed": "coordinate-systems",
|
|
37
|
+
"left-handed": "coordinate-systems",
|
|
38
|
+
conventions: "coordinate-systems",
|
|
34
39
|
geometry: "geometry-in-bitbybit",
|
|
35
40
|
cad: "geometry-in-bitbybit",
|
|
36
41
|
occt: "how-the-bitbybit-occt-kernel-thinks",
|
|
@@ -65,7 +70,7 @@ export const GUIDE_ALIASES = {
|
|
|
65
70
|
};
|
|
66
71
|
const MAX_TOPIC_LENGTH = 128;
|
|
67
72
|
const input = z.object({
|
|
68
|
-
topic: z.string().max(MAX_TOPIC_LENGTH).optional().describe("A section id or a short name such as integrate, browser, backend, server-side, pro, start, geometry, part-order, geometry-mistakes, design, references, assembly, ifc, ifc-order, ifc-mistakes; omit to list the sections"),
|
|
73
|
+
topic: z.string().max(MAX_TOPIC_LENGTH).optional().describe("A section id or a short name such as integrate, browser, backend, server-side, pro, start, geometry, part-order, geometry-mistakes, coordinates, design, references, assembly, ifc, ifc-order, ifc-mistakes; omit to list the sections"),
|
|
69
74
|
});
|
|
70
75
|
function findSection(guides, topic) {
|
|
71
76
|
const wanted = topic.trim().toLowerCase();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-guide.js","sourceRoot":"","sources":["../../src/tools/get-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAqC;IAC3D,SAAS,EAAE,wCAAwC;IACnD,MAAM,EAAE,wCAAwC;IAChD,UAAU,EAAE,wCAAwC;IACpD,aAAa,EAAE,4BAA4B;IAC3C,MAAM,EAAE,4BAA4B;IACpC,OAAO,EAAE,sBAAsB;IAC/B,UAAU,EAAE,sBAAsB;IAClC,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,cAAc;IACvB,cAAc,EAAE,4BAA4B;IAC5C,OAAO,EAAE,6BAA6B;IACtC,GAAG,EAAE,gBAAgB;IACrB,KAAK,EAAE,gBAAgB;IACvB,KAAK,EAAE,aAAa;IACpB,iBAAiB,EAAE,aAAa;IAChC,MAAM,EAAE,0BAA0B;IACl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sources":["../../src/tools/list-namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAOjD,QAAA,MAAM,KAAK;;;iBAGT,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,OAAO,KAAK,EAAE,WAAW,CAsCnE,CAAC"}
|
|
@@ -33,7 +33,10 @@ export const listNamespace = {
|
|
|
33
33
|
}
|
|
34
34
|
const children = resolved.reader.children(path);
|
|
35
35
|
const members = children.map((member) => ({ path: member.path, kind: member.kind, tier: member.tier, summary: member.summary, engines: member.engines }));
|
|
36
|
-
const
|
|
36
|
+
const rootMethods = !path && children.some((member) => member.kind !== "namespace");
|
|
37
|
+
const heading = path
|
|
38
|
+
? `${path}${parent?.summary ? `: ${parent.summary}` : ""}`
|
|
39
|
+
: `The top level of the Bitbybit API ${resolved.version}: its namespaces${rootMethods ? ", and the methods of the bitbybit object itself" : ""}`;
|
|
37
40
|
const text = [heading, ...children.map(renderLine)].join("\n");
|
|
38
41
|
return ok(text, { version: resolved.version, path: path ?? null, members });
|
|
39
42
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-namespace.js","sourceRoot":"","sources":["../../src/tools/list-namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,E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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
|
+
"version": "1.8.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.
|
|
22
|
+
"version": "1.8.0",
|
|
23
23
|
"transport": {
|
|
24
24
|
"type": "stdio"
|
|
25
25
|
}
|
|
@@ -180,7 +180,13 @@
|
|
|
180
180
|
"weight": null,
|
|
181
181
|
"examples": [],
|
|
182
182
|
"group": "create",
|
|
183
|
-
"drawable": true
|
|
183
|
+
"drawable": true,
|
|
184
|
+
"conventions": [
|
|
185
|
+
{
|
|
186
|
+
"level": 1,
|
|
187
|
+
"change": "3D text: reads the right way round in a right-handed engine too."
|
|
188
|
+
}
|
|
189
|
+
]
|
|
184
190
|
},
|
|
185
191
|
{
|
|
186
192
|
"path": "babylon",
|
|
@@ -1831,6 +1837,34 @@
|
|
|
1831
1837
|
"httpMethod": "POST",
|
|
1832
1838
|
"scope": "cad"
|
|
1833
1839
|
},
|
|
1840
|
+
{
|
|
1841
|
+
"path": "setConventions",
|
|
1842
|
+
"kind": "method",
|
|
1843
|
+
"name": "setConventions",
|
|
1844
|
+
"className": "BitByBitBase",
|
|
1845
|
+
"signature": "setConventions(level: number): Promise<BitbybitSettings>",
|
|
1846
|
+
"async": true,
|
|
1847
|
+
"params": [
|
|
1848
|
+
{
|
|
1849
|
+
"name": "level",
|
|
1850
|
+
"type": "number",
|
|
1851
|
+
"optional": false
|
|
1852
|
+
}
|
|
1853
|
+
],
|
|
1854
|
+
"returns": "BitbybitSettings",
|
|
1855
|
+
"summary": "Sets the settings that content saved with a conventions level runs by: 0 for the behaviour from before settings existed, 1 for the scene's own coordinate system.",
|
|
1856
|
+
"doc": "Sets the settings that content saved with a conventions level runs by: 0 for the behaviour\nfrom before settings existed, 1 for the scene's own coordinate system.",
|
|
1857
|
+
"docUrl": null,
|
|
1858
|
+
"engines": [
|
|
1859
|
+
"babylonjs",
|
|
1860
|
+
"threejs",
|
|
1861
|
+
"playcanvas"
|
|
1862
|
+
],
|
|
1863
|
+
"tier": "oss",
|
|
1864
|
+
"onApi3d": false,
|
|
1865
|
+
"weight": null,
|
|
1866
|
+
"examples": []
|
|
1867
|
+
},
|
|
1834
1868
|
{
|
|
1835
1869
|
"path": "verb",
|
|
1836
1870
|
"kind": "namespace",
|
package/src/descriptions.ts
CHANGED
|
@@ -29,7 +29,7 @@ export const DESCRIPTIONS: Readonly<Record<ToolName, { title: string; descriptio
|
|
|
29
29
|
list_namespace: {
|
|
30
30
|
title: "List a namespace",
|
|
31
31
|
description:
|
|
32
|
-
"The members one level below a namespace path, for example occt.shapes, each with its kind and summary. Without a path, the top-level namespaces. " +
|
|
32
|
+
"The members one level below a namespace path, for example occt.shapes, each with its kind and summary. Without a path, the top-level namespaces and the methods of the bitbybit object itself, such as setConventions. " +
|
|
33
33
|
"Use it to discover what exists before searching for details.",
|
|
34
34
|
},
|
|
35
35
|
get_examples: {
|
|
@@ -43,7 +43,7 @@ export const DESCRIPTIONS: Readonly<Record<ToolName, { title: string; descriptio
|
|
|
43
43
|
description:
|
|
44
44
|
"Sections of the public guides: building with Bitbybit (what runs in the browser, on a server, on a lightweight backend, and what needs CAD Cloud), writing geometry with the kernels (which kernel to use, the order to build a part in, choosing edges, checking and exporting shapes), writing design documents (parametric models as JSON: parameters, sketches, features, references, parts and assemblies), and writing IFC building models (storeys, walls and their joins, doors, windows, slabs, roofs, rooms, properties and quantities). " +
|
|
45
45
|
"Without a topic it lists the sections. Read \"integrate\" before recommending where geometry should run: the npm packages are the default, and CAD Cloud is for algorithms that exist only there or compute the caller cannot provide. " +
|
|
46
|
-
"Read \"geometry\" before writing geometry code, \"design\" before writing a design document, and \"ifc\" before writing an IFC model.",
|
|
46
|
+
"Read \"geometry\" before writing geometry code, \"coordinates\" before setting the library up or writing files, \"design\" before writing a design document, and \"ifc\" before writing an IFC model.",
|
|
47
47
|
},
|
|
48
48
|
search: {
|
|
49
49
|
title: "Search",
|
|
@@ -64,5 +64,6 @@ export const SERVER_INSTRUCTIONS =
|
|
|
64
64
|
"Tiers matter: oss members are in the MIT npm packages and run anywhere; platform-pro members exist only inside bitbybit.dev; cloud-pro members run only on Bitbybit CAD Cloud with an API key. " +
|
|
65
65
|
"When asked where geometry should run, read get_guide(\"integrate\") first: the packages alone are the default, and CAD Cloud is the answer only for algorithms that exist only there or for compute the caller cannot provide. " +
|
|
66
66
|
"Before writing geometry code with the occt, manifold or jscad kernels, read get_guide(\"geometry\"), then get_guide(\"part-order\") and get_guide(\"geometry-mistakes\"). " +
|
|
67
|
+
"Before setting the library up in an app, or writing code that reads or writes files, read get_guide(\"coordinates\"): a new app sets the conventions level it describes, and describe says what that level changes in each operation. " +
|
|
67
68
|
"Before writing a design document, a parametric model as JSON that occt.design builds, read get_guide(\"design\") and the sections it lists. " +
|
|
68
69
|
"Before writing an IFC building model with the ifc namespace, read get_guide(\"ifc\"), then get_guide(\"ifc-order\") and get_guide(\"ifc-mistakes\").";
|
package/src/guides.generated.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const GUIDES: readonly GuideSection[] = [
|
|
|
13
13
|
"id": "what-we-believe",
|
|
14
14
|
"title": "What we believe",
|
|
15
15
|
"level": 2,
|
|
16
|
-
"body": "Agents write the code. Bitbybit provides verified geometry algorithms and, where it is needed, hosted compute. The free packages are the vocabulary that everyone learns, human or agent: one dotted API (`bitbybit.occt.shapes.solid.createBox`, `bitbybit.manifold.booleans.union`, ...) that reads the same in a browser, on a server and in the online editors.\n\nAn agent that knows the API from memory guesses. An agent that looks it up gets the exact signature, defaults and examples for the version your project has installed. That lookup is what the MCP server is for.",
|
|
16
|
+
"body": "Agents write the code. Bitbybit provides verified geometry algorithms and, where it is needed, hosted compute. The free packages are the vocabulary that everyone learns, human or agent: one dotted API (`bitbybit.occt.shapes.solid.createBox`, `bitbybit.manifold.manifold.booleans.union`, ...) that reads the same in a browser, on a server and in the online editors.\n\nAn agent that knows the API from memory guesses. An agent that looks it up gets the exact signature, defaults and examples for the version your project has installed. That lookup is what the MCP server is for.",
|
|
17
17
|
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/agentic-cad"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
@@ -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
|
|
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. Set the conventions level once, `conventions: 1` in the options of `initBitByBit`, so that files, text and named hands follow the engine; the section on coordinate systems below says what it changes.\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
|
{
|
|
@@ -163,6 +163,13 @@ export const GUIDES: readonly GuideSection[] = [
|
|
|
163
163
|
"body": "Each check is one call. Run them after any step that may have gone wrong:\n\n- `shapeFix.isValid` checks that a shape is well formed, of any kind. An operation can finish without an error and still return an invalid shape: a fillet too large for the faces beside its edge can.\n- `shapes.solid.debugInfo` reports in one answer how many faces and edges a solid has, its area and its volume. Its `valid` is false only for an empty shape; it does not check the geometry, so use `shapeFix.isValid` for that.\n- `shapes.solid.getSolidVolume` and `analysis.measure.tightBoundingBox` measure. Compare them with what the part should be: a cut that misses its shape, or a face whose hole was wound the wrong way, changes the volume by the wrong amount or not at all, without an error. The tight box follows the exact geometry; the older `operations.boundingBoxOfShape` can be loose around curved faces and is deprecated.\n- A method that cannot do what it was asked throws and says why, such as a fillet the faces beside an edge cannot hold. Read the message, change the input and run again.",
|
|
164
164
|
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/cad-geometry"
|
|
165
165
|
},
|
|
166
|
+
{
|
|
167
|
+
"id": "coordinate-systems",
|
|
168
|
+
"title": "Coordinate systems",
|
|
169
|
+
"level": 2,
|
|
170
|
+
"body": "OpenCascade, Manifold and JSCAD are right-handed, as three.js and PlayCanvas are. A Babylon.js scene is left-handed unless it is made right-handed (`scene.useRightHandedSystem = true`) before anything is drawn in it. How files, text and shapes that name a hand map between the kernel and the engine is set once per app, by the conventions level:\n\n- **Level 1, for every new app**: `conventions: 1` in the options of `initBitByBit`, or `await bitbybit.setConventions(1)` once `init` has run. The library then speaks the engine's own coordinate system. A file it writes is a true right-handed file that shows what the screen shows; a file it reads looks as it does in the program that made it, except an assembly document read with `occt.assembly.manager.loadStepToDoc`, which keeps the file's right-handed numbers; IFC models, recipes and design documents are built as their data describes them; and a shape that names a hand, a thread or a helix's `clockwise`, shows that hand.\n- **Left out, or level 0**: the libraries behave as they did before levels existed, so an existing app never changes when it updates the packages.\n- **The scene decides.** The coordinate system is the one the scene had when it was given to `init`, and `bitbybit.engineSettings()` gives the settings that fit it. Make a Babylon.js scene right-handed when it is created; code that switches it later also calls `bitbybit.setSettings` with the new system, or files and text keep the old one.\n- **Without an engine**, a program that runs a kernel itself sets it on that kernel: `occt.settings = { coordinateSystem: Inputs.Base.coordinateSystemEnum.rightHanded }`, with `Inputs` from `@bitbybit-dev/base`.\n\n`describe` shows a \"Conventions level\" section on every operation a level may change, saying what each level changes; a whole service carries it when any of its operations may change, and an open-source operation without the section gives the same at every level. Boxes, booleans, fillets, sweeps and the drawings of them never change, and neither does the way a rotation turns.",
|
|
171
|
+
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/cad-geometry"
|
|
172
|
+
},
|
|
166
173
|
{
|
|
167
174
|
"id": "drawing-and-exporting-a-part",
|
|
168
175
|
"title": "Drawing and exporting a part",
|
|
@@ -202,7 +209,7 @@ export const GUIDES: readonly GuideSection[] = [
|
|
|
202
209
|
"id": "a-first-document",
|
|
203
210
|
"title": "A first document",
|
|
204
211
|
"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.
|
|
212
|
+
"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.8.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
213
|
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/design-documents"
|
|
207
214
|
},
|
|
208
215
|
{
|
|
@@ -251,7 +258,7 @@ export const GUIDES: readonly GuideSection[] = [
|
|
|
251
258
|
"id": "assemblies",
|
|
252
259
|
"title": "Assemblies",
|
|
253
260
|
"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.
|
|
261
|
+
"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.8.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
262
|
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/design-documents"
|
|
256
263
|
},
|
|
257
264
|
{
|
|
@@ -314,7 +321,7 @@ export const GUIDES: readonly GuideSection[] = [
|
|
|
314
321
|
"id": "drawing-an-ifc-model-and-exporting-step",
|
|
315
322
|
"title": "Drawing an IFC model and exporting STEP",
|
|
316
323
|
"level": 2,
|
|
317
|
-
"body": "In the browser, a model's recipe is built by a kernel and drawn:\n\n```typescript\nconst recipe = await bitbybit.ifc.geometry.recipe({ model });\nconst solids = await bitbybit.manifold.recipes.build({ recipe, adjustZtoY: true });\nawait bitbybit.draw.drawAnyAsync({ entity: solids });\n```\n\nThe solids come back one per root of the recipe, and `recipe.roots[i].tag` carries the element's `globalId`, `type`, `name` and, when its material has a colour, `rgba`; `propertySets: true` adds its property set values, named like `Pset_WallCommon.IsExternal`. With the OpenCascade worker enabled as well, `ifc.geometry.toShapes` gives exact shapes and `ifc.geometry.toStep` the bytes of a STEP file, nested by site, building, storey and IFC class, each product carrying its property sets: `await bitbybit.ifc.geometry.toStep({ model, name: \"House\", fileName: \"house.step\" })`.
|
|
324
|
+
"body": "In the browser, a model's recipe is built by a kernel and drawn:\n\n```typescript\nconst recipe = await bitbybit.ifc.geometry.recipe({ model });\nconst solids = await bitbybit.manifold.recipes.build({ recipe, adjustZtoY: true });\nawait bitbybit.draw.drawAnyAsync({ entity: solids });\n```\n\nThe solids come back one per root of the recipe, and `recipe.roots[i].tag` carries the element's `globalId`, `type`, `name` and, when its material has a colour, `rgba`; `propertySets: true` adds its property set values, named like `Pset_WallCommon.IsExternal`. With the OpenCascade worker enabled as well, `ifc.geometry.toShapes` gives exact shapes and `ifc.geometry.toStep` the bytes of a STEP file, nested by site, building, storey and IFC class, each product carrying its property sets: `await bitbybit.ifc.geometry.toStep({ model, name: \"House\", fileName: \"house.step\" })`. Set the conventions level when the library is set up, `conventions: 1` in the options of `initBitByBit`: the building is then built as its data describes it in every engine, a default left-handed Babylon.js scene included. Without it, a left-handed Babylon.js scene shows the building mirrored.",
|
|
318
325
|
"page": "https://learn.bitbybit.dev/learn/using-ai-with-bitbybit/ifc-models"
|
|
319
326
|
},
|
|
320
327
|
{
|
package/src/index-types.ts
CHANGED
|
@@ -24,6 +24,16 @@ export interface IndexParam {
|
|
|
24
24
|
fields?: IndexField[];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
export interface IndexEngineDoc {
|
|
28
|
+
doc: string;
|
|
29
|
+
examples: string[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface IndexConventionChange {
|
|
33
|
+
level: number;
|
|
34
|
+
change: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
export interface IndexMember {
|
|
28
38
|
path: string;
|
|
29
39
|
kind: MemberKind;
|
|
@@ -50,6 +60,8 @@ export interface IndexMember {
|
|
|
50
60
|
engineSignatures?: Partial<Record<Engine, string | null>>;
|
|
51
61
|
cloudSummary?: string;
|
|
52
62
|
cloudParams?: IndexParam[];
|
|
63
|
+
conventions?: IndexConventionChange[];
|
|
64
|
+
engineDocs?: Partial<Record<Engine, IndexEngineDoc>>;
|
|
53
65
|
}
|
|
54
66
|
|
|
55
67
|
export interface IndexEnum {
|
package/src/render.test.ts
CHANGED
|
@@ -82,6 +82,58 @@ describe("renderMember", () => {
|
|
|
82
82
|
// Assert
|
|
83
83
|
expect(text).toContain("- predefinedType?: wallPredefinedTypeEnum; default \"standard\"; one of standard = \"STANDARD\", solidWall = \"SOLIDWALL\"");
|
|
84
84
|
});
|
|
85
|
+
|
|
86
|
+
it("says what each conventions level changes in a member whose result depends on it, after its prose and before its parameters", () => {
|
|
87
|
+
// Arrange
|
|
88
|
+
const fileWriter = member({
|
|
89
|
+
path: "occt.io.saveShapeSTEP",
|
|
90
|
+
doc: "Writes a STEP file.",
|
|
91
|
+
params: [{ name: "inputs", type: "SaveStepDto", optional: false }],
|
|
92
|
+
conventions: [
|
|
93
|
+
{ level: 1, change: "Files you import and export: a file holds what the screen shows." },
|
|
94
|
+
{ level: 2, change: "Units: a file states its unit." },
|
|
95
|
+
],
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Act
|
|
99
|
+
const text = renderMember(fileWriter, "9.9.9", []);
|
|
100
|
+
|
|
101
|
+
// Assert
|
|
102
|
+
expect(text).toContain("## Conventions level");
|
|
103
|
+
expect(text).toContain("`bitbybit.setConventions`");
|
|
104
|
+
expect(text).toContain("- From level 1: Files you import and export: a file holds what the screen shows.\n- From level 2: Units: a file states its unit.");
|
|
105
|
+
expect(text.indexOf("Writes a STEP file.")).toBeLessThan(text.indexOf("## Conventions level"));
|
|
106
|
+
expect(text.indexOf("## Conventions level")).toBeLessThan(text.indexOf("## Parameters"));
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("gives each engine's documentation and examples in place of one engine's, when the engines document a member differently", () => {
|
|
110
|
+
// Arrange
|
|
111
|
+
const init = member({
|
|
112
|
+
path: "init",
|
|
113
|
+
doc: "Connects the library to a BabylonJS scene.",
|
|
114
|
+
engineDocs: {
|
|
115
|
+
babylonjs: { doc: "Connects the library to a BabylonJS scene.", examples: ["bitbybit.init(scene, occtWorker);"] },
|
|
116
|
+
playcanvas: { doc: "Connects the library to a PlayCanvas application.", examples: ["bitbybit.init(app, app.root, occtWorker);"] },
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Act
|
|
121
|
+
const text = renderMember(init, "9.9.9", [{ path: "init", code: "bitbybit.init(scene, occtWorker);" }]);
|
|
122
|
+
|
|
123
|
+
// Assert
|
|
124
|
+
expect(text).toContain("### playcanvas\n\nConnects the library to a PlayCanvas application.");
|
|
125
|
+
expect(text).toContain("bitbybit.init(app, app.root, occtWorker);");
|
|
126
|
+
expect(text).not.toContain("## Examples");
|
|
127
|
+
expect(text.split("Connects the library to a BabylonJS scene.").length).toBe(2);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("says nothing of conventions for a member that gives the same at every level", () => {
|
|
131
|
+
// Act
|
|
132
|
+
const text = renderMember(member({ conventions: [] }), "9.9.9", []);
|
|
133
|
+
|
|
134
|
+
// Assert
|
|
135
|
+
expect(text).not.toContain("onventions");
|
|
136
|
+
});
|
|
85
137
|
});
|
|
86
138
|
|
|
87
139
|
describe("IndexReader", () => {
|
package/src/render.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IndexExample, IndexField, IndexMember, IndexParam } from "./index-types.js";
|
|
1
|
+
import type { Engine, IndexConventionChange, IndexEngineDoc, IndexExample, IndexField, IndexMember, IndexParam } from "./index-types.js";
|
|
2
2
|
import type { NamedType } from "./index-reader.js";
|
|
3
3
|
import { TIER_MEANING } from "./descriptions.js";
|
|
4
4
|
|
|
@@ -38,6 +38,33 @@ function renderExample(example: IndexExample): string {
|
|
|
38
38
|
return ["```typescript", example.code, "```"].join("\n");
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
function renderConventions(changes: readonly IndexConventionChange[]): string[] {
|
|
42
|
+
if (changes.length === 0) {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
return [
|
|
46
|
+
"## Conventions level",
|
|
47
|
+
"",
|
|
48
|
+
"A conventions level may change what it gives: it is among the operations, or in a service, whose results depend on the level the library runs by. Set the level with `bitbybit.setConventions`, or `conventions` in the options of `initBitByBit`; left unset, the library behaves as it did before levels existed. Describe setConventions for more.",
|
|
49
|
+
...changes.map((change) => `- From level ${change.level}: ${change.change}`),
|
|
50
|
+
"",
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function renderEngineDocs(engineDocs: Partial<Record<Engine, IndexEngineDoc>>): string[] {
|
|
55
|
+
return [
|
|
56
|
+
"Each engine documents it differently:",
|
|
57
|
+
"",
|
|
58
|
+
...Object.entries(engineDocs).flatMap(([engine, { doc, examples }]) => [
|
|
59
|
+
`### ${engine}`,
|
|
60
|
+
"",
|
|
61
|
+
doc,
|
|
62
|
+
"",
|
|
63
|
+
...examples.flatMap((code) => [renderExample({ path: "", code }), ""]),
|
|
64
|
+
]),
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
|
|
41
68
|
function renderTypes(types: readonly NamedType[]): string[] {
|
|
42
69
|
return types.length === 0 ? [] : ["## Types", "", "Describe one by its name for its fields:", ...types.map(({ key, type }) => `- \`${key}\`${type.summary ? `: ${type.summary}` : ""}`), ""];
|
|
43
70
|
}
|
|
@@ -79,11 +106,14 @@ export function renderMember(member: IndexMember, version: string, examples: Ind
|
|
|
79
106
|
if (member.engineSignatures) {
|
|
80
107
|
lines.push("Signature by engine:", ...Object.entries(member.engineSignatures).map(([engine, signature]) => `- ${engine}: \`${signature ?? "none"}\``), "");
|
|
81
108
|
}
|
|
82
|
-
if (member.
|
|
109
|
+
if (member.engineDocs) {
|
|
110
|
+
lines.push(...renderEngineDocs(member.engineDocs));
|
|
111
|
+
} else if (member.doc) {
|
|
83
112
|
lines.push(member.doc, "");
|
|
84
113
|
} else if (member.summary) {
|
|
85
114
|
lines.push(member.summary, "");
|
|
86
115
|
}
|
|
116
|
+
lines.push(...renderConventions(member.conventions ?? []));
|
|
87
117
|
if (member.params.length > 0) {
|
|
88
118
|
lines.push("## Parameters", "");
|
|
89
119
|
for (const param of member.params) {
|
|
@@ -105,7 +135,7 @@ export function renderMember(member: IndexMember, version: string, examples: Ind
|
|
|
105
135
|
lines.push(`## Returns`, "", `\`${member.returns}\`${member.async ? " (async)" : ""}`, "");
|
|
106
136
|
}
|
|
107
137
|
lines.push(...renderTypes(types));
|
|
108
|
-
if (examples.length > 0) {
|
|
138
|
+
if (examples.length > 0 && !member.engineDocs) {
|
|
109
139
|
lines.push("## Examples", "", ...examples.map(renderExample), "");
|
|
110
140
|
}
|
|
111
141
|
if (member.docUrl) {
|
|
@@ -107,6 +107,26 @@ describe("describe", () => {
|
|
|
107
107
|
expect(result.text).toContain("## Examples");
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
+
it("says what a conventions level changes in a member whose result depends on it, in the text and the record", async () => {
|
|
111
|
+
// Act
|
|
112
|
+
const result = await call("describe", { path: "advanced.text3d.create" });
|
|
113
|
+
|
|
114
|
+
// Assert
|
|
115
|
+
const member = structured(result)["member"] as { conventions?: { level: number }[] };
|
|
116
|
+
expect(member.conventions?.map((change) => change.level)).toEqual([1]);
|
|
117
|
+
expect(result.text).toContain("- From level 1: 3D text: reads the right way round");
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("describes a method of the bitbybit object itself, written with the object in front or without", async () => {
|
|
121
|
+
// Act
|
|
122
|
+
const written = await call("describe", { path: "bitbybit.setConventions" });
|
|
123
|
+
const bare = await call("describe", { path: "setConventions" });
|
|
124
|
+
|
|
125
|
+
// Assert
|
|
126
|
+
expect((structured(written)["member"] as { path: string }).path).toBe("setConventions");
|
|
127
|
+
expect(bare.text).toBe(written.text);
|
|
128
|
+
});
|
|
129
|
+
|
|
110
130
|
it("lists the types a member returns in its answer, by full name", async () => {
|
|
111
131
|
// Act
|
|
112
132
|
const result = await call("describe", { path: "ifc.model.summary" });
|
|
@@ -238,6 +258,15 @@ describe("list_namespace", () => {
|
|
|
238
258
|
expect(listed).not.toContain("cloud.unfold.solidToFlat");
|
|
239
259
|
});
|
|
240
260
|
|
|
261
|
+
it("lists the methods of the bitbybit object beside the roots, each with its kind", async () => {
|
|
262
|
+
// Act
|
|
263
|
+
const result = await call("list_namespace", {});
|
|
264
|
+
|
|
265
|
+
// Assert
|
|
266
|
+
expect(paths(structured(result)["members"])).toContain("setConventions");
|
|
267
|
+
expect(result.text).toContain("- setConventions (method): Sets the settings");
|
|
268
|
+
});
|
|
269
|
+
|
|
241
270
|
it("lists a namespace the index carries only through its members", async () => {
|
|
242
271
|
// Act
|
|
243
272
|
const result = await call("list_namespace", { path: "cloud.unfold" });
|
package/src/tools/get-guide.ts
CHANGED
|
@@ -35,6 +35,11 @@ export const GUIDE_ALIASES: Readonly<Record<string, string>> = {
|
|
|
35
35
|
sketch: "sketches",
|
|
36
36
|
assembly: "assemblies",
|
|
37
37
|
"design-mistakes": "mistakes-to-avoid",
|
|
38
|
+
coordinates: "coordinate-systems",
|
|
39
|
+
handedness: "coordinate-systems",
|
|
40
|
+
"right-handed": "coordinate-systems",
|
|
41
|
+
"left-handed": "coordinate-systems",
|
|
42
|
+
conventions: "coordinate-systems",
|
|
38
43
|
geometry: "geometry-in-bitbybit",
|
|
39
44
|
cad: "geometry-in-bitbybit",
|
|
40
45
|
occt: "how-the-bitbybit-occt-kernel-thinks",
|
|
@@ -71,7 +76,7 @@ export const GUIDE_ALIASES: Readonly<Record<string, string>> = {
|
|
|
71
76
|
const MAX_TOPIC_LENGTH = 128;
|
|
72
77
|
|
|
73
78
|
const input = z.object({
|
|
74
|
-
topic: z.string().max(MAX_TOPIC_LENGTH).optional().describe("A section id or a short name such as integrate, browser, backend, server-side, pro, start, geometry, part-order, geometry-mistakes, design, references, assembly, ifc, ifc-order, ifc-mistakes; omit to list the sections"),
|
|
79
|
+
topic: z.string().max(MAX_TOPIC_LENGTH).optional().describe("A section id or a short name such as integrate, browser, backend, server-side, pro, start, geometry, part-order, geometry-mistakes, coordinates, design, references, assembly, ifc, ifc-order, ifc-mistakes; omit to list the sections"),
|
|
75
80
|
});
|
|
76
81
|
|
|
77
82
|
function findSection(guides: readonly GuideSection[], topic: string): GuideSection | undefined {
|
|
@@ -43,7 +43,10 @@ export const listNamespace: ToolDefinition<typeof input, DocsContext> = {
|
|
|
43
43
|
}
|
|
44
44
|
const children = resolved.reader.children(path);
|
|
45
45
|
const members = children.map((member) => ({ path: member.path, kind: member.kind, tier: member.tier, summary: member.summary, engines: member.engines }));
|
|
46
|
-
const
|
|
46
|
+
const rootMethods = !path && children.some((member) => member.kind !== "namespace");
|
|
47
|
+
const heading = path
|
|
48
|
+
? `${path}${parent?.summary ? `: ${parent.summary}` : ""}`
|
|
49
|
+
: `The top level of the Bitbybit API ${resolved.version}: its namespaces${rootMethods ? ", and the methods of the bitbybit object itself" : ""}`;
|
|
47
50
|
const text = [heading, ...children.map(renderLine)].join("\n");
|
|
48
51
|
return ok(text, { version: resolved.version, path: path ?? null, members });
|
|
49
52
|
},
|