Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Basic Test

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run install-rebuild-all-packages
- run: npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
29 changes: 29 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 38 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,51 @@
{
"name": "bitbybit",
"version": "0.19.0",
"version": "0.19.1",
"description": "Monorepo for browser CAD which holds bitbybit.dev npm packages",
"main": "index.js",
"scripts": {
"ci-base": "cd packages/dev/base && npm ci",
"ci-core": "cd packages/dev/core && npm ci",
"ci-threejs": "cd packages/dev/threejs && npm ci",
"ci-babylonjs": "cd packages/dev/babylonjs && npm ci",
"ci-occt-worker": "cd packages/dev/occt-worker && npm ci",
"ci-occt": "cd packages/dev/occt && npm ci",
"ci-jscad-worker": "cd packages/dev/jscad-worker && npm ci",
"ci-jscad": "cd packages/dev/jscad && npm ci",
"ci-manifold-worker": "cd packages/dev/manifold-worker && npm ci",
"ci-manifold": "cd packages/dev/manifold && npm ci",
"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",
"rm-dist-base-if-exists": "rm -rf packages/dev/base/dist || true",
"rm-dist-core-if-exists": "rm -rf packages/dev/core/dist || true",
"rm-dist-threejs-if-exists": "rm -rf packages/dev/threejs/dist || true",
"rm-dist-babylonjs-if-exists": "rm -rf packages/dev/babylonjs/dist || true",
"rm-dist-occt-worker-if-exists": "rm -rf packages/dev/occt-worker/dist || true",
"rm-dist-occt-if-exists": "rm -rf packages/dev/occt/dist || true",
"rm-dist-jscad-worker-if-exists": "rm -rf packages/dev/jscad-worker/dist || true",
"rm-dist-jscad-if-exists": "rm -rf packages/dev/jscad/dist || true",
"rm-dist-manifold-worker-if-exists": "rm -rf packages/dev/manifold-worker/dist || true",
"rm-dist-manifold-if-exists": "rm -rf packages/dev/manifold/dist || true",
"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",
"build-base": "cd packages/dev/base && npm run build-p",
"build-core": "cd packages/dev/core && npm run build-p",
"build-threejs": "cd packages/dev/threejs && npm run build-p",
"build-babylonjs": "cd packages/dev/babylonjs && npm run build-p",
"build-occt-worker": "cd packages/dev/occt-worker && npm run build-p",
"build-occt": "cd packages/dev/occt && npm run build-p",
"build-jscad-worker": "cd packages/dev/jscad-worker && npm run build-p",
"build-jscad": "cd packages/dev/jscad && npm run build-p",
"build-manifold-worker": "cd packages/dev/manifold-worker && npm run build-p",
"build-manifold": "cd packages/dev/manifold && npm run build-p",
"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",
"rebuild-all-packages": "npm run rm-dist-packages && npm run build-packages",
"install-rebuild-all-packages": "npm run ci-packages && npm run rebuild-all-packages",
"test-base": "cd packages/dev/base && npm run test-c",
"test-occt": "cd packages/dev/occt && npm run test-c",
"test-core": "cd packages/dev/core && npm run test-c",
"test-jscad": "cd packages/dev/jscad && npm run test-c",
"test-manifold": "cd packages/dev/manifold && npm run test-c",
"test": "npm run test-occt && npm run test-base && npm run test-core && npm run test-jscad && npm run test-manifold"
"test-threejs": "cd packages/dev/threejs && npm run test-c",
"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"
},
"repository": {
"type": "git",
Expand Down
9 changes: 4 additions & 5 deletions packages/dev/babylonjs/lib/api/bitbybit/babylon/io.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import * as Inputs from "../../inputs/inputs";
import { GLTF2Export } from "@babylonjs/serializers/glTF/2.0";
import * as SERIALIZERS from "@babylonjs/serializers";
import * as BABYLON from "@babylonjs/core";
import { Context } from "../../context";
import { STLExport } from "@babylonjs/serializers";

export class BabylonIO {

Expand Down Expand Up @@ -130,7 +129,7 @@ export class BabylonIO {
}
};
}
GLTF2Export.GLBAsync(this.context.scene, inputs.fileName, options).then((glb) => {
SERIALIZERS.GLTF2Export.GLBAsync(this.context.scene, inputs.fileName, options).then((glb) => {
glb.downloadFiles();
});
}
Expand All @@ -149,7 +148,7 @@ export class BabylonIO {
}
let meshes: BABYLON.Mesh[] = [inputs.mesh, ...childrenMeshes];
meshes = meshes.filter(m => m.isVisible);
STLExport.CreateSTL(meshes as BABYLON.Mesh[], true, inputs.fileName, true, true, true);
SERIALIZERS.STLExport.CreateSTL(meshes as BABYLON.Mesh[], true, inputs.fileName, true, true, true);
return Promise.resolve({});
}

Expand All @@ -173,7 +172,7 @@ export class BabylonIO {
}
});

