Skip to content

Commit e5e018f

Browse files
Merge pull request #51 from bitbybit-dev/master
merging master to develop
2 parents bc73354 + e352468 commit e5e018f

1,027 files changed

Lines changed: 224769 additions & 63802 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Bit By Bit Developers
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,45 @@
1-
# Bit by bit developers core library
2-
This project contains core 3D algorithms of Bit by bit developers platform which are open-sourced under MIT license. This library was previously UI dependant and is now separated to ensure protection of our corporate identity and cloud services.
1+
## Bit By Bit Developers monorepo
2+
3+
<img src="https://app.bitbybit.dev/assets/git-cover.png" alt="Picture showing bitbybit.dev platform">
4+
5+
This git repo contains multiple bitbybit packages and contains code for 3D algorithms of Bit By Bit Developers platform which are open-sourced under MIT license. This library was previously UI dependant and was heaviy intertwined with BabylonJS game engine. It is now decoupled from our editors to ensure protection of our corporate identity and cloud services. BabylonJS layer is now also separated into special package @bitbybit-dev/babylonjs - this will cause the breaking change in v0.18.0. If you are using the version prior to v0.18.0 and depend on the @bitbybit-dev/core package, please consider updating to use @bitbybit-dev/babylonjs NPM package. @bitbybit-dev/core is now game engine independent layer.
36

47
Visit https://bitbybit.dev to use our full cloud platform.
58

6-
# Github
9+
## Github
710
https://github.com/bitbybit-dev/bitbybit
8-
# NPM
9-
https://www.npmjs.com/package/bitbybit-core
10-
11-
# Example Applications
12-
Laptop Holder
13-
https://laptop-holder.bitbybit.dev
14-
Github Source Code Angular - https://github.com/bitbybit-dev/app-examples/tree/main/angular/laptop-holder
15-
Github Source Code React - https://github.com/bitbybit-dev/app-examples/tree/main/react/laptop-holder
11+
## NPM Packages
12+
https://www.npmjs.com/package/@bitbybit-dev/babylonjs
13+
https://www.npmjs.com/package/@bitbybit-dev/threejs
14+
https://www.npmjs.com/package/@bitbybit-dev/core
15+
16+
## Example Applications
17+
Laptop Holder
18+
https://app-store.bitbybit.dev/laptop-holder
19+
Github Source Code Angular - https://github.com/bitbybit-dev/app-examples/tree/main/angular/laptop-holder
20+
Github Source Code React - https://github.com/bitbybit-dev/app-examples/tree/main/react/laptop-holder
1621

17-
Cup Configurator
18-
https://app-cup.bitbybit.dev
22+
Cup Configurator
23+
https://app-store.bitbybit.dev/cup
1924
Github Source Code - https://github.com/bitbybit-dev/app-examples/tree/main/react/cup
20-
21-
# Build package
22-
tsc -p tsconfig.bitbybit.json
2325

24-
# Media Channels
26+
## Closed Source Example Applications
27+
https://app-store.bitbybit.dev/terrace-furniture
28+
29+
## Media Channels
2530
Discord: https://discord.gg/GSe3VMe
26-
Youtube: https://www.youtube.com/channel/UCWM0VODRsLYOjB2IAaFHBSQ
31+
Youtube: https://www.youtube.com/@bitbybitdev?sub_confirmation=1
2732
Instagram: https://www.instagram.com/bitbybit.dev
2833
Twitter: https://twitter.com/bitbybit_dev
2934
LinkedIn: https://lnkd.in/gQjEQA2
3035
Facebook: https://www.facebook.com/bitbybitdev
3136
Medium: https://bitbybit-dev.medium.com/
3237

33-
# Principles
34-
Bit by bit developers company will keep these core algorithms that you can find in this repository free and opensource for its users. These algorithms are based on other open-source projects, run and are deployed on the browser, thus there is no point of closing them down from public.
38+
## Principles
39+
Bit By Bit Developers company will keep these core algorithms that you can find in this repository free and opensource for its users. These algorithms are based on other open-source projects, run and are deployed on the browser, thus there is no point of closing them down from public.
3540

