@bitbybit-dev/create-app 1.4.1 → 1.5.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 -0
- package/dist/index.js +20 -13
- package/dist/index.js.map +1 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +16 -8
- package/dist/scaffold.js.map +1 -1
- package/package.json +1 -1
- package/src/index.test.ts +47 -11
- package/src/index.ts +28 -14
- package/src/scaffold.ts +23 -8
- package/templates/apps/drone-assembly/package.json +3 -3
- package/templates/apps/drone-assembly/scripts/smoke.ts +3 -3
- package/templates/apps/drone-assembly/src/parts.ts +3 -3
- package/templates/apps/ifc-house/AGENTS.section.md +19 -0
- package/templates/apps/ifc-house/README.md +36 -0
- package/templates/apps/ifc-house/eslint.config.js +47 -0
- package/templates/apps/ifc-house/index.html +22 -0
- package/templates/apps/ifc-house/package.json +36 -0
- package/templates/apps/ifc-house/public/favicon.ico +0 -0
- package/templates/apps/ifc-house/public/logo.png +0 -0
- package/templates/apps/ifc-house/scripts/smoke.ts +118 -0
- package/templates/apps/ifc-house/src/export/step-export.ts +29 -0
- package/templates/apps/ifc-house/src/house/build-house.ts +194 -0
- package/templates/apps/ifc-house/src/house/details.ts +393 -0
- package/templates/apps/ifc-house/src/house/house-plan.ts +400 -0
- package/templates/apps/ifc-house/src/house/house-types.ts +192 -0
- package/templates/apps/ifc-house/src/main.ts +138 -0
- package/templates/apps/ifc-house/src/scene/draw-house.ts +92 -0
- package/templates/apps/ifc-house/src/scene/scene-types.ts +30 -0
- package/templates/apps/ifc-house/src/scene/stage.ts +64 -0
- package/templates/apps/ifc-house/src/style.css +347 -0
- package/templates/apps/ifc-house/src/ui/panel.ts +144 -0
- package/templates/apps/ifc-house/src/ui/room-labels.ts +75 -0
- package/templates/apps/ifc-house/src/ui/ui-types.ts +14 -0
- package/templates/apps/ifc-house/src/vite-env.d.ts +1 -0
- package/templates/apps/ifc-house/src/workers/ifc.worker.ts +7 -0
- package/templates/apps/ifc-house/src/workers/manifold.worker.ts +16 -0
- package/templates/apps/ifc-house/src/workers/occt.worker.ts +17 -0
- package/templates/apps/ifc-house/tsconfig.json +29 -0
- package/templates/apps/laser-cut-box/package.json +2 -2
- package/templates/apps/laser-cut-box/scripts/smoke.ts +2 -1
- package/templates/apps/laser-cut-box/src/panels.ts +2 -0
- package/templates/apps/product-configurator/package.json +2 -2
- package/templates/apps/product-configurator/scripts/smoke.ts +4 -3
- package/templates/apps/sheet-metal-unfold/backend/package.json +1 -1
- package/templates/apps/sheet-metal-unfold/frontend/package.json +2 -2
- package/templates/apps/sheet-metal-unfold/frontend/scripts/smoke.ts +4 -3
- package/templates/apps/step-to-gltf-cli/package.json +2 -2
- package/templates/apps/step-to-gltf-cli/src/convert.ts +7 -2
- package/templates/cloud/backends/hono-rest/package.json +1 -1
- package/templates/cloud/backends/hono-sdk/package.json +2 -2
- package/templates/cloud/backends/nodejs-rest/package.json +1 -1
- package/templates/cloud/backends/nodejs-sdk/package.json +2 -2
- package/templates/cloud/frontend/package.json +1 -1
- package/templates/vite/babylonjs/typescript/AGENTS.section.md +1 -1
- package/templates/vite/babylonjs/typescript/package.json +2 -2
- package/templates/vite/babylonjs/typescript/scripts/smoke.ts +4 -3
- package/templates/vite/playcanvas/typescript/AGENTS.section.md +1 -1
- package/templates/vite/playcanvas/typescript/package.json +2 -2
- package/templates/vite/playcanvas/typescript/scripts/smoke.ts +4 -3
- package/templates/vite/threejs/typescript/AGENTS.section.md +1 -1
- package/templates/vite/threejs/typescript/package.json +2 -2
- package/templates/vite/threejs/typescript/scripts/smoke.ts +4 -3
|
@@ -18,13 +18,14 @@ const occt = inProcess(new OCCTService(occ, new OccHelper(new VectorHelperServic
|
|
|
18
18
|
|
|
19
19
|
const shape = await buildModel(occt, defaultParams);
|
|
20
20
|
const info = await occt.shapes.solid.debugInfo({ shape });
|
|
21
|
-
const
|
|
21
|
+
const valid = await occt.shapeFix.isValid({ shape });
|
|
22
|
+
const bbox = await occt.analysis.measure.tightBoundingBox({ shape });
|
|
22
23
|
const round = (n: number): number => Math.round(n * 1000) / 1000;
|
|
23
24
|
|
|
24
25
|
console.log(JSON.stringify({
|
|
25
26
|
template: "vite-playcanvas",
|
|
26
27
|
params: defaultParams,
|
|
27
|
-
valid
|
|
28
|
+
valid,
|
|
28
29
|
faces: info.nbFaces,
|
|
29
30
|
edges: info.nbEdges,
|
|
30
31
|
volume: round(info.volume),
|
|
@@ -33,7 +34,7 @@ console.log(JSON.stringify({
|
|
|
33
34
|
}));
|
|
34
35
|
|
|
35
36
|
const problems: string[] = [];
|
|
36
|
-
if (!
|
|
37
|
+
if (!valid) problems.push("the model is not a valid solid");
|
|
37
38
|
if (!(info.volume > 0)) problems.push("the model has no volume");
|
|
38
39
|
if (problems.length) {
|
|
39
40
|
console.error(`smoke: ${problems.join("; ")}`);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
- `src/model.ts` is the geometry. `buildModel(occt, params)` builds the OCCT shape from `ModelParams` and returns it. It knows nothing about rendering, and every kernel call is awaited, so the same function runs in the browser (through the OCCT worker, whose calls return promises) and in Node (in-process, whose calls return values). Put new geometry here, and new parameters in `ModelParams` with a default in `defaultParams`.
|
|
4
4
|
- `src/main.ts` is the wiring: it starts the Three.js scene, initialises Bitbybit, calls `buildModel` and draws the result. The Manifold and JSCAD demonstrations live here as well. Keep geometry out of this file.
|
|
5
|
-
- `scripts/smoke.ts` loads the OCCT kernel in Node, runs `buildModel` with `defaultParams` and prints one JSON line with the field names `template`, `params`, `valid`, `faces`, `edges`, `volume`, `area` and `bbox
|
|
5
|
+
- `scripts/smoke.ts` loads the OCCT kernel in Node, runs `buildModel` with `defaultParams` and prints one JSON line with the field names `template`, `params`, `valid`, `faces`, `edges`, `volume`, `area` and `bbox`, the box that just holds the exact geometry (`analysis.measure.tightBoundingBox`). It exits 1 when `shapeFix.isValid` finds the shape malformed or it has no volume; `debugInfo`'s own `valid` only says the shape is not empty. Add an assertion here when a change to the model has a fact worth pinning, such as a face count or a bounding box.
|
|
6
6
|
|
|
7
7
|
Commands:
|
|
8
8
|
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"lint": "eslint . --max-warnings 0"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@bitbybit-dev/threejs": "1.
|
|
15
|
+
"@bitbybit-dev/threejs": "1.5.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@bitbybit-dev/occt": "1.
|
|
18
|
+
"@bitbybit-dev/occt": "1.5.0",
|
|
19
19
|
"@eslint/js": "10.0.1",
|
|
20
20
|
"@types/node": "22.20.1",
|
|
21
21
|
"@types/three": "0.186.0",
|
|
@@ -18,13 +18,14 @@ const occt = inProcess(new OCCTService(occ, new OccHelper(new VectorHelperServic
|
|
|
18
18
|
|
|
19
19
|
const shape = await buildModel(occt, defaultParams);
|
|
20
20
|
const info = await occt.shapes.solid.debugInfo({ shape });
|
|
21
|
-
const
|
|
21
|
+
const valid = await occt.shapeFix.isValid({ shape });
|
|
22
|
+
const bbox = await occt.analysis.measure.tightBoundingBox({ shape });
|
|
22
23
|
const round = (n: number): number => Math.round(n * 1000) / 1000;
|
|
23
24
|
|
|
24
25
|
console.log(JSON.stringify({
|
|
25
26
|
template: "vite-threejs",
|
|
26
27
|
params: defaultParams,
|
|
27
|
-
valid
|
|
28
|
+
valid,
|
|
28
29
|
faces: info.nbFaces,
|
|
29
30
|
edges: info.nbEdges,
|
|
30
31
|
volume: round(info.volume),
|
|
@@ -33,7 +34,7 @@ console.log(JSON.stringify({
|
|
|
33
34
|
}));
|
|
34
35
|
|
|
35
36
|
const problems: string[] = [];
|
|
36
|
-
if (!
|
|
37
|
+
if (!valid) problems.push("the model is not a valid solid");
|
|
37
38
|
if (!(info.volume > 0)) problems.push("the model has no volume");
|
|
38
39
|
if (problems.length) {
|
|
39
40
|
console.error(`smoke: ${problems.join("; ")}`);
|