STLExport.CreateSTL(meshes as BABYLON.Mesh[], true, inputs.fileName, true, true, true);
SERIALIZERS.STLExport.CreateSTL(meshes as BABYLON.Mesh[], true, inputs.fileName, true, true, true);
return Promise.resolve({});
}

Expand Down
15 changes: 7 additions & 8 deletions packages/dev/babylonjs/lib/api/bitbybit/babylon/scene.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

import { Context } from "../../context";
import * as BABYLON from "@babylonjs/core";
import * as GUI from "@babylonjs/gui";
import * as Inputs from "../../inputs/inputs";
import { Base } from "../../inputs/base-inputs";
import { Scene } from "@babylonjs/core";
import { GUI3DManager } from "@babylonjs/gui";


export class BabylonScene {
Expand Down Expand Up @@ -267,7 +266,7 @@ export class BabylonScene {
scene.environmentTexture.dispose();
}
scene.environmentTexture = null;
scene.fogMode = Scene.FOGMODE_NONE;
scene.fogMode = BABYLON.Scene.FOGMODE_NONE;
scene.meshes.forEach(m => m.dispose());
scene.meshes = [];
scene.materials.forEach(m => m.dispose());
Expand Down Expand Up @@ -309,7 +308,7 @@ export class BabylonScene {
(scene.metadata.xr as BABYLON.WebXRDefaultExperience).dispose();
}
if (scene.metadata.guiManager) {
(scene.metadata.guiManager as GUI3DManager).dispose();
(scene.metadata.guiManager as GUI.GUI3DManager).dispose();
}
}
scene.transformNodes = [scene.getTransformNodeByName("root")];
Expand All @@ -336,14 +335,14 @@ export class BabylonScene {
enableSkybox(inputs: Inputs.BabylonScene.SkyboxDto): void {
let texture: BABYLON.CubeTexture;
if (inputs.skybox === Inputs.Base.skyboxEnum.default) {
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].0/textures/skybox/default_skybox/skybox", this.context.scene);
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].1/textures/skybox/default_skybox/skybox", this.context.scene);
} else if (inputs.skybox === Inputs.Base.skyboxEnum.greyGradient) {
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].0/textures/skybox/grey_gradient/skybox", this.context.scene);
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].1/textures/skybox/grey_gradient/skybox", this.context.scene);
} else if (inputs.skybox === Inputs.Base.skyboxEnum.clearSky) {
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].0/textures/skybox/clear_sky/environment.env",
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].1/textures/skybox/clear_sky/environment.env",
this.context.scene, false, false);
} else if (inputs.skybox === Inputs.Base.skyboxEnum.city) {
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].0/textures/skybox/city/environmentSpecular.env",
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/[email protected].1/textures/skybox/city/environmentSpecular.env",
this.context.scene, false, false);
}

Expand Down
Loading
Loading