36-
# About Bit by bit developers platform
37-
Bit by bit developers web platform allows creators to program geometry through simple visual programming language or choose monaco typescript editor with full intellisense of bitbybit API. This cloud platform can fulfil many practical, educational and artistic needs of its users. Through familiar programming interface used in tools such as Scratch and Blockly.Games we expose powerful 3D algorithms that make it easier to implement various parametric tasks. Our goal is to make it very simple for users to share their ideas and designs. We want to encourage everyone to engage in the future of this tool.
41+
## About Bit By Bit Developers platform
42+
Bit By Bit Developers web platform allows creators to program geometry through simple visual programming language or choose monaco typescript editor with full intellisense of bitbybit API. This cloud platform can fulfil many practical, educational and artistic needs of its users. Through familiar programming interface used in tools such as Scratch and Blockly.Games we expose powerful 3D algorithms that make it easier to implement various parametric tasks. Our goal is to make it very simple for users to share their ideas and designs. We want to encourage everyone to engage in the future of this tool.
3843

39-
# Major Dependencies
40-
BabylonJS, Blockly, OpenCascade, JSCAD, Verbnurbs
44+
## Major Dependencies
45+
BabylonJS, ThreeJS, OpenCascade, JSCAD, Verbnurbs

packages/dev/babylonjs/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/node_modules
2+
node_modules
3+
dist
4+
.DS_Store
5+
blockly
6+
.scully
7+
ts-api-docs
8+
csg-generated.js
9+
*.d.ts
10+
!bitbybit-dev-occt.d.ts
11+
coverage
12+
declarations/generated-dec

packages/dev/babylonjs/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Bit By Bit Developers
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/dev/babylonjs/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Bit By Bit Developers library for BABYLONJS game engine
2+
3+
<img src="https://app.bitbybit.dev/assets/git-cover.png" alt="Picture showing bitbybit.dev platform">
4+
5+
This project exposes 3D algorithms of Bit By Bit Developers platform through BABYLONJS game engine. Code is open-sourced under MIT license. This library was previously intertwined in core package and is now separated.
6+
7+
Visit https://bitbybit.dev to use our full cloud platform.
8+
9+
## Github
10+
https://github.com/bitbybit-dev/bitbybit
11+
## NPM
12+
https://www.npmjs.com/package/@bitbybit-dev/babylonjs
13+
14+
## Example Applications
15+
Laptop Holder
16+
https://app-store.bitbybit.dev/laptop-holder
17+
Github Source Code Angular - https://github.com/bitbybit-dev/app-examples/tree/main/angular/laptop-holder
18+
Github Source Code React - https://github.com/bitbybit-dev/app-examples/tree/main/react/laptop-holder
19+
20+
Cup Configurator
21+
https://app-store.bitbybit.dev/cup
22+
Github Source Code - https://github.com/bitbybit-dev/app-examples/tree/main/react/cup
23+
24+
## Closed Source Example Applications
25+
https://app-store.bitbybit.dev/terrace-furniture
26+
27+
## Build package
28+
tsc -p tsconfig.bitbybit.json
29+
30+
## Media Channels
31+
Discord: https://discord.gg/GSe3VMe
32+
Youtube: https://www.youtube.com/@bitbybitdev?sub_confirmation=1
33+
Instagram: https://www.instagram.com/bitbybit.dev
34+
Twitter: https://twitter.com/bitbybit_dev
35+
LinkedIn: https://lnkd.in/gQjEQA2
36+
Facebook: https://www.facebook.com/bitbybitdev
37+
Medium: https://bitbybit-dev.medium.com/
38+
39+
## Principles
40+
Bit By Bit Developers company will keep these core algorithms that you can find in this repository free and opensource for its users. These algorithms are based on other open-source projects, run and are deployed on the browser, thus there is no point of closing them down from public.
41+
42+
## About Bit By Bit Developers platform
43+
Bit By Bit Developers web platform allows creators to program geometry through simple visual programming language or choose monaco typescript editor with full intellisense of bitbybit API. This cloud platform can fulfil many practical, educational and artistic needs of its users. Through familiar programming interface used in tools such as Scratch and Blockly.Games we expose powerful 3D algorithms that make it easier to implement various parametric tasks. Our goal is to make it very simple for users to share their ideas and designs. We want to encourage everyone to engage in the future of this tool.
44+
45+
## Major Dependencies
46+
BabylonJS, Rete, Blockly, OpenCascade, JSCAD, Verbnurbs
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
targets: {
7+
node: 'current',
8+
},
9+
},
10+
],
11+
'@babel/preset-typescript'
12+
],
13+
};

