Skip to content

Commit 85b66a3

Browse files
Merge pull request #55 from bitbybit-dev/develop
v0.19.1
2 parents 0d52c3c + d1bcfc8 commit 85b66a3

34 files changed

+694
-1049
lines changed

.github/workflows/basic.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Basic Test
5+
6+
on:
7+
push:
8+
branches: [ "develop" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [18.x, 20.x, 22.x]
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: 'npm'
29+
- run: npm ci
30+
- run: npm run install-rebuild-all-packages
31+
- run: npm test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

package-lock.json

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+38-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,51 @@
11
{
22
"name": "bitbybit",
3-
"version": "0.19.0",
3+
"version": "0.19.1",
44
"description": "Monorepo for browser CAD which holds bitbybit.dev npm packages",
55
"main": "index.js",
66
"scripts": {
7+
"ci-base": "cd packages/dev/base && npm ci",
8+
"ci-core": "cd packages/dev/core && npm ci",
9+
"ci-threejs": "cd packages/dev/threejs && npm ci",
10+
"ci-babylonjs": "cd packages/dev/babylonjs && npm ci",
11+
"ci-occt-worker": "cd packages/dev/occt-worker && npm ci",
12+
"ci-occt": "cd packages/dev/occt && npm ci",
13+
"ci-jscad-worker": "cd packages/dev/jscad-worker && npm ci",
14+
"ci-jscad": "cd packages/dev/jscad && npm ci",
15+
"ci-manifold-worker": "cd packages/dev/manifold-worker && npm ci",
16+
"ci-manifold": "cd packages/dev/manifold && npm ci",
17+
"ci-packages": "npm run ci-base && npm run ci-core && npm run ci-threejs && npm run ci-babylonjs && npm run ci-occt-worker && npm run ci-occt && npm run ci-jscad-worker && npm run ci-jscad && npm run ci-manifold-worker && npm run ci-manifold",
18+
"rm-dist-base-if-exists": "rm -rf packages/dev/base/dist || true",
19+
"rm-dist-core-if-exists": "rm -rf packages/dev/core/dist || true",
20+
"rm-dist-threejs-if-exists": "rm -rf packages/dev/threejs/dist || true",
21+
"rm-dist-babylonjs-if-exists": "rm -rf packages/dev/babylonjs/dist || true",
22+
"rm-dist-occt-worker-if-exists": "rm -rf packages/dev/occt-worker/dist || true",
23+
"rm-dist-occt-if-exists": "rm -rf packages/dev/occt/dist || true",
24+
"rm-dist-jscad-worker-if-exists": "rm -rf packages/dev/jscad-worker/dist || true",
25+
"rm-dist-jscad-if-exists": "rm -rf packages/dev/jscad/dist || true",
26+
"rm-dist-manifold-worker-if-exists": "rm -rf packages/dev/manifold-worker/dist || true",
27+
"rm-dist-manifold-if-exists": "rm -rf packages/dev/manifold/dist || true",
28+
"rm-dist-packages": "npm run rm-dist-base-if-exists && npm run rm-dist-core-if-exists && npm run rm-dist-threejs-if-exists && npm run rm-dist-babylonjs-if-exists && npm run rm-dist-occt-worker-if-exists && npm run rm-dist-occt-if-exists && npm run rm-dist-jscad-worker-if-exists && npm run rm-dist-jscad-if-exists && npm run rm-dist-manifold-worker-if-exists && npm run rm-dist-manifold-if-exists",
29+
"build-base": "cd packages/dev/base && npm run build-p",
30+
"build-core": "cd packages/dev/core && npm run build-p",
31+
"build-threejs": "cd packages/dev/threejs && npm run build-p",
32+
"build-babylonjs": "cd packages/dev/babylonjs && npm run build-p",
33+
"build-occt-worker": "cd packages/dev/occt-worker && npm run build-p",
34+
"build-occt": "cd packages/dev/occt && npm run build-p",
35+
"build-jscad-worker": "cd packages/dev/jscad-worker && npm run build-p",
36+
"build-jscad": "cd packages/dev/jscad && npm run build-p",
37+
"build-manifold-worker": "cd packages/dev/manifold-worker && npm run build-p",
38+
"build-manifold": "cd packages/dev/manifold && npm run build-p",
39+
"build-packages": "npm run build-base && npm run build-occt && npm run build-jscad && npm run build-manifold && npm run build-occt-worker && npm run build-jscad-worker && npm run build-manifold-worker && npm run build-core && npm run build-babylonjs && npm run build-threejs",
40+
"rebuild-all-packages": "npm run rm-dist-packages && npm run build-packages",
41+
"install-rebuild-all-packages": "npm run ci-packages && npm run rebuild-all-packages",
742
"test-base": "cd packages/dev/base && npm run test-c",
843
"test-occt": "cd packages/dev/occt && npm run test-c",
944
"test-core": "cd packages/dev/core && npm run test-c",
1045
"test-jscad": "cd packages/dev/jscad && npm run test-c",
1146
"test-manifold": "cd packages/dev/manifold && npm run test-c",
12-
"test": "npm run test-occt && npm run test-base && npm run test-core && npm run test-jscad && npm run test-manifold"
47+
"test-threejs": "cd packages/dev/threejs && npm run test-c",
48+
"test": "npm run test-occt && npm run test-base && npm run test-core && npm run test-jscad && npm run test-manifold && npm run test-threejs"
1349
},
1450
"repository": {
1551
"type": "git",

packages/dev/babylonjs/lib/api/bitbybit/babylon/io.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as Inputs from "../../inputs/inputs";
2-
import { GLTF2Export } from "@babylonjs/serializers/glTF/2.0";
2+
import * as SERIALIZERS from "@babylonjs/serializers";
33
import * as BABYLON from "@babylonjs/core";
44
import { Context } from "../../context";
5-
import { STLExport } from "@babylonjs/serializers";
65

76
export class BabylonIO {
87

@@ -130,7 +129,7 @@ export class BabylonIO {
130129
}
131130
};
132131
}
133-
GLTF2Export.GLBAsync(this.context.scene, inputs.fileName, options).then((glb) => {
132+
SERIALIZERS.GLTF2Export.GLBAsync(this.context.scene, inputs.fileName, options).then((glb) => {
134133
glb.downloadFiles();
135134
});
136135
}
@@ -149,7 +148,7 @@ export class BabylonIO {
149148
}
150149
let meshes: BABYLON.Mesh[] = [inputs.mesh, ...childrenMeshes];
151150
meshes = meshes.filter(m => m.isVisible);
152-
STLExport.CreateSTL(meshes as BABYLON.Mesh[], true, inputs.fileName, true, true, true);
151+
SERIALIZERS.STLExport.CreateSTL(meshes as BABYLON.Mesh[], true, inputs.fileName, true, true, true);
153152
return Promise.resolve({});
154153
}
155154

@@ -173,7 +172,7 @@ export class BabylonIO {
173172
}
174173
});
175174