packages/dev/babylonjs/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
* Public API Surface of bitbybit-core
3+
*/
4+
5+
export * from "./lib";
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
import { OCCT as BaseOCCT, OCCTWorkerManager } from "@bitbybit-dev/occt-worker";
2+
import { JSONPath } from "jsonpath-plus";
3+
import { Babylon } from "./bitbybit/babylon/babylon";
4+
import {
5+
Line,
6+
Polyline,
7+
Verb,
8+
Tag,
9+
Time,
10+
OCCTW,
11+
Asset,
12+
JSONBitByBit,
13+
} from "@bitbybit-dev/core";
14+
import {
15+
Vector,
16+
Point,
17+
TextBitByBit,
18+
Color,
19+
MathBitByBit,
20+
GeometryHelper,
21+
Lists,
22+
Logic,
23+
Transforms
24+
} from "@bitbybit-dev/base";
25+
import {
26+
JSCAD
27+
} from "@bitbybit-dev/jscad-worker";
28+
import { ManifoldBitByBit } from "@bitbybit-dev/manifold-worker";
29+
import { Draw } from "./bitbybit/draw";
30+
import { Context } from "./context";
31+
import { JSCADWorkerManager } from "@bitbybit-dev/jscad-worker";
32+
import { ManifoldWorkerManager } from "@bitbybit-dev/manifold-worker";
33+
import * as BABYLON from "@babylonjs/core";
34+
import * as vrb from "verb-nurbs-web";
35+
import { DrawHelper } from "./draw-helper";
36+
37+
export class BitByBitBase {
38+
39+
public context: Context;
40+
public jscadWorkerManager: JSCADWorkerManager;
41+
public manifoldWorkerManager: ManifoldWorkerManager;
42+
public occtWorkerManager: OCCTWorkerManager;
43+
44+
public math: MathBitByBit;
45+
public logic: Logic;
46+
public lists: Lists;
47+
public json: JSONBitByBit;
48+
public vector: Vector;
49+
public babylon: Babylon;
50+
public point: Point;
51+
public line: Line;
52+
public transforms: Transforms;
53+
public polyline: Polyline;
54+
public draw: Draw;
55+
public verb: Verb;
56+
public jscad: JSCAD;
57+
public manifold: ManifoldBitByBit;
58+
public text: TextBitByBit;
59+
public tag: Tag;
60+
public time: Time;
61+
public occt: OCCTW & BaseOCCT;
62+
public asset: Asset;
63+
public color: Color;
64+
65+
constructor() {
66+
this.context = new Context();
67+
this.jscadWorkerManager = new JSCADWorkerManager();
68+
this.manifoldWorkerManager = new ManifoldWorkerManager();
69+
this.occtWorkerManager = new OCCTWorkerManager();
70+
this.jscad = new JSCAD(this.jscadWorkerManager);
71+
this.manifold = new ManifoldBitByBit(this.manifoldWorkerManager);
72+
73+
const geometryHelper = new GeometryHelper();
74+
this.math = new MathBitByBit();
75+
this.vector = new Vector(this.math, geometryHelper);
76+
const drawHelper = new DrawHelper(this.context, this.jscad.text, this.vector, this.jscadWorkerManager, this.manifoldWorkerManager, this.occtWorkerManager,);
77+
this.babylon = new Babylon(this.context, drawHelper, this.color);
78+
this.tag = new Tag(this.context);
79+
this.draw = new Draw(
80+
drawHelper,
81+
this.babylon.node,
82+
this.tag,
83+
this.context);
84+
85+
this.color = new Color(this.math);
86+
this.line = new Line(this.context, geometryHelper);
87+
this.transforms = new Transforms(this.vector, this.math);
88+
this.point = new Point(geometryHelper, this.transforms);
89+
this.polyline = new Polyline(this.context, geometryHelper);
90+
this.verb = new Verb(this.context, geometryHelper, this.math);
91+
this.time = new Time(this.context);
92+
this.occt = new OCCTW(this.context, this.occtWorkerManager);
93+
this.asset = new Asset();
94+
this.logic = new Logic();
95+
this.json = new JSONBitByBit(this.context);
96+
this.text = new TextBitByBit();
97+
this.lists = new Lists();
98+
}
99+
100+
init(scene: BABYLON.Scene, occt?: Worker, jscad?: Worker, manifold?: Worker, havokPlugin?: BABYLON.HavokPlugin) {
101+
this.context.scene = scene;
102+
if (havokPlugin) {
103+
this.context.havokPlugin = havokPlugin;
104+
}
105+
const verb = { geom: vrb.geom, core: vrb.core };
106+
this.context.verb = verb;
107+
this.context.jsonpath = JSONPath;
108+
if (occt) {
109+
this.occtWorkerManager.setOccWorker(occt);
110+
}
111+
if (jscad) {
112+
this.jscadWorkerManager.setJscadWorker(jscad);
113+
}
114+
if(manifold){
115+
this.manifoldWorkerManager.setManifoldWorker(manifold);
116+
}
117+
}
118+
}

0 commit comments

Comments
 (0)