176-
STLExport.CreateSTL(meshes as BABYLON.Mesh[], true, inputs.fileName, true, true, true);
175+
SERIALIZERS.STLExport.CreateSTL(meshes as BABYLON.Mesh[], true, inputs.fileName, true, true, true);
177176
return Promise.resolve({});
178177
}
179178

packages/dev/babylonjs/lib/api/bitbybit/babylon/scene.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11

22
import { Context } from "../../context";
33
import * as BABYLON from "@babylonjs/core";
4+
import * as GUI from "@babylonjs/gui";
45
import * as Inputs from "../../inputs/inputs";
56
import { Base } from "../../inputs/base-inputs";
6-
import { Scene } from "@babylonjs/core";
7-
import { GUI3DManager } from "@babylonjs/gui";
87

98

109
export class BabylonScene {
@@ -267,7 +266,7 @@ export class BabylonScene {
267266
scene.environmentTexture.dispose();
268267
}
269268
scene.environmentTexture = null;
270-
scene.fogMode = Scene.FOGMODE_NONE;
269+
scene.fogMode = BABYLON.Scene.FOGMODE_NONE;
271270
scene.meshes.forEach(m => m.dispose());
272271
scene.meshes = [];
273272
scene.materials.forEach(m => m.dispose());
@@ -309,7 +308,7 @@ export class BabylonScene {
309308
(scene.metadata.xr as BABYLON.WebXRDefaultExperience).dispose();
310309
}
311310
if (scene.metadata.guiManager) {
312-
(scene.metadata.guiManager as GUI3DManager).dispose();
311+
(scene.metadata.guiManager as GUI.GUI3DManager).dispose();
313312
}
314313
}
315314
scene.transformNodes = [scene.getTransformNodeByName("root")];
@@ -336,14 +335,14 @@ export class BabylonScene {
336335
enableSkybox(inputs: Inputs.BabylonScene.SkyboxDto): void {
337336
let texture: BABYLON.CubeTexture;
338337
if (inputs.skybox === Inputs.Base.skyboxEnum.default) {
339-
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].0/textures/skybox/default_skybox/skybox", this.context.scene);
338+
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].1/textures/skybox/default_skybox/skybox", this.context.scene);
340339
} else if (inputs.skybox === Inputs.Base.skyboxEnum.greyGradient) {
341-
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].0/textures/skybox/grey_gradient/skybox", this.context.scene);
340+
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].1/textures/skybox/grey_gradient/skybox", this.context.scene);
342341
} else if (inputs.skybox === Inputs.Base.skyboxEnum.clearSky) {
343-
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].0/textures/skybox/clear_sky/environment.env",
342+
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].1/textures/skybox/clear_sky/environment.env",
344343
this.context.scene, false, false);
345344
} else if (inputs.skybox === Inputs.Base.skyboxEnum.city) {
346-
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].0/textures/skybox/city/environmentSpecular.env",
345+
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].1/textures/skybox/city/environmentSpecular.env",
347346
this.context.scene, false, false);
348347
}
349348

0 commit comments

Comments
 (0)