├── .github └── workflows │ └── basic.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── docs ├── .gitignore ├── API.md ├── README.md ├── blog │ ├── 2021-11-08-the-cloud-of-bitbybit-developers.md │ ├── 2023-02-03-golden-age-for-open-source-cad-and-ai.md │ ├── 2023-02-04-enahncing-the-platform-for-wider-use-and-easy-integration.md │ ├── 2023-02-17-mixed-reality-cad.md │ ├── 2023-02-18-moos-modular-housing.mdx │ ├── 2024-04-04-release-notes-0-15-5.md │ ├── 2024-04-05-release-notes-0-15-6.md │ ├── 2024-04-06-release-notes-0-15-7.md │ ├── 2024-04-12-release-notes-0-15-8.md │ ├── 2024-04-13-testing-3d-geometry-algorithms.md │ ├── 2024-04-23-introducing-bitbybit-runner.md │ ├── 2024-05-12-release-notes-0-15-10.md │ ├── 2024-06-07-gaussian-splatting.md │ ├── 2024-07-29-3d-bits-app-for-shopify.md │ ├── 2024-11-07-threejs-support.md │ ├── 2024-11-08-updated-bitbybit-runners.md │ ├── 2025-01-01-update-3d-bits-app-shopify.md │ ├── 2025-04-08-breaking-language-barriers.md │ ├── authors.yml │ └── tags.yml ├── docusaurus.config.ts ├── learn │ ├── 3d-bits │ │ ├── _category_.json │ │ ├── faq.md │ │ ├── intro.md │ │ ├── theme-app-extensions │ │ │ ├── _category_.json │ │ │ ├── bitbybit-preview.md │ │ │ ├── bitbybit-runner.md │ │ │ └── bitbybit-viewer.md │ │ └── tutorials │ │ │ ├── _category_.json │ │ │ ├── intro.md │ │ │ ├── preview-3d-scans.md │ │ │ ├── product-3d-bike-scan.md │ │ │ ├── product-customizable-text.mdx │ │ │ ├── product-laptop-holder.mdx │ │ │ ├── product-palm-table.mdx │ │ │ ├── runner-product-variants.md │ │ │ ├── set-up.md │ │ │ ├── settings.md │ │ │ ├── viewer-no-code-3d-scan-configurators.md │ │ │ ├── viewer-no-code-gltf-configurators.md │ │ │ └── viewer-with-3d-scan.md │ ├── about.md │ ├── code │ │ ├── _category_.json │ │ ├── common │ │ │ ├── _category_.json │ │ │ ├── base │ │ │ │ ├── _category_.json │ │ │ │ ├── color │ │ │ │ │ ├── _category_.json │ │ │ │ │ ├── color-usage-examples.md │ │ │ │ │ └── intro.md │ │ │ │ ├── dates │ │ │ │ │ ├── _category_.json │ │ │ │ │ └── intro.md │ │ │ │ ├── intro.md │ │ │ │ ├── line │ │ │ │ │ ├── _category_.json │ │ │ │ │ └── intro.md │ │ │ │ ├── lists │ │ │ │ │ ├── _category_.json │ │ │ │ │ └── intro.md │ │ │ │ ├── logic │ │ │ │ │ ├── _category_.json │ │ │ │ │ └── intro.md │ │ │ │ ├── math │ │ │ │ │ ├── _category_.json │ │ │ │ │ └── intro.md │ │ │ │ ├── mesh │ │ │ │ │ ├── _category_.json │ │ │ │ │ └── intro.md │ │ │ │ ├── point │ │ │ │ │ ├── _category_.json │ │ │ │ │ ├── intro.md │ │ │ │ │ ├── point-hex-grid-example.md │ │ │ │ │ └── point-spiral-examples.md │ │ │ │ ├── polyline │ │ │ │ │ ├── _category_.json │ │ │ │ │ └── intro.md │ │ │ │ ├── text │ │ │ │ │ ├── _category_.json │ │ │ │ │ ├── intro.md │ │ │ │ │ └── text-usage-examples.md │ │ │ │ └── vector │ │ │ │ │ ├── _category_.json │ │ │ │ │ ├── intro.md │ │ │ │ │ └── vector-usage-examples.md │ │ │ ├── draw │ │ │ │ ├── _category_.json │ │ │ │ ├── examples.mdx │ │ │ │ └── intro.md │ │ │ └── occt │ │ │ │ ├── _category_.json │ │ │ │ ├── booleans │ │ │ │ ├── _category_.json │ │ │ │ └── operations.mdx │ │ │ │ ├── fillets │ │ │ │ ├── _category_.json │ │ │ │ ├── chamfer-circular-edges.mdx │ │ │ │ ├── chamfers-intro.mdx │ │ │ │ ├── chamfers-var-radius-on-spec-edges.mdx │ │ │ │ ├── fillet-3d-wires.mdx │ │ │ │ ├── fillets-intro.mdx │ │ │ │ ├── fillets-on-2d-wire-corners.mdx │ │ │ │ ├── fillets-on-2d-wires.mdx │ │ │ │ └── fillets-var-radius-on-spec-edges.mdx │ │ │ │ ├── shapes │ │ │ │ ├── _category_.json │ │ │ │ ├── edge │ │ │ │ │ ├── _category_.json │ │ │ │ │ ├── edge-indexes.mdx │ │ │ │ │ └── intro.md │ │ │ │ ├── intro.md │ │ │ │ └── wire │ │ │ │ │ ├── _category_.json │ │ │ │ │ └── intro.md │ │ │ │ └── what-is-occt.md │ │ └── intro.md │ ├── getting-started │ │ ├── _category_.json │ │ ├── basics │ │ │ ├── _category_.json │ │ │ ├── assets │ │ │ │ ├── _category_.json │ │ │ │ ├── cloud │ │ │ │ │ ├── _category_.json │ │ │ │ │ ├── intro.mdx │ │ │ │ │ ├── uploading.md │ │ │ │ │ ├── using-textures.mdx │ │ │ │ │ └── using.mdx │ │ │ │ ├── intro.mdx │ │ │ │ └── local │ │ │ │ │ ├── _category_.json │ │ │ │ │ ├── gltf.mdx │ │ │ │ │ ├── intro.mdx │ │ │ │ │ ├── step.mdx │ │ │ │ │ └── uploading.md │ │ │ ├── drawing.mdx │ │ │ ├── errors.md │ │ │ ├── intro.md │ │ │ ├── projects │ │ │ │ ├── _category_.json │ │ │ │ ├── cover-image.md │ │ │ │ ├── create-project.md │ │ │ │ ├── intro.md │ │ │ │ └── publish.md │ │ │ ├── running-code.md │ │ │ └── scripts │ │ │ │ ├── _category_.json │ │ │ │ ├── auto-save.md │ │ │ │ ├── create-script.md │ │ │ │ ├── embed.md │ │ │ │ ├── find-script.md │ │ │ │ ├── import-file.md │ │ │ │ ├── intro.mdx │ │ │ │ ├── preview.mdx │ │ │ │ ├── save-to-file.md │ │ │ │ └── search-public.md │ │ ├── blockly │ │ │ ├── _category_.json │ │ │ ├── hello-world.mdx │ │ │ ├── intro.md │ │ │ └── parametric-cube.mdx │ │ ├── configurators.mdx │ │ ├── overview.md │ │ ├── rete │ │ │ ├── _category_.json │ │ │ ├── hello-world.mdx │ │ │ ├── intro.md │ │ │ ├── parametric-cube.mdx │ │ │ └── typescript-editor-component.md │ │ └── typescript │ │ │ ├── _category_.json │ │ │ ├── hello-world.mdx │ │ │ ├── intro.md │ │ │ └── parametric-cube.mdx │ ├── github │ │ ├── _category_.json │ │ ├── intro.md │ │ └── unit-tests.md │ ├── intro.md │ ├── npm-packages │ │ ├── _category_.json │ │ ├── babylonjs │ │ │ ├── _category_.json │ │ │ ├── advanced-parametric-3d-model.md │ │ │ ├── hex-house-concept.md │ │ │ ├── intro.md │ │ │ └── start-with-babylon-js.md │ │ ├── game-engine-agnostic.md │ │ ├── intro.md │ │ └── threejs │ │ │ ├── _category_.json │ │ │ ├── advanced-parametric-3d-model.md │ │ │ ├── hex-house-concept.md │ │ │ ├── intro.md │ │ │ └── start-with-three-js.md │ ├── open-source-approach.md │ ├── runners │ │ ├── _category_.json │ │ ├── intro-blockly.mdx │ │ ├── intro-rete.mdx │ │ ├── intro-typescript.mdx │ │ ├── intro.mdx │ │ ├── live-examples │ │ │ ├── _category_.json │ │ │ ├── configurable-cad-part.mdx │ │ │ └── static-3d-model-script.mdx │ │ ├── table-configurator-blockly.mdx │ │ ├── table-configurator-rete.mdx │ │ └── table-configurator-typescript.mdx │ └── tags.yml ├── package-lock.json ├── package.json ├── sidebars.ts ├── src │ ├── components │ │ ├── BitByBitRenderCanvas │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ │ └── HomepageFeatures │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ ├── css │ │ └── custom.css │ ├── pages │ │ ├── index.module.css │ │ ├── index.tsx │ │ └── markdown-page.md │ └── theme │ │ └── Layout │ │ └── index.tsx ├── static │ ├── .nojekyll │ └── img │ │ ├── docusaurus-social-card.jpg │ │ ├── docusaurus.png │ │ ├── favicon.ico │ │ ├── learn-bitbybit-social-card.jpeg │ │ ├── learn-bitbybit-social-card.png │ │ ├── learn-bitbybit-social-card.xcf │ │ ├── logo-gold-small.png │ │ ├── undraw_docusaurus_mountain.svg │ │ ├── undraw_docusaurus_react.svg │ │ └── undraw_docusaurus_tree.svg └── tsconfig.json ├── examples ├── .gitignore ├── LICENSE ├── README.md ├── angular │ └── babylonjs │ │ └── laptop-holder │ │ ├── .gitignore │ │ ├── README.md │ │ ├── angular.json │ │ ├── custom-webpack.config.js │ │ ├── karma.conf.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── jscad.worker.ts │ │ │ ├── laptop.ts │ │ │ └── occ.worker.ts │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ ├── favicon.png │ │ │ └── lapholders1.jpeg │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ └── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ ├── tsconfig.spec.json │ │ └── tsconfig.worker.json ├── nextjs │ └── babylonjs │ │ └── simple │ │ ├── .eslintrc.json │ │ ├── .gitignore │ │ ├── README.md │ │ ├── app │ │ ├── bitbybit.tsx │ │ ├── client-only.tsx │ │ ├── favicon.ico │ │ ├── fonts │ │ │ ├── GeistMonoVF.woff │ │ │ └── GeistVF.woff │ │ ├── globals.css │ │ ├── jscad.worker.ts │ │ ├── layout.tsx │ │ ├── occ.worker.ts │ │ └── page.tsx │ │ ├── next.config.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── postcss.config.mjs │ │ ├── public │ │ ├── file.svg │ │ ├── globe.svg │ │ ├── next.svg │ │ ├── vercel.svg │ │ └── window.svg │ │ ├── tailwind.config.ts │ │ └── tsconfig.json ├── node │ ├── basic │ │ ├── .env │ │ ├── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ └── tsconfig.json │ └── express-app │ │ ├── .env │ │ ├── .gitignore │ │ ├── README.md │ │ ├── bitbybit.ts │ │ ├── index.ts │ │ ├── manifold-3-0-0.wasm │ │ ├── package-lock.json │ │ ├── package.json │ │ └── tsconfig.json ├── nuxt │ └── babylonjs │ │ └── basic │ │ ├── BitByBitComponent.vue │ │ ├── README.md │ │ ├── app.vue │ │ ├── nuxt.config.ts │ │ ├── occ.worker.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pnpm-lock.yaml │ │ ├── public │ │ ├── favicon.ico │ │ └── robots.txt │ │ ├── server │ │ └── tsconfig.json │ │ └── tsconfig.json ├── react │ ├── babylonjs │ │ ├── cup │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── config-overrides.js │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── public │ │ │ │ ├── favicon.ico │ │ │ │ ├── favicon.png │ │ │ │ ├── index.html │ │ │ │ ├── lapholders1.jpeg │ │ │ │ ├── logo192.png │ │ │ │ ├── logo512.png │ │ │ │ ├── manifest.json │ │ │ │ └── robots.txt │ │ │ ├── src │ │ │ │ ├── App.css │ │ │ │ ├── App.test.tsx │ │ │ │ ├── App.tsx │ │ │ │ ├── cup.ts │ │ │ │ ├── index.css │ │ │ │ ├── index.tsx │ │ │ │ ├── jscad.worker.ts │ │ │ │ ├── logo.svg │ │ │ │ ├── occ.worker.ts │ │ │ │ ├── react-app-env.d.ts │ │ │ │ ├── reportWebVitals.ts │ │ │ │ ├── setupTests.ts │ │ │ │ └── use-previous.ts │ │ │ └── tsconfig.json │ │ ├── iframe-link │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── config-overrides.js │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── public │ │ │ │ ├── favicon.png │ │ │ │ ├── iframe-link.png │ │ │ │ ├── index.html │ │ │ │ ├── manifest.json │ │ │ │ └── robots.txt │ │ │ ├── src │ │ │ │ ├── App.css │ │ │ │ ├── App.test.tsx │ │ │ │ ├── App.tsx │ │ │ │ ├── index.css │ │ │ │ ├── index.tsx │ │ │ │ ├── logo.svg │ │ │ │ ├── react-app-env.d.ts │ │ │ │ ├── reportWebVitals.ts │ │ │ │ └── setupTests.ts │ │ │ └── tsconfig.json │ │ └── laptop-holder │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── config-overrides.js │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── favicon.png │ │ │ ├── index.html │ │ │ ├── lapholders1.jpeg │ │ │ ├── logo192.png │ │ │ ├── logo512.png │ │ │ ├── manifest.json │ │ │ └── robots.txt │ │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.test.tsx │ │ │ ├── App.tsx │ │ │ ├── index.css │ │ │ ├── index.tsx │ │ │ ├── jscad.worker.ts │ │ │ ├── laptop.ts │ │ │ ├── logo.svg │ │ │ ├── occ.worker.ts │ │ │ ├── react-app-env.d.ts │ │ │ ├── reportWebVitals.ts │ │ │ ├── setupTests.ts │ │ │ └── use-previous.ts │ │ │ └── tsconfig.json │ └── threejs │ │ └── vase │ │ ├── .gitignore │ │ ├── README.md │ │ ├── config-overrides.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ ├── favicon.ico │ │ ├── favicon.png │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ ├── robots.txt │ │ └── threejs.png │ │ ├── src │ │ ├── App.css │ │ ├── App.test.tsx │ │ ├── App.tsx │ │ ├── index.css │ │ ├── index.tsx │ │ ├── jscad.worker.ts │ │ ├── logo.svg │ │ ├── occ.worker.ts │ │ ├── react-app-env.d.ts │ │ ├── reportWebVitals.ts │ │ └── setupTests.ts │ │ └── tsconfig.json ├── runner │ ├── babylon │ │ ├── README.md │ │ ├── full │ │ │ ├── inline-include │ │ │ │ └── index.html │ │ │ └── physics-javascript │ │ │ │ └── index.html │ │ └── lite │ │ │ ├── external-scene │ │ │ └── index.html │ │ │ ├── physics-javascript │ │ │ └── index.html │ │ │ └── simple │ │ │ └── index.html │ └── threejs │ │ ├── README.md │ │ ├── full │ │ ├── inline-include │ │ │ └── index.html │ │ └── simple │ │ │ └── index.html │ │ └── lite │ │ ├── a-frame │ │ └── index.html │ │ ├── external-scene │ │ └── index.html │ │ ├── simple │ │ └── index.html │ │ └── threejs-logo │ │ └── index.html ├── vite │ ├── babylonjs │ │ ├── hex-house-concept │ │ │ ├── index.html │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── public │ │ │ │ └── vite.svg │ │ │ ├── src │ │ │ │ ├── helpers │ │ │ │ │ ├── create-gui.ts │ │ │ │ │ ├── create-shape.ts │ │ │ │ │ ├── downloads.ts │ │ │ │ │ ├── gui-helper.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── init-babylonjs.ts │ │ │ │ │ └── init-kernels.ts │ │ │ │ ├── main.ts │ │ │ │ ├── models │ │ │ │ │ ├── current.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── kernel-options.ts │ │ │ │ │ └── model.ts │ │ │ │ ├── style.css │ │ │ │ ├── vite-env.d.ts │ │ │ │ └── workers │ │ │ │ │ ├── jscad.worker.ts │ │ │ │ │ ├── manifold.worker.ts │ │ │ │ │ └── occt.worker.ts │ │ │ └── tsconfig.json │ │ ├── hex-shell │ │ │ ├── .gitignore │ │ │ ├── index.html │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── public │ │ │ │ └── vite.svg │ │ │ ├── src │ │ │ │ ├── helpers │ │ │ │ │ ├── create-gui.ts │ │ │ │ │ ├── create-shape.ts │ │ │ │ │ ├── downloads.ts │ │ │ │ │ ├── gui-helper.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── init-babylonjs.ts │ │ │ │ │ └── init-kernels.ts │ │ │ │ ├── main.ts │ │ │ │ ├── models │ │ │ │ │ ├── current.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── kernel-options.ts │ │ │ │ │ └── model.ts │ │ │ │ ├── style.css │ │ │ │ ├── vite-env.d.ts │ │ │ │ └── workers │ │ │ │ │ ├── jscad.worker.ts │ │ │ │ │ ├── manifold.worker.ts │ │ │ │ │ └── occt.worker.ts │ │ │ └── tsconfig.json │ │ └── starter-template │ │ │ ├── index.html │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── public │ │ │ └── vite.svg │ │ │ ├── src │ │ │ ├── main.ts │ │ │ ├── models │ │ │ │ ├── current.ts │ │ │ │ └── model.ts │ │ │ ├── style.css │ │ │ ├── vite-env.d.ts │ │ │ └── workers │ │ │ │ ├── jscad.worker.ts │ │ │ │ ├── manifold.worker.ts │ │ │ │ └── occt.worker.ts │ │ │ └── tsconfig.json │ └── threejs │ │ ├── cup │ │ ├── .gitignore │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ └── vite.svg │ │ ├── src │ │ │ ├── create-cup.ts │ │ │ ├── main.ts │ │ │ ├── models │ │ │ │ ├── current.ts │ │ │ │ └── model.ts │ │ │ ├── style.css │ │ │ ├── vite-env.d.ts │ │ │ └── workers │ │ │ │ ├── jscad.worker.ts │ │ │ │ ├── manifold.worker.ts │ │ │ │ └── occt.worker.ts │ │ └── tsconfig.json │ │ ├── hex-house-concept │ │ ├── .gitignore │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ └── vite.svg │ │ ├── src │ │ │ ├── helpers │ │ │ │ ├── create-gui.ts │ │ │ │ ├── create-shape.ts │ │ │ │ ├── downloads.ts │ │ │ │ ├── gui-helper.ts │ │ │ │ ├── index.ts │ │ │ │ ├── init-kernels.ts │ │ │ │ └── init-threejs.ts │ │ │ ├── main.ts │ │ │ ├── models │ │ │ │ ├── current.ts │ │ │ │ ├── index.ts │ │ │ │ ├── kernel-options.ts │ │ │ │ └── model.ts │ │ │ ├── style.css │ │ │ ├── vite-env.d.ts │ │ │ └── workers │ │ │ │ ├── jscad.worker.ts │ │ │ │ ├── manifold.worker.ts │ │ │ │ └── occt.worker.ts │ │ └── tsconfig.json │ │ ├── hex-shell │ │ ├── .gitignore │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ └── vite.svg │ │ ├── src │ │ │ ├── helpers │ │ │ │ ├── create-gui.ts │ │ │ │ ├── create-shape.ts │ │ │ │ ├── downloads.ts │ │ │ │ ├── gui-helper.ts │ │ │ │ ├── index.ts │ │ │ │ ├── init-kernels.ts │ │ │ │ └── init-threejs.ts │ │ │ ├── main.ts │ │ │ ├── models │ │ │ │ ├── current.ts │ │ │ │ ├── index.ts │ │ │ │ ├── kernel-options.ts │ │ │ │ └── model.ts │ │ │ ├── style.css │ │ │ ├── vite-env.d.ts │ │ │ └── workers │ │ │ │ ├── jscad.worker.ts │ │ │ │ ├── manifold.worker.ts │ │ │ │ └── occt.worker.ts │ │ └── tsconfig.json │ │ └── starter-template │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ └── vite.svg │ │ ├── src │ │ ├── main.ts │ │ ├── models │ │ │ ├── current.ts │ │ │ └── model.ts │ │ ├── style.css │ │ ├── vite-env.d.ts │ │ └── workers │ │ │ ├── jscad.worker.ts │ │ │ ├── manifold.worker.ts │ │ │ └── occt.worker.ts │ │ └── tsconfig.json └── webpack │ └── threejs │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── code │ │ ├── cup-three.ts │ │ ├── homepage.ts │ │ ├── manifold-sliced-mesh.ts │ │ └── patterns.ts │ ├── html │ │ ├── cup-three │ │ │ └── index.html │ │ ├── homepage │ │ │ └── index.html │ │ ├── index.html │ │ ├── manifold-sliced-mesh │ │ │ └── index.html │ │ └── patterns │ │ │ └── index.html │ ├── index.ts │ ├── jscad.worker.ts │ ├── manifold.worker.ts │ └── occ.worker.ts │ ├── tsconfig.json │ └── webpack.config.js ├── languages ├── ar.json ├── bn.json ├── de.json ├── en.json ├── es.json ├── fr.json ├── hi.json ├── id.json ├── lt.json ├── pt.json ├── ru.json ├── uk.json └── zh-hans.json ├── package-lock.json ├── package.json └── packages └── dev ├── babylonjs ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.cjs ├── index.ts ├── lib │ ├── api │ │ ├── bitbybit-base.ts │ │ ├── bitbybit │ │ │ ├── babylon │ │ │ │ ├── babylon.ts │ │ │ │ ├── camera │ │ │ │ │ ├── arc-rotate-camera.ts │ │ │ │ │ ├── camera.ts │ │ │ │ │ ├── free-camera.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── target-camera.ts │ │ │ │ ├── engine.ts │ │ │ │ ├── gaussian-splatting.ts │ │ │ │ ├── gizmo │ │ │ │ │ ├── axis-drag-gizmo.ts │ │ │ │ │ ├── axis-scale-gizmo.ts │ │ │ │ │ ├── bounding-box-gizmo.ts │ │ │ │ │ ├── gizmo-base.ts │ │ │ │ │ ├── gizmo.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── manager.ts │ │ │ │ │ ├── plane-drag-gizmo.ts │ │ │ │ │ ├── plane-rotation-gizmo.ts │ │ │ │ │ ├── position-gizmo.ts │ │ │ │ │ ├── rotation-gizmo.ts │ │ │ │ │ └── scale-gizmo.ts │ │ │ │ ├── gui │ │ │ │ │ ├── advanced-dynamic-texture.ts │ │ │ │ │ ├── button.ts │ │ │ │ │ ├── checkbox.ts │ │ │ │ │ ├── color-picker.ts │ │ │ │ │ ├── container.ts │ │ │ │ │ ├── control.ts │ │ │ │ │ ├── gui.ts │ │ │ │ │ ├── image.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── input-text.ts │ │ │ │ │ ├── radio-button.ts │ │ │ │ │ ├── slider.ts │ │ │ │ │ ├── stack-panel.ts │ │ │ │ │ └── text-block.ts │ │ │ │ ├── index.ts │ │ │ │ ├── io.ts │ │ │ │ ├── lights │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── lights.ts │ │ │ │ │ └── shadow-light.ts │ │ │ │ ├── material │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── material.ts │ │ │ │ │ ├── pbr-metallic-roughness.ts │ │ │ │ │ └── sky-material.ts │ │ │ │ ├── mesh-builder │ │ │ │ │ └── mesh-builder.ts │ │ │ │ ├── mesh.ts │ │ │ │ ├── node.ts │ │ │ │ ├── pick.ts │ │ │ │ ├── ray.ts │ │ │ │ ├── scene.ts │ │ │ │ ├── texture │ │ │ │ │ └── texture.ts │ │ │ │ ├── tools.ts │ │ │ │ ├── transforms.ts │ │ │ │ └── web-xr │ │ │ │ │ ├── base.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── simple.ts │ │ │ │ │ └── web-xr.ts │ │ │ ├── draw.ts │ │ │ └── index.ts │ │ ├── context.ts │ │ ├── draw-helper.ts │ │ ├── index.ts │ │ ├── inputs │ │ │ ├── babylon-camera-inputs.ts │ │ │ ├── babylon-gaussian-splatting-inputs.ts │ │ │ ├── babylon-gizmo-inputs.ts │ │ │ ├── babylon-gui-inputs.ts │ │ │ ├── babylon-io-inputs.ts │ │ │ ├── babylon-light-inputs.ts │ │ │ ├── babylon-material-inputs.ts │ │ │ ├── babylon-mesh-builder.ts │ │ │ ├── babylon-mesh-inputs.ts │ │ │ ├── babylon-pick-inputs.ts │ │ │ ├── babylon-ray-inputs.ts │ │ │ ├── babylon-texture-inputs.ts │ │ │ ├── babylon-tools-inputs.ts │ │ │ ├── babylon-transform-inputs.ts │ │ │ ├── babylon-webxr.ts │ │ │ ├── base-inputs.ts │ │ │ ├── draw-inputs.ts │ │ │ ├── index.ts │ │ │ ├── inputs.ts │ │ │ ├── node-inputs.ts │ │ │ └── scene-inputs.ts │ │ └── models │ │ │ └── index.ts │ ├── gui-enriched-babylon.ts │ ├── index.ts │ └── models │ │ ├── index.ts │ │ ├── print-save.model.ts │ │ └── tag.interface.ts ├── package-lock.json ├── package.json ├── tsconfig.bitbybit.json └── tsconfig.json ├── base ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.cjs ├── index.ts ├── lib │ ├── api │ │ ├── index.ts │ │ ├── inputs │ │ │ ├── base-inputs.ts │ │ │ ├── color-inputs.ts │ │ │ ├── dates-inputs.ts │ │ │ ├── index.ts │ │ │ ├── inputs.ts │ │ │ ├── line-inputs.ts │ │ │ ├── lists-inputs.ts │ │ │ ├── logic-inputs.ts │ │ │ ├── math-inputs.ts │ │ │ ├── mesh-inputs.ts │ │ │ ├── point-inputs.ts │ │ │ ├── polyline-inputs.ts │ │ │ ├── text-inputs.ts │ │ │ ├── transforms-inputs.ts │ │ │ └── vector-inputs.ts │ │ ├── models │ │ │ ├── Hershey-font-license.lic │ │ │ ├── index.ts │ │ │ ├── point │ │ │ │ ├── bucket.ts │ │ │ │ ├── hex-grid-data.ts │ │ │ │ └── index.ts │ │ │ ├── simplex.ts │ │ │ └── text │ │ │ │ ├── bucket.ts │ │ │ │ ├── index.ts │ │ │ │ ├── vector-char-data.ts │ │ │ │ └── vector-text-data.ts │ │ ├── services │ │ │ ├── color.test.ts │ │ │ ├── color.ts │ │ │ ├── dates.test.ts │ │ │ ├── dates.ts │ │ │ ├── geometry-helper.ts │ │ │ ├── index.ts │ │ │ ├── line.test.ts │ │ │ ├── line.ts │ │ │ ├── lists.test.ts │ │ │ ├── lists.ts │ │ │ ├── logic.test.ts │ │ │ ├── logic.ts │ │ │ ├── math.test.ts │ │ │ ├── math.ts │ │ │ ├── mesh.test.ts │ │ │ ├── mesh.ts │ │ │ ├── point.test.ts │ │ │ ├── point.ts │ │ │ ├── polyline.test.ts │ │ │ ├── polyline.ts │ │ │ ├── text.test.ts │ │ │ ├── text.ts │ │ │ ├── transforms.test.ts │ │ │ ├── transforms.ts │ │ │ ├── vector.test.ts │ │ │ └── vector.ts │ │ └── unit-test-helper.ts │ └── index.ts ├── package-lock.json ├── package.json ├── tsconfig.bitbybit.json └── tsconfig.json ├── core ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.cjs ├── index.ts ├── lib │ ├── api │ │ ├── bitbybit │ │ │ ├── asset.test.ts │ │ │ ├── asset.ts │ │ │ ├── base-types.ts │ │ │ ├── index.ts │ │ │ ├── json.test.ts │ │ │ ├── json.ts │ │ │ ├── occt │ │ │ │ ├── index.ts │ │ │ │ ├── io.ts │ │ │ │ └── occt.ts │ │ │ ├── tag.ts │ │ │ ├── time.ts │ │ │ └── verb │ │ │ │ ├── curve-circle.ts │ │ │ │ ├── curve-ellipse.ts │ │ │ │ ├── curve.ts │ │ │ │ ├── index.ts │ │ │ │ ├── intersect.ts │ │ │ │ ├── surface-conical.ts │ │ │ │ ├── surface-cylindrical.ts │ │ │ │ ├── surface-extrusion.ts │ │ │ │ ├── surface-revolved.ts │ │ │ │ ├── surface-spherical.ts │ │ │ │ ├── surface-sweep.ts │ │ │ │ ├── surface.ts │ │ │ │ └── verb.ts │ │ ├── context.ts │ │ ├── draw-core.ts │ │ ├── draw-helper-core.ts │ │ ├── index.ts │ │ ├── inputs │ │ │ ├── asset-inputs.ts │ │ │ ├── base-inputs.ts │ │ │ ├── index.ts │ │ │ ├── inputs.ts │ │ │ ├── json-inputs.ts │ │ │ ├── tag-inputs.ts │ │ │ ├── time-inputs.ts │ │ │ └── verb-inputs.ts │ │ └── models │ │ │ └── index.ts │ ├── asset-manager.ts │ ├── index.ts │ └── models │ │ ├── index.ts │ │ ├── print-save.model.ts │ │ └── tag.interface.ts ├── mvdocpictures.js ├── package-lock.json ├── package.json ├── tsconfig.bitbybit.json └── tsconfig.json ├── jscad-worker ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.cjs ├── index.ts ├── lib │ ├── api │ │ ├── bitbybit-jscad.ts │ │ ├── booleans.ts │ │ ├── colors.ts │ │ ├── expansions.ts │ │ ├── extrusions.ts │ │ ├── hulls.ts │ │ ├── index.ts │ │ ├── jscad.ts │ │ ├── path.ts │ │ ├── polygon.ts │ │ ├── shapes.ts │ │ └── text.ts │ ├── index.ts │ └── jscad-worker │ │ ├── cache-helper.ts │ │ ├── index.ts │ │ ├── jscad-info.ts │ │ ├── jscad-state.enum.ts │ │ ├── jscad-types.ts │ │ ├── jscad-worker-manager.ts │ │ ├── jscad-worker-mock.ts │ │ └── jscad-worker.ts ├── package-lock.json ├── package.json ├── tsconfig.bitbybit.json └── tsconfig.json ├── jscad ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.cjs ├── index.ts ├── jscad-generated.js ├── lib │ ├── api │ │ ├── inputs │ │ │ ├── base-inputs.ts │ │ │ ├── index.ts │ │ │ ├── inputs.ts │ │ │ └── jscad-inputs.ts │ │ ├── jscad-service.test.ts │ │ ├── jscad-service.ts │ │ └── services │ │ │ ├── index.ts │ │ │ ├── jscad-booleans.ts │ │ │ ├── jscad-colors.ts │ │ │ ├── jscad-expansions.ts │ │ │ ├── jscad-extrusions.ts │ │ │ ├── jscad-hulls.ts │ │ │ ├── jscad-path.ts │ │ │ ├── jscad-polygon.ts │ │ │ ├── jscad-shapes.ts │ │ │ └── jscad-text.ts │ └── index.ts ├── package-lock.json ├── package.json ├── tsconfig.bitbybit.json └── tsconfig.json ├── manifold-worker ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.cjs ├── index.ts ├── lib │ ├── api │ │ ├── bitbybit-manifold.ts │ │ ├── cross-section │ │ │ ├── booleans.ts │ │ │ ├── cross-section.ts │ │ │ ├── evaluate.ts │ │ │ ├── operations.ts │ │ │ ├── shapes.ts │ │ │ └── transforms.ts │ │ ├── index.ts │ │ ├── manifold-bitbybit.ts │ │ ├── manifold │ │ │ ├── booleans.ts │ │ │ ├── evaluate.ts │ │ │ ├── index.ts │ │ │ ├── manifold.ts │ │ │ ├── operations.ts │ │ │ ├── shapes.ts │ │ │ └── transforms.ts │ │ └── mesh │ │ │ ├── evaluate.ts │ │ │ ├── mesh.ts │ │ │ └── operations.ts │ ├── index.ts │ └── manifold-worker │ │ ├── cache-helper.ts │ │ ├── index.ts │ │ ├── manifold-info.ts │ │ ├── manifold-state.enum.ts │ │ ├── manifold-worker-manager.ts │ │ ├── manifold-worker-mock.ts │ │ └── manifold-worker.ts ├── package-lock.json ├── package.json ├── tsconfig.bitbybit.json └── tsconfig.json ├── manifold ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.cjs ├── index.ts ├── lib │ ├── api │ │ ├── inputs │ │ │ ├── base-inputs.ts │ │ │ ├── index.ts │ │ │ ├── inputs.ts │ │ │ └── manifold-inputs.ts │ │ ├── manifold-service.test.ts │ │ ├── manifold-service.ts │ │ └── services │ │ │ ├── cross-section │ │ │ ├── cross-section-booleans.ts │ │ │ ├── cross-section-evaluate.ts │ │ │ ├── cross-section-operations.ts │ │ │ ├── cross-section-shapes.ts │ │ │ ├── cross-section-transforms.ts │ │ │ └── cross-section.ts │ │ │ ├── index.ts │ │ │ ├── manifold │ │ │ ├── manifold-booleans.ts │ │ │ ├── manifold-evaluate.ts │ │ │ ├── manifold-operations.ts │ │ │ ├── manifold-shapes.ts │ │ │ ├── manifold-transforms.ts │ │ │ └── manifold.ts │ │ │ └── mesh │ │ │ ├── mesh-evaluate.ts │ │ │ ├── mesh-operations.ts │ │ │ └── mesh.ts │ └── index.ts ├── package-lock.json ├── package.json ├── tsconfig.bitbybit.json └── tsconfig.json ├── occt-worker ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.cjs ├── index.ts ├── lib │ ├── api │ │ ├── bitbybit-occt.ts │ │ ├── index.ts │ │ └── occt │ │ │ ├── booleans.ts │ │ │ ├── dimensions.ts │ │ │ ├── fillets.ts │ │ │ ├── geom │ │ │ ├── curves.ts │ │ │ ├── geom.ts │ │ │ ├── index.ts │ │ │ └── surfaces.ts │ │ │ ├── index.ts │ │ │ ├── io.ts │ │ │ ├── occt.ts │ │ │ ├── operations.ts │ │ │ ├── shape-fix.ts │ │ │ ├── shapes │ │ │ ├── compound.ts │ │ │ ├── edge.ts │ │ │ ├── face.ts │ │ │ ├── index.ts │ │ │ ├── shape.ts │ │ │ ├── shapes.ts │ │ │ ├── shell.ts │ │ │ ├── solid.ts │ │ │ ├── vertex.ts │ │ │ └── wire.ts │ │ │ └── transforms.ts │ ├── index.ts │ ├── occ-worker │ │ ├── cache-helper.ts │ │ ├── index.ts │ │ ├── occ-info.ts │ │ ├── occ-state.enum.ts │ │ ├── occ-worker-manager.ts │ │ ├── occ-worker-mock.ts │ │ ├── occ-worker.test.ts │ │ └── occ-worker.ts │ └── shape-parser.ts ├── package-lock.json ├── package.json ├── tsconfig.bitbybit.json └── tsconfig.json ├── occt ├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.cjs ├── bitbybit-dev-occt │ ├── bitbybit-dev-occt.d.ts │ ├── bitbybit-dev-occt.js │ ├── bitbybit-dev-occt.wasm │ ├── bitbybit-dev-occt.yml │ ├── cdn.js │ ├── index.js │ ├── node.js │ └── nuxt.js ├── generate-prod-build-yaml-multithreaded.js ├── generate-prod-build-yaml.js ├── index.ts ├── lib │ ├── api │ │ ├── index.ts │ │ ├── inputs │ │ │ ├── index.ts │ │ │ ├── inputs.ts │ │ │ └── occ-inputs.ts │ │ ├── models │ │ │ ├── bucket.ts │ │ │ ├── index.ts │ │ │ ├── occ-models.ts │ │ │ ├── text-wires-char-shape-part.ts │ │ │ └── text-wires-data.ts │ │ ├── shapes-helper.service.ts │ │ ├── shapes-helper.test.ts │ │ ├── vector-helper.service.ts │ │ └── vector-helper.test.ts │ ├── base.ts │ ├── index.ts │ ├── occ-helper.ts │ ├── occ-referenced-returns.ts │ ├── occ-service.test.ts │ ├── occ-service.ts │ ├── services │ │ ├── assembly.ts │ │ ├── base │ │ │ ├── booleans.service.ts │ │ │ ├── converter.service.ts │ │ │ ├── dimensions.service.ts │ │ │ ├── edges.service.ts │ │ │ ├── entities.service.ts │ │ │ ├── enum.service.test.ts │ │ │ ├── enum.service.ts │ │ │ ├── faces.service.ts │ │ │ ├── fillets.service.ts │ │ │ ├── geom.service.ts │ │ │ ├── iterator.service.ts │ │ │ ├── meshing.service.ts │ │ │ ├── operations.service.ts │ │ │ ├── shape-getters.ts │ │ │ ├── shells.service.ts │ │ │ ├── solids.service.ts │ │ │ ├── transforms.service.ts │ │ │ ├── vertices.service.ts │ │ │ └── wires.service.ts │ │ ├── booleans.test.ts │ │ ├── booleans.ts │ │ ├── dimensions.ts │ │ ├── fillets.test.ts │ │ ├── fillets.ts │ │ ├── geom │ │ │ ├── curves.test.ts │ │ │ ├── curves.ts │ │ │ ├── geom.ts │ │ │ ├── index.ts │ │ │ └── surfaces.ts │ │ ├── index.ts │ │ ├── io.test.ts │ │ ├── io.ts │ │ ├── operations.test.ts │ │ ├── operations.ts │ │ ├── shape-fix.test.ts │ │ ├── shape-fix.ts │ │ ├── shapes │ │ │ ├── compound.test.ts │ │ │ ├── compound.ts │ │ │ ├── edge.test.ts │ │ │ ├── edge.ts │ │ │ ├── face.test.ts │ │ │ ├── face.ts │ │ │ ├── index.ts │ │ │ ├── shape.test.ts │ │ │ ├── shape.ts │ │ │ ├── shapes.test.ts │ │ │ ├── shapes.ts │ │ │ ├── shell.test.ts │ │ │ ├── shell.ts │ │ │ ├── solid.test.ts │ │ │ ├── solid.ts │ │ │ ├── vertex.test.ts │ │ │ ├── vertex.ts │ │ │ ├── wire.test.ts │ │ │ └── wire.ts │ │ ├── transforms.test.ts │ │ └── transforms.ts │ └── shape-parser.ts ├── package-lock.json ├── package.json ├── tsconfig.bitbybit.json ├── tsconfig.json └── tsconfig.nodenext.json └── threejs ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.cjs ├── index.ts ├── lib ├── api │ ├── bitbybit-base.ts │ ├── bitbybit │ │ ├── draw.test.ts │ │ ├── draw.ts │ │ ├── index.ts │ │ └── threejs.ts │ ├── context.ts │ ├── draw-helper.test.ts │ ├── draw-helper.ts │ ├── index.ts │ ├── inputs │ │ ├── base-inputs.ts │ │ ├── draw-inputs.ts │ │ ├── index.ts │ │ └── inputs.ts │ └── models │ │ └── index.ts └── index.ts ├── package-lock.json ├── package.json ├── tsconfig.bitbybit.json └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /docs/blog/authors.yml: -------------------------------------------------------------------------------- 1 | ubarevicius: 2 | name: Matas Ubarevičius 3 | title: Founder 4 | url: https://www.linkedin.com/in/matas-ubarevicius/ 5 | image_url: https://media.licdn.com/dms/image/v2/C4E03AQHk-J4Sg5zXcw/profile-displayphoto-shrink_400_400/profile-displayphoto-shrink_400_400/0/1606831113149?e=1753315200&v=beta&t=JqFMDsxNLpq0Jkgj9jtnfEsqH2swc3vYOqxYPVbqsm0 6 | page: 7 | # customize the url of the author page at /blog/authors/ 8 | permalink: '/all-matas-ubarevicius-articles' 9 | socials: 10 | x: matas_dev 11 | linkedin: matas-ubarevicius 12 | -------------------------------------------------------------------------------- /docs/blog/tags.yml: -------------------------------------------------------------------------------- 1 | bitbybit: 2 | label: Bitbybit 3 | permalink: /bitbybit 4 | description: Blogs about Bitbybit 5 | 6 | cloud: 7 | label: Cloud 8 | permalink: /cloud 9 | description: Blogs about Cloud 10 | 11 | ai: 12 | label: AI 13 | permalink: /ai 14 | description: Blogs about Artificial Intelligence 15 | 16 | cad: 17 | label: CAD 18 | permalink: /cad 19 | description: Blogs about Computer-Aided Design 20 | 21 | xr: 22 | label: XR 23 | permalink: /xr 24 | description: Blogs about Extended Reality 25 | 26 | vr: 27 | label: VR 28 | permalink: /vr 29 | description: Blogs about Virtual Reality -------------------------------------------------------------------------------- /docs/learn/3d-bits/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "3D Bits Shopify App", 3 | "position": 8, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "3D Bits Shopify App", 7 | "description": "Learn how to use the 3D Bits Shopify App to create and manage 3D products for your store.", 8 | "slug": "/3d-bits" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/3d-bits/theme-app-extensions/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Theme App Extensions", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Theme App Extensions of 3D Bits Shopify App", 7 | "description": "Learn how to use theme app extensions called PREVIEW, VIEWER & RUNNER in the 3D Bits Shopify App to enhance your store's 3D product experience.", 8 | "slug": "/3d-bits/theme-app-extensions" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/3d-bits/tutorials/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Tutorials", 3 | "position": 4, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Tutorials for 3D Bits Shopify App", 7 | "description": "Here you will find various tutorials on how to install & set up the app with 3D Bits metafields. Also we explain in practical YouTube video tutorials how to use the 3D Bits Shopify App to create and manage 3D products for your store. You can watch these tutorials free of charge even if you did not purchase our app.", 8 | "slug": "/3d-bits/tutorials" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Code", 3 | "position": 4, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Learn to Code in Bitbybit", 7 | "description": "Learn how to code in Bitbybit through live examples, code snippets, and more. These tutorials cover a range of Bitbybit algorithms. We typically demonstrate each algorithm using all three editors—Rete, Blockly, and TypeScript—to show that the same results can be achieved regardless of the editor used. This highlights the power of Bitbybit’s encapsulated, highly portable core layer, which is consistently used across the entire platform.", 8 | "slug": "/code" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Common", 3 | "position": 2, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Common Code Tutorials", 7 | "description": "Learn how to use common code libraries and tools in Bitbybit, including our base algorithms, OCCT, Monaco, JSCAD geometry kernels and more.", 8 | "slug": "/code/common" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Base", 3 | "position": 1, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Base Algorithms in Bitbybit", 7 | "description": "Base algorithms in Bitbybit provide foundational algorithms & object types, such as vectors, matrixes, points, lines, polylines, triangles and meshes. Learn how to use these algorithms to create complex shapes, grids and designs.", 8 | "slug": "/code/common/base" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/color/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Color", 3 | "link": { 4 | "type": "generated-index", 5 | "title": "Colors in Bitbybit", 6 | "description": "Introduction to colors in Bitbybit.", 7 | "slug": "/code/common/base/color" 8 | } 9 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/dates/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Dates", 3 | "link": { 4 | "type": "generated-index", 5 | "title": "Dates in Bitbybit", 6 | "description": "Introduction to dates in Bitbybit.", 7 | "slug": "/code/common/base/dates" 8 | } 9 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/line/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Line", 3 | "position": 2, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Lines in Bitbybit", 7 | "description": "Introduction to lines in Bitbybit.", 8 | "slug": "/code/common/base/line" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/lists/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Lists", 3 | "link": { 4 | "type": "generated-index", 5 | "title": "Lists in Bitbybit", 6 | "description": "Introduction to lists in Bitbybit.", 7 | "slug": "/code/common/base/lists" 8 | } 9 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/logic/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Logic", 3 | "position": 2, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Logic in Bitbybit", 7 | "description": "Introduction to logic in Bitbybit.", 8 | "slug": "/code/common/base/logic" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/math/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Math", 3 | "link": { 4 | "type": "generated-index", 5 | "title": "Math Algorithms in Bitbybit", 6 | "description": "Introduction to math algorithms in Bitbybit.", 7 | "slug": "/code/common/base/math" 8 | } 9 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/mesh/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Mesh", 3 | "link": { 4 | "type": "generated-index", 5 | "title": "Meshes in Bitbybit", 6 | "description": "Introduction to meshes in Bitbybit.", 7 | "slug": "/code/common/base/mesh" 8 | } 9 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/point/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Point", 3 | "link": { 4 | "type": "generated-index", 5 | "title": "Point Algorithms in Bitbybit", 6 | "description": "Introduction to point algorithms in Bitbybit, including point creation, manipulation and analysis. Learn how to use these algorithms to work with points in 2D and 3D space.", 7 | "slug": "/code/common/base/point" 8 | } 9 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/polyline/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Polyline", 3 | "link": { 4 | "type": "generated-index", 5 | "title": "Polylines in Bitbybit", 6 | "description": "Introduction to polylines in Bitbybit.", 7 | "slug": "/code/common/base/polyline" 8 | } 9 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/text/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Text", 3 | "position": 1, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Text Algorithms in Bitbybit", 7 | "description": "Introduction to text algorithms in Bitbybit.", 8 | "slug": "/code/common/base/text" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/base/vector/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Vector", 3 | "link": { 4 | "type": "generated-index", 5 | "title": "Vector Algorithms in Bitbybit", 6 | "description": "Introduction to vector algorithms in Bitbybit, including vector addition, subtraction and other operations. Learn how to use these algorithms to manipulate and analyze vector data.", 7 | "slug": "/code/common/base/vector" 8 | } 9 | } -------------------------------------------------------------------------------- /docs/learn/code/common/draw/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Draw", 3 | "position": 1, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Drawing in Bitbybit", 7 | "description": "Learn how to use the drawing capabilities in Bitbybit, including creating and manipulating shapes, lines, and other graphical elements.", 8 | "slug": "/code/common/draw" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/occt/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Occt", 3 | "position": 1, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Bitbybit OCCT Library", 7 | "description": "Learn how to use our library, built on the OCCT (Open CASCADE Technology) kernel, for advanced geometric modeling. Our algorithms leverage this powerful foundation to enable the creation and manipulation of a wide range of BRep shapes, including edges, wires, faces, shells, solids, and more.", 8 | "slug": "/code/common/occt" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/occt/booleans/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Booleans", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "OCCT Boolean Operations", 7 | "description": "Boolean operations are essential for creating complex 3D models. These tutorials will guide you through performing boolean operations, such as Union, Difference & Intersection using the OCCT library.", 8 | "slug": "/code/common/occt/booleans" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/occt/fillets/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Fillets", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "OCCT Fillets & Chamfers", 7 | "description": "In CAD, it’s common to round the corners of shapes—whether in 2D or 3D. Learn how to create fillets and chamfers using the OCCT library in Bitbybit.", 8 | "slug": "/code/common/occt/fillets" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/occt/shapes/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Shapes", 3 | "position": 2, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Bitbybit OCCT Library Shapes", 7 | "description": "Learn how to use various shape types via Bitbybit's OCCT category of algorithms.", 8 | "slug": "/code/common/occt/shapes" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/occt/shapes/edge/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Edge", 3 | "position": 2, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Edges", 7 | "description": "Edges are one of the most fundamental pieces of geometry that you can create inside OCCT kernel. These tutorials will help you understand how to create and manipulate edges in your 3D models.", 8 | "slug": "/code/common/occt/shapes/edge" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/code/common/occt/shapes/wire/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Wire", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Wires", 7 | "description": "Wires are one of the most fundamental pieces of geometry that you can create inside OCCT kernel. These tutorials will help you understand how to create and manipulate wires in your 3D models.", 8 | "slug": "/code/common/occt/shapes/wire" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/getting-started/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Getting Started", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Getting started with Bitbybit", 7 | "description": "Learn how to get started with Bitbybit - use Rete, Blockly & Monaco editors, cloud features & other relevant topics.", 8 | "slug": "/getting-started" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/getting-started/basics/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Basics", 3 | "position": 6, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Basic Introduction Tutorials to Bitbybit", 7 | "description": "We have developed a series of tutorials to help you learn the fundamentals of our platform. These tutorials cover how to run your scripts, handle errors, and understand how drawing works—one of the core concepts of Bitbybit. You’ll also learn how to create projects and scripts, upload assets, and much more.", 8 | "slug": "/getting-started/basics" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/getting-started/basics/assets/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Assets", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Managing Local & Cloud Assets", 7 | "description": "Learn how to manage local and cloud assets in Bitbybit, including uploading, downloading, and organizing your files.", 8 | "slug": "/getting-started/basics/assets" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/getting-started/basics/assets/cloud/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Cloud", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Managing Cloud Assets", 7 | "description": "Learn how to manage cloud assets in Bitbybit, including uploading, downloading, and organizing your files.", 8 | "slug": "/getting-started/basics/assets/cloud" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/getting-started/basics/assets/local/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Local", 3 | "position": 2, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Managing Local Assets", 7 | "description": "Learn how to manage local assets in Bitbybit, including uploading, downloading, and organizing your files.", 8 | "slug": "/getting-started/basics/assets/local" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/getting-started/basics/intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | title: Intro 4 | sidebar_label: Intro 5 | description: Learn what you will find in the General category 6 | tags: [getting-started, typescript, blockly, rete] 7 | --- 8 | 9 | # Mastering Bitbybit Basics 10 | 11 | This category provides key information to help you effectively use the [bitbybit.dev](https://bitbybit.dev) platform. Discover how to: 12 | 13 | * Navigate and use our code editors and cloud services. 14 | * Run code, manage projects, and handle scripts. 15 | * Incorporate cloud and local assets into your work. 16 | * Understand error reporting. 17 | * Publish and share your projects with the community. -------------------------------------------------------------------------------- /docs/learn/getting-started/basics/projects/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Projects", 3 | "position": 1, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Managing Cloud Projects", 7 | "description": "Learn how to create, manage & share cloud projects in Bitbybit, including project structure and best practices.", 8 | "slug": "/getting-started/basics/projects" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/getting-started/basics/scripts/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Scripts", 3 | "position": 1, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Managing Scripts Within Bitbybit Cloud Projects", 7 | "description": "Learn how to create, manage, and run scripts in Bitbybit cloud projects, including script organization and best practices.", 8 | "slug": "/getting-started/basics/scripts" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/getting-started/blockly/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Blockly", 3 | "position": 5, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Getting Started With Bitbybit Blockly Editor", 7 | "description": "Learn how to use the Bitbybit Blockly Editor to create and run scripts. This guide will help you understand the basics of Blockly, how to compose blocks in order to create 3D objects & how to manage your scripts effectively.", 8 | "slug": "/getting-started/blockly" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/getting-started/rete/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Rete", 3 | "position": 4, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Getting Started With Bitbybit Rete Editor", 7 | "description": "Learn how to use the Bitbybit Rete Editor to create & wire scripts. This guide will help you understand the basics of Rete - how to connect components in order to create 3D objects & how to manage your scripts effectively.", 8 | "slug": "/getting-started/rete" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/getting-started/typescript/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "TypeScript", 3 | "position": 5, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Getting Started With Bitbybit Monaco Editor For TypeScript", 7 | "description": "Learn how to use the Bitbybit Monaco Editor to write TypeScript programs. This guide will help you understand the basics of Monaco - how to write code & create parametric 3D models.", 8 | "slug": "/getting-started/typescript" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/github/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "GitHub Souce Code", 3 | "position": 7, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Bitbybit GitHub Monorepo", 7 | "description": "Explore the Bitbybit GitHub monorepo, which contains the source code for Bitbybit core libraries, documentation, example applications, and more.", 8 | "slug": "/github" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/npm-packages/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "NPM Packages", 3 | "position": 6, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Bitbybit NPM Packages", 7 | "description": "This category is essential for developers looking to integrate Bitbybit's NPM packages into their projects. It provides comprehensive guides on how to install, configure, and utilize these packages effectively. We use various live demo's to guide you through the process and showcase the capabilities of the platform.", 8 | "slug": "/npm-packages" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/npm-packages/babylonjs/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "BabylonJS", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Integrate Bitbybit with BabylonJS", 7 | "description": "Learn how to integrate Bitbybit with BabylonJS to create interactive 3D experiences, CAD apps, 3D configurators or other procedural web applications.", 8 | "slug": "/npm-packages/babylonjs" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/npm-packages/threejs/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "ThreeJS", 3 | "position": 4, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Integrate Bitbybit with ThreeJS", 7 | "description": "Learn how to integrate Bitbybit with ThreeJS to create interactive 3D experiences, CAD apps, 3D configurators or other procedural web applications.", 8 | "slug": "/npm-packages/threejs" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/runners/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Runners", 3 | "position": 5, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Bitbybit Runners", 7 | "description": "Execute 3D Scripts From Visual Programming Editors Anywhere on the Web. Use runners for straightforward Bitbybit integration inside third-party contexts.", 8 | "slug": "/runners" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/learn/runners/live-examples/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Live Examples", 3 | "position": 2, 4 | "link": { 5 | "type": "generated-index", 6 | "title": "Experience Live Runner Examples", 7 | "description": "To help you understand how Runners work, we’ve created several practical examples in this section. We typically present the code within the Bitbybit editors, followed by how it appears and runs in a third-party environment—StackBlitz—where Bitbybit Runners are used.", 8 | "slug": "/runners/live-examples" 9 | } 10 | } -------------------------------------------------------------------------------- /docs/src/components/BitByBitRenderCanvas/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | 13 | .iframe { 14 | width: 100%; 15 | height: 800px; 16 | border: none; 17 | } -------------------------------------------------------------------------------- /docs/src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS files with the .module.css suffix will be treated as CSS modules 3 | * and scoped locally. 4 | */ 5 | 6 | .heroBanner { 7 | padding: 4rem 0; 8 | text-align: center; 9 | position: relative; 10 | overflow: hidden; 11 | } 12 | 13 | @media screen and (max-width: 996px) { 14 | .heroBanner { 15 | padding: 2rem; 16 | } 17 | } 18 | 19 | .buttons { 20 | display: flex; 21 | align-items: center; 22 | justify-content: center; 23 | } 24 | -------------------------------------------------------------------------------- /docs/src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /docs/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/docs/static/.nojekyll -------------------------------------------------------------------------------- /docs/static/img/docusaurus-social-card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/docs/static/img/docusaurus-social-card.jpg -------------------------------------------------------------------------------- /docs/static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/docs/static/img/docusaurus.png -------------------------------------------------------------------------------- /docs/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/docs/static/img/favicon.ico -------------------------------------------------------------------------------- /docs/static/img/learn-bitbybit-social-card.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/docs/static/img/learn-bitbybit-social-card.jpeg -------------------------------------------------------------------------------- /docs/static/img/learn-bitbybit-social-card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/docs/static/img/learn-bitbybit-social-card.png -------------------------------------------------------------------------------- /docs/static/img/learn-bitbybit-social-card.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/docs/static/img/learn-bitbybit-social-card.xcf -------------------------------------------------------------------------------- /docs/static/img/logo-gold-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/docs/static/img/logo-gold-small.png -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // This file is not used in compilation. It is here just for a nice editor experience. 3 | "extends": "@docusaurus/tsconfig", 4 | "compilerOptions": { 5 | "baseUrl": "." 6 | }, 7 | "exclude": [".docusaurus", "build"] 8 | } 9 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | .angular 4 | .nuxt 5 | .output -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/.gitignore: -------------------------------------------------------------------------------- 1 | .angular -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/custom-webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | module: { 3 | rules: [ 4 | { 5 | test: /\.wasm$/, 6 | type: "javascript/auto", 7 | loader: "file-loader", 8 | }, 9 | { 10 | test: /\.m?js/, 11 | type: "javascript/auto", 12 | }, 13 | { 14 | test: /\.m?js/, 15 | resolve: { 16 | fullySpecified: false, 17 | }, 18 | } 19 | ] 20 | }, 21 | resolve: { 22 | fallback: { 23 | fs: false, 24 | path: false, 25 | crypto: false 26 | } 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/app/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/jscad-worker'; 4 | 5 | import('@bitbybit-dev/jscad/jscad-generated') 6 | .then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | addEventListener('message', ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/app/occ.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import initOpenCascade from '@bitbybit-dev/occt/bitbybit-dev-occt/cdn'; 3 | import { OpenCascadeInstance } from '@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js'; 4 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/occt-worker'; 5 | 6 | initOpenCascade().then((occ: OpenCascadeInstance) => { 7 | initializationComplete(occ, undefined); 8 | }); 9 | 10 | addEventListener('message', ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/angular/babylonjs/laptop-holder/src/assets/.gitkeep -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/angular/babylonjs/laptop-holder/src/assets/favicon.png -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/assets/lapholders1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/angular/babylonjs/laptop-holder/src/assets/lapholders1.jpeg -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | iframeUrl: 'http://bitbybit.dev/', 4 | }; 5 | -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/angular/babylonjs/laptop-holder/src/favicon.ico -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/styles.css: -------------------------------------------------------------------------------- 1 | @import "~@angular/material/prebuilt-themes/indigo-pink.css"; 2 | 3 | /* You can add global styles to this file, and also import other style files */ 4 | body { 5 | margin: 0px; 6 | background-color: #bbb; 7 | } 8 | 9 | /* Customize website's scrollbar like Mac OS 10 | Not supports in Firefox and IE */ 11 | 12 | /* total width */ 13 | body::-webkit-scrollbar { 14 | background-color: #BBBBBB; 15 | width: 16px; 16 | } 17 | -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | (id: string): T; 13 | keys(): string[]; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting(), 21 | ); 22 | 23 | // Then we find all the tests. 24 | const context = require.context('./', true, /\.spec\.ts$/); 25 | // And load the modules. 26 | context.keys().map(context); 27 | -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [], 7 | "skipLibCheck": true 8 | }, 9 | "files": [ 10 | "src/main.ts", 11 | "src/polyfills.ts" 12 | ], 13 | "include": [ 14 | "src/**/*.d.ts", 15 | "src/**/*.worker.ts" 16 | ] 17 | } -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /examples/angular/babylonjs/laptop-holder/tsconfig.worker.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "sourceMap": true, 6 | "outDir": "../../out-tsc/worker", 7 | "lib": [ 8 | "es2018", 9 | "webworker" 10 | ], 11 | "types": [], 12 | "skipLibCheck": true 13 | }, 14 | "include": [ 15 | "src/**/*.worker.ts" 16 | ] 17 | } -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next/core-web-vitals", "next/typescript"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/versions 12 | 13 | # testing 14 | /coverage 15 | 16 | # next.js 17 | /.next/ 18 | /out/ 19 | 20 | # production 21 | /build 22 | 23 | # misc 24 | .DS_Store 25 | *.pem 26 | 27 | # debug 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | 32 | # env files (can opt-in for commiting if needed) 33 | .env* 34 | 35 | # vercel 36 | .vercel 37 | 38 | # typescript 39 | *.tsbuildinfo 40 | next-env.d.ts 41 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/app/client-only.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import dynamic from "next/dynamic" 3 | import { FunctionComponent, PropsWithChildren } from "react" 4 | 5 | const ClientOnly: FunctionComponent = ({ children }) => children 6 | 7 | export default dynamic(() => Promise.resolve(ClientOnly), { 8 | ssr: false, 9 | }) -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/nextjs/babylonjs/simple/app/favicon.ico -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/app/fonts/GeistMonoVF.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/nextjs/babylonjs/simple/app/fonts/GeistMonoVF.woff -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/app/fonts/GeistVF.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/nextjs/babylonjs/simple/app/fonts/GeistVF.woff -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/app/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | :root { 6 | --background: #ffffff; 7 | --foreground: #171717; 8 | } 9 | 10 | @media (prefers-color-scheme: dark) { 11 | :root { 12 | --background: #0a0a0a; 13 | --foreground: #ededed; 14 | } 15 | } 16 | 17 | body { 18 | color: var(--foreground); 19 | background: var(--background); 20 | font-family: Arial, Helvetica, sans-serif; 21 | } 22 | 23 | canvas { 24 | width: 100%; 25 | height: 100%; 26 | outline: none; 27 | } -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/app/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/jscad-worker'; 4 | 5 | import('@bitbybit-dev/jscad/jscad-generated') 6 | .then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | addEventListener('message', ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import localFont from "next/font/local"; 3 | import "./globals.css"; 4 | 5 | const geistSans = localFont({ 6 | src: "./fonts/GeistVF.woff", 7 | variable: "--font-geist-sans", 8 | weight: "100 900", 9 | }); 10 | const geistMono = localFont({ 11 | src: "./fonts/GeistMonoVF.woff", 12 | variable: "--font-geist-mono", 13 | weight: "100 900", 14 | }); 15 | 16 | export const metadata: Metadata = { 17 | title: "Create Next App", 18 | description: "Generated by create next app", 19 | }; 20 | 21 | export default function RootLayout({ 22 | children, 23 | }: Readonly<{ 24 | children: React.ReactNode; 25 | }>) { 26 | return ( 27 | 28 | 31 | {children} 32 | 33 | 34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/app/occ.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /*eslint no-restricted-globals: 0*/ 3 | import initOpenCascade from "@bitbybit-dev/occt/bitbybit-dev-occt/cdn"; 4 | import type { OpenCascadeInstance } from '@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js'; 5 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/occt-worker'; 6 | 7 | initOpenCascade().then((occ: OpenCascadeInstance) => { 8 | initializationComplete(occ, undefined); 9 | }); 10 | 11 | addEventListener('message', ({ data }) => { 12 | onMessageInput(data, postMessage); 13 | }); -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/next.config.ts: -------------------------------------------------------------------------------- 1 | import type { NextConfig } from "next"; 2 | 3 | const nextConfig: NextConfig = { 4 | /* config options here */ 5 | 6 | webpack: (config, { isServer, webpack }) => { 7 | config.module.rules.find((k: any) => k.oneOf !== undefined).oneOf.unshift( 8 | { 9 | test: /\.wasm$/, 10 | type: "javascript/auto", 11 | loader: "file-loader", 12 | options: { 13 | name: "static/js/[name].[contenthash:8].[ext]", 14 | }, 15 | } 16 | ); 17 | 18 | //this is needed for the bitbybit-occt modules 19 | config.module.rules.push({ 20 | test: /\.json/, 21 | type: 'asset/resource' 22 | }); 23 | 24 | return config; 25 | }, 26 | }; 27 | 28 | export default nextConfig; 29 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@bitbybit-dev/babylonjs": "0.20.4", 13 | "react": "19.0.0-rc-69d4b800-20241021", 14 | "react-dom": "19.0.0-rc-69d4b800-20241021", 15 | "next": "15.0.1", 16 | "file-loader": "6.2.0" 17 | }, 18 | "devDependencies": { 19 | "typescript": "^5", 20 | "@types/node": "^20", 21 | "@types/react": "^18", 22 | "@types/react-dom": "^18", 23 | "postcss": "^8", 24 | "tailwindcss": "^3.4.1", 25 | "eslint": "^8", 26 | "eslint-config-next": "15.0.1" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/public/file.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/public/window.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from "tailwindcss"; 2 | 3 | const config: Config = { 4 | content: [ 5 | "./pages/**/*.{js,ts,jsx,tsx,mdx}", 6 | "./components/**/*.{js,ts,jsx,tsx,mdx}", 7 | "./app/**/*.{js,ts,jsx,tsx,mdx}", 8 | ], 9 | theme: { 10 | extend: { 11 | colors: { 12 | background: "var(--background)", 13 | foreground: "var(--foreground)", 14 | }, 15 | }, 16 | }, 17 | plugins: [], 18 | }; 19 | export default config; 20 | -------------------------------------------------------------------------------- /examples/nextjs/babylonjs/simple/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | -------------------------------------------------------------------------------- /examples/node/basic/.env: -------------------------------------------------------------------------------- 1 | PORT=4505 -------------------------------------------------------------------------------- /examples/node/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "1.0.0", 4 | "description": "Example of how to use @bitbybit-dev/occt within node", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "npx tsc", 8 | "start": "node --experimental-specifier-resolution=node dist/index.js", 9 | "dev": "concurrently \"npx tsc --watch\" \"nodemon --experimental-specifier-resolution=node -q dist/index.js\"" 10 | }, 11 | "author": "Bit By Bit Developers", 12 | "license": "MIT", 13 | "type": "module", 14 | "dependencies": { 15 | "@bitbybit-dev/occt": "^0.20.4" 16 | }, 17 | "devDependencies": { 18 | "concurrently": "^7.6.0", 19 | "nodemon": "^2.0.20", 20 | "typescript": "^4.9.4" 21 | } 22 | } -------------------------------------------------------------------------------- /examples/node/basic/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2016", 4 | "module": "nodenext", 5 | "outDir": "./dist", 6 | "esModuleInterop": true, 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "skipLibCheck": true 10 | }, 11 | "include": [ 12 | "./" 13 | ] 14 | } -------------------------------------------------------------------------------- /examples/node/express-app/.env: -------------------------------------------------------------------------------- 1 | PORT=4505 -------------------------------------------------------------------------------- /examples/node/express-app/.gitignore: -------------------------------------------------------------------------------- 1 | dist -------------------------------------------------------------------------------- /examples/node/express-app/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/node/express-app/README.md -------------------------------------------------------------------------------- /examples/node/express-app/manifold-3-0-0.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/node/express-app/manifold-3-0-0.wasm -------------------------------------------------------------------------------- /examples/node/express-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "ESNext", 4 | "esModuleInterop": true, 5 | "target": "es6", 6 | "moduleResolution": "node", 7 | "sourceMap": true, 8 | "outDir": "dist", 9 | "skipLibCheck": true 10 | }, 11 | "lib": [ 12 | "es2015" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /examples/nuxt/babylonjs/basic/app.vue: -------------------------------------------------------------------------------- 1 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /examples/nuxt/babylonjs/basic/nuxt.config.ts: -------------------------------------------------------------------------------- 1 | // https://nuxt.com/docs/api/configuration/nuxt-config 2 | export default defineNuxtConfig({ 3 | compatibilityDate: '2024-04-03', 4 | devtools: { enabled: true }, 5 | ssr: false, 6 | modules: ['@pinia/nuxt'], 7 | }) -------------------------------------------------------------------------------- /examples/nuxt/babylonjs/basic/occ.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /*eslint no-restricted-globals: 0*/ 3 | import initOpenCascade from "@bitbybit-dev/occt/bitbybit-dev-occt/nuxt.js"; 4 | import type { OpenCascadeInstance } from '@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js'; 5 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/occt-worker'; 6 | 7 | initOpenCascade().then((occ: OpenCascadeInstance) => { 8 | initializationComplete(occ, undefined); 9 | }); 10 | 11 | addEventListener('message', ({ data }) => { 12 | onMessageInput(data, postMessage); 13 | }); -------------------------------------------------------------------------------- /examples/nuxt/babylonjs/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt-bitbybit", 3 | "private": false, 4 | "type": "module", 5 | "license": "MIT", 6 | "scripts": { 7 | "build": "nuxt build", 8 | "dev": "nuxt dev", 9 | "generate": "nuxt generate", 10 | "preview": "nuxt preview", 11 | "postinstall": "nuxt prepare" 12 | }, 13 | "dependencies": { 14 | "@bitbybit-dev/babylonjs": "0.20.4", 15 | "@pinia/nuxt": "^0.5.4", 16 | "nuxt": "^3.13.0", 17 | "pinia": "^2.2.2", 18 | "vue": "latest", 19 | "vue-router": "latest" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/nuxt/babylonjs/basic/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/nuxt/babylonjs/basic/public/favicon.ico -------------------------------------------------------------------------------- /examples/nuxt/babylonjs/basic/public/robots.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/nuxt/babylonjs/basic/server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.nuxt/tsconfig.server.json" 3 | } 4 | -------------------------------------------------------------------------------- /examples/nuxt/babylonjs/basic/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // https://nuxt.com/docs/guide/concepts/typescript 3 | "extends": "./.nuxt/tsconfig.json" 4 | } 5 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/cup/public/favicon.ico -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/cup/public/favicon.png -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/public/lapholders1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/cup/public/lapholders1.jpeg -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/cup/public/logo192.png -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/cup/public/logo512.png -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Laptop Holder", 3 | "name": "Configure your laptop holder", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | // render(); 7 | // const linkElement = screen.getByText(/learn react/i); 8 | // expect(linkElement).toBeInTheDocument(); 9 | expect(true).toBe(true); 10 | }); 11 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | background-color: rgb(26,28,31); 9 | color: #fff; 10 | } 11 | 12 | code { 13 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 14 | monospace; 15 | } 16 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/src/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/jscad-worker'; 4 | 5 | import('@bitbybit-dev/jscad/jscad-generated') 6 | .then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | addEventListener('message', ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/src/occ.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /*eslint no-restricted-globals: 0*/ 3 | import initOpenCascade from '@bitbybit-dev/occt/bitbybit-dev-occt/cdn'; 4 | import { OpenCascadeInstance } from '@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js'; 5 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/occt-worker'; 6 | 7 | initOpenCascade().then((occ: OpenCascadeInstance) => { 8 | initializationComplete(occ, undefined); 9 | }); 10 | 11 | addEventListener('message', ({ data }) => { 12 | onMessageInput(data, postMessage); 13 | }); 14 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals'; 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry); 7 | getFID(onPerfEntry); 8 | getFCP(onPerfEntry); 9 | getLCP(onPerfEntry); 10 | getTTFB(onPerfEntry); 11 | }); 12 | } 13 | }; 14 | 15 | export default reportWebVitals; 16 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/src/use-previous.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from "react"; 2 | 3 | export function usePrevious(value) { 4 | const ref = useRef(); 5 | useEffect(() => { 6 | ref.current = value; 7 | }, [value]); 8 | return ref.current; 9 | } 10 | -------------------------------------------------------------------------------- /examples/react/babylonjs/cup/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": false, 14 | "forceConsistentCasingInFileNames": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "module": "esnext", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "sourceMap": false, 21 | "noEmit": true, 22 | "jsx": "react-jsx" 23 | }, 24 | "include": [ 25 | "src" 26 | ] 27 | } -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/config-overrides.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | webpack: (config) => { 3 | config.module.rules.find(k => k.oneOf !== undefined).oneOf.unshift( 4 | { 5 | test: /\.wasm$/, 6 | type: "javascript/auto", 7 | loader: "file-loader", 8 | options: { 9 | name: "static/js/[name].[contenthash:8].[ext]", 10 | }, 11 | } 12 | ); 13 | config.resolve.fallback = 14 | { 15 | fs: false, 16 | perf_hooks: false, 17 | os: false, 18 | path: false, 19 | worker_threads: false, 20 | crypto: false, 21 | stream: false 22 | } 23 | 24 | return config; 25 | }, 26 | }; 27 | -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/iframe-link/public/favicon.png -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/public/iframe-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/iframe-link/public/iframe-link.png -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "IFrame link", 3 | "name": "App that shows how to use iframes to bitbybit preview links", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | render(); 7 | const linkElement = screen.getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | margin: 50px; 9 | color: rgb(255, 255, 255); 10 | background-color: rgb(133, 182, 212); 11 | } 12 | 13 | code { 14 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 15 | monospace; 16 | } 17 | -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals'; 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry); 7 | getFID(onPerfEntry); 8 | getFCP(onPerfEntry); 9 | getLCP(onPerfEntry); 10 | getTTFB(onPerfEntry); 11 | }); 12 | } 13 | }; 14 | 15 | export default reportWebVitals; 16 | -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /examples/react/babylonjs/iframe-link/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": false, 14 | "forceConsistentCasingInFileNames": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "module": "esnext", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "sourceMap": false, 21 | "noEmit": true, 22 | "jsx": "react-jsx" 23 | }, 24 | "include": [ 25 | "src" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/laptop-holder/public/favicon.ico -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/laptop-holder/public/favicon.png -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/public/lapholders1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/laptop-holder/public/lapholders1.jpeg -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/laptop-holder/public/logo192.png -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/babylonjs/laptop-holder/public/logo512.png -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Store - Laptop Holder", 3 | "name": "App that lets you configure your own laptop holder (Made by Bit By Bit Developers)", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | render(); 7 | const linkElement = screen.getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | background-color: #bbb; 9 | } 10 | 11 | code { 12 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 13 | monospace; 14 | } 15 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/src/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/jscad-worker'; 3 | 4 | import('@bitbybit-dev/jscad/jscad-generated') 5 | .then((s) => { 6 | initializationComplete(s.default()); 7 | }); 8 | 9 | // eslint-disable-next-line no-restricted-globals 10 | addEventListener('message', ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/src/occ.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /*eslint no-restricted-globals: 0*/ 3 | import initOpenCascade from '@bitbybit-dev/occt/bitbybit-dev-occt/cdn'; 4 | import { OpenCascadeInstance } from '@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js'; 5 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/occt-worker'; 6 | 7 | initOpenCascade().then((occ: OpenCascadeInstance) => { 8 | initializationComplete(occ, undefined); 9 | }); 10 | 11 | addEventListener('message', ({ data }) => { 12 | onMessageInput(data, postMessage); 13 | }); 14 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals'; 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry); 7 | getFID(onPerfEntry); 8 | getFCP(onPerfEntry); 9 | getLCP(onPerfEntry); 10 | getTTFB(onPerfEntry); 11 | }); 12 | } 13 | }; 14 | 15 | export default reportWebVitals; 16 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/src/use-previous.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from "react"; 2 | 3 | export function usePrevious(value) { 4 | const ref = useRef(); 5 | useEffect(() => { 6 | ref.current = value; 7 | }, [value]); 8 | return ref.current; 9 | } 10 | -------------------------------------------------------------------------------- /examples/react/babylonjs/laptop-holder/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": false, 14 | "forceConsistentCasingInFileNames": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "module": "esnext", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "sourceMap": false, 21 | "noEmit": true, 22 | "jsx": "react-jsx" 23 | }, 24 | "include": [ 25 | "src" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/config-overrides.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | webpack: (config) => { 3 | config.resolve.fallback = 4 | { 5 | fs: false, 6 | perf_hooks: false, 7 | os: false, 8 | path: false, 9 | worker_threads: false, 10 | crypto: false, 11 | stream: false 12 | } 13 | config.module.rules.push({ 14 | test: /\.m?js/, 15 | type: "javascript/auto", 16 | }) 17 | config.module.rules.push({ 18 | test: /\.m?js/, 19 | resolve: { 20 | fullySpecified: false, 21 | }, 22 | }); 23 | return config; 24 | }, 25 | }; 26 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/threejs/vase/public/favicon.ico -------------------------------------------------------------------------------- /examples/react/threejs/vase/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/threejs/vase/public/favicon.png -------------------------------------------------------------------------------- /examples/react/threejs/vase/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/threejs/vase/public/logo192.png -------------------------------------------------------------------------------- /examples/react/threejs/vase/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/threejs/vase/public/logo512.png -------------------------------------------------------------------------------- /examples/react/threejs/vase/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "ThreeJS Example", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/public/threejs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/examples/react/threejs/vase/public/threejs.png -------------------------------------------------------------------------------- /examples/react/threejs/vase/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | render(); 7 | const linkElement = screen.getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | background-color: #1A1C20; 9 | } 10 | 11 | code { 12 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 13 | monospace; 14 | } -------------------------------------------------------------------------------- /examples/react/threejs/vase/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot( 8 | document.getElementById('root') as HTMLElement 9 | ); 10 | root.render( 11 | 12 | 13 | 14 | ); 15 | 16 | // If you want to start measuring performance in your app, pass a function 17 | // to log results (for example: reportWebVitals(console.log)) 18 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 19 | reportWebVitals(); 20 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/src/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/jscad-worker'; 4 | 5 | import('@bitbybit-dev/jscad/jscad-generated') 6 | .then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | // eslint-disable-next-line no-restricted-globals 11 | addEventListener('message', ({ data }) => { 12 | onMessageInput(data, postMessage); 13 | }); 14 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/src/occ.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /*eslint no-restricted-globals: 0*/ 3 | import initOpenCascade from '@bitbybit-dev/occt/bitbybit-dev-occt/cdn'; 4 | import { OpenCascadeInstance } from '@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js'; 5 | import { initializationComplete, onMessageInput } from '@bitbybit-dev/occt-worker'; 6 | 7 | initOpenCascade().then((occ: OpenCascadeInstance) => { 8 | initializationComplete(occ, undefined); 9 | }); 10 | 11 | addEventListener('message', ({ data }) => { 12 | onMessageInput(data, postMessage); 13 | }); 14 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals'; 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry); 7 | getFID(onPerfEntry); 8 | getFCP(onPerfEntry); 9 | getLCP(onPerfEntry); 10 | getTTFB(onPerfEntry); 11 | }); 12 | } 13 | }; 14 | 15 | export default reportWebVitals; 16 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /examples/react/threejs/vase/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "module": "esnext", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "sourceMap": true, 21 | "noEmit": true, 22 | "jsx": "react-jsx" 23 | }, 24 | "include": [ 25 | "src" 26 | ] 27 | } -------------------------------------------------------------------------------- /examples/runner/babylon/README.md: -------------------------------------------------------------------------------- 1 | BABYLONJS runner has two flavors - Lite and Full. Lite version is smaller in size and requires these dependencies to be present: 2 | 3 | window.BABYLON, 4 | window.GUI, 5 | window.LOADERS, 6 | window.MATERIALS, 7 | window.SERIALIZERS 8 | 9 | Full runner bundles BABYLONJS in the same file and is thus heavier in size. 10 | -------------------------------------------------------------------------------- /examples/runner/threejs/README.md: -------------------------------------------------------------------------------- 1 | THREEJS runner has two flavors - Lite and Full. Lite version is smaller in size and requires window.THREEJS dependency to be present. Full runner bundles ThreeJS in the same file. -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Bitbybit & BabylonJS Hex House Concept Example 8 | 9 | 10 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-typescript-starter", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "@bitbybit-dev/babylonjs": "0.20.4", 13 | "lil-gui": "0.20.0" 14 | }, 15 | "devDependencies": { 16 | "typescript": "~5.8.3", 17 | "vite": "^6.3.2", 18 | "@types/three": "0.176.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/src/helpers/gui-helper.ts: -------------------------------------------------------------------------------- 1 | export function disableGUI() { 2 | const lilGui = document.getElementsByClassName("lil-gui")[0] as HTMLElement; 3 | lilGui.style.pointerEvents = "none"; 4 | lilGui.style.opacity = "0.5"; 5 | } 6 | 7 | export function enableGUI() { 8 | const lilGui = document.getElementsByClassName("lil-gui")[0] as HTMLElement; 9 | lilGui.style.pointerEvents = "all"; 10 | lilGui.style.opacity = "1"; 11 | } 12 | 13 | export function showSpinner() { 14 | const element = document.createElement("div"); 15 | element.id = "spinner"; 16 | element.className = "lds-ellipsis"; 17 | element.innerHTML = ` 18 |
19 |
20 |
21 | `; 22 | 23 | document.body.appendChild(element); 24 | } 25 | 26 | export function hideSpinner() { 27 | const el = document.getElementById("spinner"); 28 | if (el) { 29 | el.remove(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/src/helpers/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./create-gui"; 2 | export * from "./create-shape"; 3 | export * from "./init-kernels"; 4 | export * from "./init-babylonjs"; 5 | export * from "./downloads"; 6 | export * from "./gui-helper"; 7 | export * from "./downloads"; 8 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/src/models/current.ts: -------------------------------------------------------------------------------- 1 | import { Mesh } from "@babylonjs/core"; 2 | import { GUI } from "lil-gui"; 3 | 4 | export type Current = { 5 | groups: Mesh[] | undefined; 6 | ground: Mesh | undefined; 7 | gui: GUI | undefined; 8 | }; 9 | 10 | export const current: Current = { 11 | groups: undefined, 12 | ground: undefined, 13 | gui: undefined, 14 | }; 15 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/src/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./current"; 2 | export * from "./kernel-options"; 3 | export * from "./model"; 4 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/src/models/kernel-options.ts: -------------------------------------------------------------------------------- 1 | export interface KernelOptions { 2 | enableOCCT: boolean; 3 | enableJSCAD: boolean; 4 | enableManifold: boolean; 5 | } 6 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/src/models/model.ts: -------------------------------------------------------------------------------- 1 | import type { BitByBitBase, Inputs } from "@bitbybit-dev/babylonjs"; 2 | import type { Scene } from "@babylonjs/core"; 3 | 4 | export type Model = { 5 | uHex: number; 6 | vHex: number; 7 | drawEdges: boolean; 8 | drawFaces: boolean; 9 | color: string; 10 | downloadSTL?: (scene: Scene) => void; 11 | downloadStep?: ( 12 | bitbybit: BitByBitBase, 13 | finalShape: Inputs.OCCT.TopoDSShapePointer | undefined 14 | ) => void; 15 | downloadGLTF?: (scene: Scene) => void; 16 | update?: () => void; 17 | }; 18 | 19 | export const model = { 20 | uHex: 41, 21 | vHex: 10, 22 | drawEdges: true, 23 | drawFaces: true, 24 | color: "#ffffff", 25 | } as Model; 26 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/src/workers/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from "@bitbybit-dev/jscad-worker"; 5 | 6 | import("@bitbybit-dev/jscad/jscad-generated").then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | addEventListener("message", ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/src/workers/manifold.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from "@bitbybit-dev/manifold-worker"; 5 | import Module from "manifold-3d"; 6 | 7 | const init = async () => { 8 | const wasm = await Module({ 9 | locateFile: () => { 10 | return "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.2/wasm/manifold.cc2ddd38.wasm"; 11 | }, 12 | }); 13 | wasm.setup(); 14 | initializationComplete(wasm); 15 | }; 16 | 17 | init(); 18 | 19 | addEventListener("message", ({ data }) => { 20 | onMessageInput(data, postMessage); 21 | }); 22 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/src/workers/occt.worker.ts: -------------------------------------------------------------------------------- 1 | import initOpenCascade from "@bitbybit-dev/occt/bitbybit-dev-occt/cdn"; 2 | import type { OpenCascadeInstance } from "@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js"; 3 | import { 4 | initializationComplete, 5 | onMessageInput, 6 | } from "@bitbybit-dev/occt-worker"; 7 | 8 | initOpenCascade().then((occ: OpenCascadeInstance) => { 9 | initializationComplete(occ, undefined); 10 | }); 11 | 12 | addEventListener("message", ({ data }) => { 13 | onMessageInput(data, postMessage); 14 | }); 15 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-house-concept/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "verbatimModuleSyntax": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | 16 | /* Linting */ 17 | "strict": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "erasableSyntaxOnly": true, 21 | "noFallthroughCasesInSwitch": true, 22 | "noUncheckedSideEffectImports": true 23 | }, 24 | "include": ["src"] 25 | } 26 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Bitbybit & BabylonJS Hex Shell Example 8 | 9 | 10 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-typescript-starter", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "@bitbybit-dev/babylonjs": "0.20.4", 13 | "lil-gui": "0.20.0" 14 | }, 15 | "devDependencies": { 16 | "typescript": "~5.8.3", 17 | "vite": "^6.3.2", 18 | "@types/three": "0.176.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/src/helpers/gui-helper.ts: -------------------------------------------------------------------------------- 1 | export function disableGUI() { 2 | const lilGui = document.getElementsByClassName("lil-gui")[0] as HTMLElement; 3 | lilGui.style.pointerEvents = "none"; 4 | lilGui.style.opacity = "0.5"; 5 | } 6 | 7 | export function enableGUI() { 8 | const lilGui = document.getElementsByClassName("lil-gui")[0] as HTMLElement; 9 | lilGui.style.pointerEvents = "all"; 10 | lilGui.style.opacity = "1"; 11 | } 12 | 13 | export function showSpinner() { 14 | const element = document.createElement("div"); 15 | element.id = "spinner"; 16 | element.className = "lds-ellipsis"; 17 | element.innerHTML = ` 18 |
19 |
20 |
21 | `; 22 | 23 | document.body.appendChild(element); 24 | } 25 | 26 | export function hideSpinner() { 27 | const el = document.getElementById("spinner"); 28 | if (el) { 29 | el.remove(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/src/helpers/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./create-gui"; 2 | export * from "./create-shape"; 3 | export * from "./init-kernels"; 4 | export * from "./init-babylonjs"; 5 | export * from "./downloads"; 6 | export * from "./gui-helper"; 7 | export * from "./downloads"; 8 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/src/models/current.ts: -------------------------------------------------------------------------------- 1 | import { DirectionalLight, Mesh } from "@babylonjs/core"; 2 | import { GUI } from "lil-gui"; 3 | 4 | export type Current = { 5 | group1: Mesh | undefined; 6 | group2: Mesh | undefined; 7 | dimensions: Mesh | undefined; 8 | light1: DirectionalLight | undefined; 9 | ground: Mesh | undefined; 10 | gui: GUI | undefined; 11 | }; 12 | 13 | export const current: Current = { 14 | group1: undefined, 15 | group2: undefined, 16 | dimensions: undefined, 17 | ground: undefined, 18 | light1: undefined, 19 | gui: undefined, 20 | }; 21 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/src/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./current"; 2 | export * from "./kernel-options"; 3 | export * from "./model"; 4 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/src/models/kernel-options.ts: -------------------------------------------------------------------------------- 1 | export interface KernelOptions { 2 | enableOCCT: boolean; 3 | enableJSCAD: boolean; 4 | enableManifold: boolean; 5 | } 6 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/src/workers/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from "@bitbybit-dev/jscad-worker"; 5 | 6 | import("@bitbybit-dev/jscad/jscad-generated").then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | addEventListener("message", ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/src/workers/manifold.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from "@bitbybit-dev/manifold-worker"; 5 | import Module from "manifold-3d"; 6 | 7 | const init = async () => { 8 | const wasm = await Module({ 9 | locateFile: () => { 10 | return "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.2/wasm/manifold.cc2ddd38.wasm"; 11 | }, 12 | }); 13 | wasm.setup(); 14 | initializationComplete(wasm); 15 | }; 16 | 17 | init(); 18 | 19 | addEventListener("message", ({ data }) => { 20 | onMessageInput(data, postMessage); 21 | }); 22 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/src/workers/occt.worker.ts: -------------------------------------------------------------------------------- 1 | import initOpenCascade from "@bitbybit-dev/occt/bitbybit-dev-occt/cdn"; 2 | import type { OpenCascadeInstance } from "@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js"; 3 | import { 4 | initializationComplete, 5 | onMessageInput, 6 | } from "@bitbybit-dev/occt-worker"; 7 | 8 | initOpenCascade().then((occ: OpenCascadeInstance) => { 9 | initializationComplete(occ, undefined); 10 | }); 11 | 12 | addEventListener("message", ({ data }) => { 13 | onMessageInput(data, postMessage); 14 | }); 15 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/hex-shell/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "verbatimModuleSyntax": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | 16 | /* Linting */ 17 | "strict": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "erasableSyntaxOnly": true, 21 | "noFallthroughCasesInSwitch": true, 22 | "noUncheckedSideEffectImports": true 23 | }, 24 | "include": ["src"] 25 | } 26 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/starter-template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Bitbybit & ThreeJS All Kernels Example 8 | 9 | 10 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/starter-template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-typescript-starter", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "@bitbybit-dev/babylonjs": "0.20.4" 13 | }, 14 | "devDependencies": { 15 | "typescript": "~5.8.3", 16 | "vite": "^6.3.2", 17 | "@types/three": "0.176.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/starter-template/src/models/current.ts: -------------------------------------------------------------------------------- 1 | import { DirectionalLight, Group, Mesh } from "three"; 2 | import { GUI } from "lil-gui"; 3 | 4 | export type Current = { 5 | group1: Group | undefined; 6 | group2: Group | undefined; 7 | dimensions: Group | undefined; 8 | light1: DirectionalLight | undefined; 9 | ground: Mesh | undefined; 10 | gui: GUI | undefined; 11 | }; 12 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/starter-template/src/models/model.ts: -------------------------------------------------------------------------------- 1 | export type Model = { 2 | uHex: number; 3 | vHex: number; 4 | height: number; 5 | ellipse1MinRad: number; 6 | ellipse1MaxRad: number; 7 | ellipse2MinRad: number; 8 | ellipse2MaxRad: number; 9 | ellipse2RotX: number; 10 | ellipse2RotY: number; 11 | ellipse3MinRad: number; 12 | ellipse3MaxRad: number; 13 | ellipse3YRot: number; 14 | drawEdges: boolean; 15 | drawFaces: boolean; 16 | color1: string; 17 | color2: string; 18 | finalPrecision: number; 19 | rotationEnabled: boolean; 20 | downloadSTL?: () => void; 21 | downloadStep?: () => void; 22 | downloadGLB?: () => void; 23 | update?: () => void; 24 | }; 25 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/starter-template/src/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0px; 3 | overflow: hidden; 4 | } 5 | 6 | #babylon-canvas { 7 | outline: none; 8 | width: 100%; 9 | height: 100vh; 10 | } 11 | 12 | a.logo { 13 | position: absolute; 14 | color: white; 15 | vertical-align: middle; 16 | bottom: 10px; 17 | left: 10px; 18 | font-family: 'Courier New', Courier, monospace; 19 | text-decoration: none; 20 | width: 100%; 21 | } 22 | 23 | .logo { 24 | margin-bottom: 20px; 25 | text-align: center; 26 | } 27 | 28 | .logo img { 29 | width: 50px; 30 | height: 50px; 31 | } 32 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/starter-template/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/starter-template/src/workers/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from "@bitbybit-dev/jscad-worker"; 5 | 6 | import("@bitbybit-dev/jscad/jscad-generated").then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | addEventListener("message", ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/starter-template/src/workers/manifold.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from "@bitbybit-dev/manifold-worker"; 5 | import Module from "manifold-3d"; 6 | 7 | const init = async () => { 8 | const wasm = await Module({ 9 | locateFile: () => { 10 | return "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.3/wasm/manifold.cc2ddd38.wasm"; 11 | }, 12 | }); 13 | wasm.setup(); 14 | initializationComplete(wasm); 15 | }; 16 | 17 | init(); 18 | 19 | addEventListener("message", ({ data }) => { 20 | onMessageInput(data, postMessage); 21 | }); 22 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/starter-template/src/workers/occt.worker.ts: -------------------------------------------------------------------------------- 1 | import initOpenCascade from "@bitbybit-dev/occt/bitbybit-dev-occt/cdn"; 2 | import type { OpenCascadeInstance } from "@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js"; 3 | import { 4 | initializationComplete, 5 | onMessageInput, 6 | } from "@bitbybit-dev/occt-worker"; 7 | 8 | initOpenCascade().then((occ: OpenCascadeInstance) => { 9 | initializationComplete(occ, undefined); 10 | }); 11 | 12 | addEventListener("message", ({ data }) => { 13 | onMessageInput(data, postMessage); 14 | }); 15 | -------------------------------------------------------------------------------- /examples/vite/babylonjs/starter-template/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "verbatimModuleSyntax": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | 16 | /* Linting */ 17 | "strict": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "erasableSyntaxOnly": true, 21 | "noFallthroughCasesInSwitch": true, 22 | "noUncheckedSideEffectImports": true 23 | }, 24 | "include": ["src"] 25 | } 26 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Bitbybit & ThreeJS CAD Example 8 | 9 | 10 | 22 |
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-typescript-starter", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "@bitbybit-dev/threejs": "0.20.4", 13 | "lil-gui": "0.20.0" 14 | }, 15 | "devDependencies": { 16 | "typescript": "~5.8.3", 17 | "vite": "^6.3.2", 18 | "@types/three": "0.176.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/src/models/current.ts: -------------------------------------------------------------------------------- 1 | import { Group, Mesh } from 'three'; 2 | import { GUI } from 'lil-gui'; 3 | 4 | export type Current = { 5 | group: Group | undefined; 6 | ground: Mesh | undefined; 7 | gui: GUI | undefined; 8 | }; 9 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/src/models/model.ts: -------------------------------------------------------------------------------- 1 | export type Model = { 2 | cupHeight: number; 3 | cupRadius: number; 4 | cupThickness: number; 5 | cupHandleDistance: number; 6 | cupHandleHeight: number; 7 | color: string; 8 | downloadSTL?: () => void; 9 | downloadStep?: () => void; 10 | }; 11 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/src/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0px; 3 | overflow: hidden; 4 | } 5 | a.logo { 6 | position: absolute; 7 | color: white; 8 | vertical-align: middle; 9 | bottom: 10px; 10 | left: 10px; 11 | font-family: 'Courier New', Courier, monospace; 12 | text-decoration: none; 13 | width: 100%; 14 | } 15 | 16 | .logo { 17 | margin-bottom: 20px; 18 | text-align: center; 19 | } 20 | 21 | .logo img { 22 | width: 50px; 23 | height: 50px; 24 | } 25 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/src/workers/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from '@bitbybit-dev/jscad-worker'; 5 | 6 | import('@bitbybit-dev/jscad/jscad-generated').then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | addEventListener('message', ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/src/workers/manifold.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from '@bitbybit-dev/manifold-worker'; 5 | import Module from 'manifold-3d'; 6 | 7 | const init = async () => { 8 | const wasm = await Module({ 9 | locateFile: () => { 10 | return 'https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.2/wasm/manifold.cc2ddd38.wasm'; 11 | }, 12 | }); 13 | wasm.setup(); 14 | initializationComplete(wasm); 15 | }; 16 | 17 | init(); 18 | 19 | addEventListener('message', ({ data }) => { 20 | onMessageInput(data, postMessage); 21 | }); 22 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/src/workers/occt.worker.ts: -------------------------------------------------------------------------------- 1 | import initOpenCascade from '@bitbybit-dev/occt/bitbybit-dev-occt/cdn'; 2 | import type { OpenCascadeInstance } from '@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js'; 3 | import { 4 | initializationComplete, 5 | onMessageInput, 6 | } from '@bitbybit-dev/occt-worker'; 7 | 8 | initOpenCascade().then((occ: OpenCascadeInstance) => { 9 | initializationComplete(occ, undefined); 10 | }); 11 | 12 | addEventListener('message', ({ data }) => { 13 | onMessageInput(data, postMessage); 14 | }); 15 | -------------------------------------------------------------------------------- /examples/vite/threejs/cup/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "verbatimModuleSyntax": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | 16 | /* Linting */ 17 | "strict": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "erasableSyntaxOnly": true, 21 | "noFallthroughCasesInSwitch": true, 22 | "noUncheckedSideEffectImports": true 23 | }, 24 | "include": ["src"] 25 | } 26 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Bitbybit & ThreeJS Hex House Concept Demo 8 | 9 | 10 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-typescript-starter", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "@bitbybit-dev/threejs": "0.20.4", 13 | "lil-gui": "0.20.0" 14 | }, 15 | "devDependencies": { 16 | "typescript": "~5.8.3", 17 | "vite": "^6.3.2", 18 | "@types/three": "0.176.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/src/helpers/gui-helper.ts: -------------------------------------------------------------------------------- 1 | export function disableGUI() { 2 | const lilGui = document.getElementsByClassName("lil-gui")[0] as HTMLElement; 3 | lilGui.style.pointerEvents = "none"; 4 | lilGui.style.opacity = "0.5"; 5 | } 6 | 7 | export function enableGUI() { 8 | const lilGui = document.getElementsByClassName("lil-gui")[0] as HTMLElement; 9 | lilGui.style.pointerEvents = "all"; 10 | lilGui.style.opacity = "1"; 11 | } 12 | 13 | export function showSpinner() { 14 | const element = document.createElement("div"); 15 | element.id = "spinner"; 16 | element.className = "lds-ellipsis"; 17 | element.innerHTML = ` 18 |
19 |
20 |
21 | `; 22 | 23 | document.body.appendChild(element); 24 | } 25 | 26 | export function hideSpinner() { 27 | const el = document.getElementById("spinner"); 28 | if (el) { 29 | el.remove(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/src/helpers/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./create-gui"; 2 | export * from "./create-shape"; 3 | export * from "./init-kernels"; 4 | export * from "./init-threejs"; 5 | export * from "./downloads"; 6 | export * from "./gui-helper"; 7 | export * from "./downloads"; 8 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/src/models/current.ts: -------------------------------------------------------------------------------- 1 | import { Group, Mesh } from "three"; 2 | import { GUI } from "lil-gui"; 3 | 4 | export type Current = { 5 | groups: Group[] | undefined; 6 | ground: Mesh | undefined; 7 | gui: GUI | undefined; 8 | }; 9 | 10 | export const current: Current = { 11 | groups: undefined, 12 | ground: undefined, 13 | gui: undefined, 14 | }; 15 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/src/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./current"; 2 | export * from "./kernel-options"; 3 | export * from "./model"; 4 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/src/models/kernel-options.ts: -------------------------------------------------------------------------------- 1 | export interface KernelOptions { 2 | enableOCCT: boolean; 3 | enableJSCAD: boolean; 4 | enableManifold: boolean; 5 | } 6 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/src/models/model.ts: -------------------------------------------------------------------------------- 1 | import type { BitByBitBase, Inputs } from "@bitbybit-dev/threejs"; 2 | import type { Scene } from "three"; 3 | 4 | export type Model = { 5 | uHex: number; 6 | vHex: number; 7 | drawEdges: boolean; 8 | drawFaces: boolean; 9 | color: string; 10 | downloadSTL?: (scene: Scene) => void; 11 | downloadStep?: ( 12 | bitbybit: BitByBitBase, 13 | finalShape: Inputs.OCCT.TopoDSShapePointer | undefined 14 | ) => void; 15 | downloadGLB?: (scene: Scene) => void; 16 | update?: () => void; 17 | }; 18 | 19 | export const model = { 20 | uHex: 41, 21 | vHex: 10, 22 | drawEdges: true, 23 | drawFaces: true, 24 | color: "#000000", 25 | } as Model; 26 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/src/workers/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from '@bitbybit-dev/jscad-worker'; 5 | 6 | import('@bitbybit-dev/jscad/jscad-generated').then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | addEventListener('message', ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/src/workers/manifold.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from '@bitbybit-dev/manifold-worker'; 5 | import Module from 'manifold-3d'; 6 | 7 | const init = async () => { 8 | const wasm = await Module({ 9 | locateFile: () => { 10 | return 'https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.2/wasm/manifold.cc2ddd38.wasm'; 11 | }, 12 | }); 13 | wasm.setup(); 14 | initializationComplete(wasm); 15 | }; 16 | 17 | init(); 18 | 19 | addEventListener('message', ({ data }) => { 20 | onMessageInput(data, postMessage); 21 | }); 22 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/src/workers/occt.worker.ts: -------------------------------------------------------------------------------- 1 | import initOpenCascade from '@bitbybit-dev/occt/bitbybit-dev-occt/cdn'; 2 | import type { OpenCascadeInstance } from '@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js'; 3 | import { 4 | initializationComplete, 5 | onMessageInput, 6 | } from '@bitbybit-dev/occt-worker'; 7 | 8 | initOpenCascade().then((occ: OpenCascadeInstance) => { 9 | initializationComplete(occ, undefined); 10 | }); 11 | 12 | addEventListener('message', ({ data }) => { 13 | onMessageInput(data, postMessage); 14 | }); 15 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-house-concept/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "verbatimModuleSyntax": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | 16 | /* Linting */ 17 | "strict": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "erasableSyntaxOnly": true, 21 | "noFallthroughCasesInSwitch": true, 22 | "noUncheckedSideEffectImports": true 23 | }, 24 | "include": ["src"] 25 | } 26 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Bitbybit & ThreeJS Hex Shell Example 8 | 9 | 10 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-typescript-starter", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "@bitbybit-dev/threejs": "0.20.4", 13 | "lil-gui": "0.20.0" 14 | }, 15 | "devDependencies": { 16 | "typescript": "~5.8.3", 17 | "vite": "^6.3.2", 18 | "@types/three": "0.176.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/src/helpers/gui-helper.ts: -------------------------------------------------------------------------------- 1 | export function disableGUI() { 2 | const lilGui = document.getElementsByClassName("lil-gui")[0] as HTMLElement; 3 | lilGui.style.pointerEvents = "none"; 4 | lilGui.style.opacity = "0.5"; 5 | } 6 | 7 | export function enableGUI() { 8 | const lilGui = document.getElementsByClassName("lil-gui")[0] as HTMLElement; 9 | lilGui.style.pointerEvents = "all"; 10 | lilGui.style.opacity = "1"; 11 | } 12 | 13 | export function showSpinner() { 14 | const element = document.createElement("div"); 15 | element.id = "spinner"; 16 | element.className = "lds-ellipsis"; 17 | element.innerHTML = ` 18 |
19 |
20 |
21 | `; 22 | 23 | document.body.appendChild(element); 24 | } 25 | 26 | export function hideSpinner() { 27 | const el = document.getElementById("spinner"); 28 | if (el) { 29 | el.remove(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/src/helpers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './create-gui'; 2 | export * from './create-shape'; 3 | export * from './init-kernels'; 4 | export * from './init-threejs'; 5 | export * from './downloads'; 6 | export * from './gui-helper'; 7 | export * from './downloads'; 8 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/src/models/current.ts: -------------------------------------------------------------------------------- 1 | import { DirectionalLight, Group, Mesh } from "three"; 2 | import { GUI } from "lil-gui"; 3 | 4 | export type Current = { 5 | group1: Group | undefined; 6 | group2: Group | undefined; 7 | dimensions: Group | undefined; 8 | light1: DirectionalLight | undefined; 9 | ground: Mesh | undefined; 10 | gui: GUI | undefined; 11 | }; 12 | 13 | export const current: Current = { 14 | group1: undefined, 15 | group2: undefined, 16 | dimensions: undefined, 17 | ground: undefined, 18 | light1: undefined, 19 | gui: undefined, 20 | }; 21 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/src/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./current"; 2 | export * from "./kernel-options"; 3 | export * from "./model"; 4 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/src/models/kernel-options.ts: -------------------------------------------------------------------------------- 1 | export interface KernelOptions { 2 | enableOCCT: boolean; 3 | enableJSCAD: boolean; 4 | enableManifold: boolean; 5 | } 6 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/src/workers/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from "@bitbybit-dev/jscad-worker"; 5 | 6 | import("@bitbybit-dev/jscad/jscad-generated").then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | addEventListener("message", ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/src/workers/manifold.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from "@bitbybit-dev/manifold-worker"; 5 | import Module from "manifold-3d"; 6 | 7 | const init = async () => { 8 | const wasm = await Module({ 9 | locateFile: () => { 10 | return "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.2/wasm/manifold.cc2ddd38.wasm"; 11 | }, 12 | }); 13 | wasm.setup(); 14 | initializationComplete(wasm); 15 | }; 16 | 17 | init(); 18 | 19 | addEventListener("message", ({ data }) => { 20 | onMessageInput(data, postMessage); 21 | }); 22 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/src/workers/occt.worker.ts: -------------------------------------------------------------------------------- 1 | import initOpenCascade from "@bitbybit-dev/occt/bitbybit-dev-occt/cdn"; 2 | import type { OpenCascadeInstance } from "@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js"; 3 | import { 4 | initializationComplete, 5 | onMessageInput, 6 | } from "@bitbybit-dev/occt-worker"; 7 | 8 | initOpenCascade().then((occ: OpenCascadeInstance) => { 9 | initializationComplete(occ, undefined); 10 | }); 11 | 12 | addEventListener("message", ({ data }) => { 13 | onMessageInput(data, postMessage); 14 | }); 15 | -------------------------------------------------------------------------------- /examples/vite/threejs/hex-shell/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "verbatimModuleSyntax": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | 16 | /* Linting */ 17 | "strict": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "erasableSyntaxOnly": true, 21 | "noFallthroughCasesInSwitch": true, 22 | "noUncheckedSideEffectImports": true 23 | }, 24 | "include": ["src"] 25 | } 26 | -------------------------------------------------------------------------------- /examples/vite/threejs/starter-template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Bitbybit & ThreeJS All Kernels Example 8 | 9 | 10 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/vite/threejs/starter-template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-typescript-starter", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "@bitbybit-dev/threejs": "0.20.4" 13 | }, 14 | "devDependencies": { 15 | "typescript": "~5.8.3", 16 | "vite": "^6.3.2", 17 | "@types/three": "0.176.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/vite/threejs/starter-template/src/models/current.ts: -------------------------------------------------------------------------------- 1 | import { DirectionalLight, Group, Mesh } from "three"; 2 | import { GUI } from "lil-gui"; 3 | 4 | export type Current = { 5 | group1: Group | undefined; 6 | group2: Group | undefined; 7 | dimensions: Group | undefined; 8 | light1: DirectionalLight | undefined; 9 | ground: Mesh | undefined; 10 | gui: GUI | undefined; 11 | }; 12 | -------------------------------------------------------------------------------- /examples/vite/threejs/starter-template/src/models/model.ts: -------------------------------------------------------------------------------- 1 | export type Model = { 2 | uHex: number; 3 | vHex: number; 4 | height: number; 5 | ellipse1MinRad: number; 6 | ellipse1MaxRad: number; 7 | ellipse2MinRad: number; 8 | ellipse2MaxRad: number; 9 | ellipse2RotX: number; 10 | ellipse2RotY: number; 11 | ellipse3MinRad: number; 12 | ellipse3MaxRad: number; 13 | ellipse3YRot: number; 14 | drawEdges: boolean; 15 | drawFaces: boolean; 16 | color1: string; 17 | color2: string; 18 | finalPrecision: number; 19 | rotationEnabled: boolean; 20 | downloadSTL?: () => void; 21 | downloadStep?: () => void; 22 | downloadGLB?: () => void; 23 | update?: () => void; 24 | }; 25 | -------------------------------------------------------------------------------- /examples/vite/threejs/starter-template/src/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0px; 3 | overflow: hidden; 4 | } 5 | 6 | a.logo { 7 | position: absolute; 8 | color: white; 9 | vertical-align: middle; 10 | bottom: 10px; 11 | left: 10px; 12 | font-family: 'Courier New', Courier, monospace; 13 | text-decoration: none; 14 | width: 100%; 15 | } 16 | 17 | .logo { 18 | margin-bottom: 20px; 19 | text-align: center; 20 | } 21 | 22 | .logo img { 23 | width: 50px; 24 | height: 50px; 25 | } 26 | -------------------------------------------------------------------------------- /examples/vite/threejs/starter-template/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /examples/vite/threejs/starter-template/src/workers/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from "@bitbybit-dev/jscad-worker"; 5 | 6 | import("@bitbybit-dev/jscad/jscad-generated").then((s) => { 7 | initializationComplete(s.default()); 8 | }); 9 | 10 | addEventListener("message", ({ data }) => { 11 | onMessageInput(data, postMessage); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/vite/threejs/starter-template/src/workers/manifold.worker.ts: -------------------------------------------------------------------------------- 1 | import { 2 | initializationComplete, 3 | onMessageInput, 4 | } from "@bitbybit-dev/manifold-worker"; 5 | import Module from "manifold-3d"; 6 | 7 | const init = async () => { 8 | const wasm = await Module({ 9 | locateFile: () => { 10 | return "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.3/wasm/manifold.cc2ddd38.wasm"; 11 | }, 12 | }); 13 | wasm.setup(); 14 | initializationComplete(wasm); 15 | }; 16 | 17 | init(); 18 | 19 | addEventListener("message", ({ data }) => { 20 | onMessageInput(data, postMessage); 21 | }); 22 | -------------------------------------------------------------------------------- /examples/vite/threejs/starter-template/src/workers/occt.worker.ts: -------------------------------------------------------------------------------- 1 | import initOpenCascade from "@bitbybit-dev/occt/bitbybit-dev-occt/cdn"; 2 | import type { OpenCascadeInstance } from "@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js"; 3 | import { 4 | initializationComplete, 5 | onMessageInput, 6 | } from "@bitbybit-dev/occt-worker"; 7 | 8 | initOpenCascade().then((occ: OpenCascadeInstance) => { 9 | initializationComplete(occ, undefined); 10 | }); 11 | 12 | addEventListener("message", ({ data }) => { 13 | onMessageInput(data, postMessage); 14 | }); 15 | -------------------------------------------------------------------------------- /examples/vite/threejs/starter-template/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "verbatimModuleSyntax": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | 16 | /* Linting */ 17 | "strict": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "erasableSyntaxOnly": true, 21 | "noFallthroughCasesInSwitch": true, 22 | "noUncheckedSideEffectImports": true 23 | }, 24 | "include": ["src"] 25 | } 26 | -------------------------------------------------------------------------------- /examples/webpack/threejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "threejs", 3 | "version": "1.0.0", 4 | "description": "", 5 | "private": true, 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "build": "webpack", 9 | "start": "webpack serve" 10 | }, 11 | "keywords": [], 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "@bitbybit-dev/threejs": "0.20.4", 16 | "lil-gui": "0.20.0" 17 | }, 18 | "devDependencies": { 19 | "@types/three": "0.176.0", 20 | "copy-webpack-plugin": "12.0.2", 21 | "file-loader": "6.2.0", 22 | "html-webpack-plugin": "5.6.3", 23 | "ts-loader": "^9.5.1", 24 | "typescript": "^5.6.3", 25 | "webpack": "^5.96.1", 26 | "webpack-cli": "^5.1.4", 27 | "webpack-dev-server": "^5.1.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/webpack/threejs/src/index.ts: -------------------------------------------------------------------------------- 1 | function component() { 2 | const element = document.createElement('div'); 3 | element.innerHTML = 'Hello WORLD Matas'; 4 | return element; 5 | } 6 | 7 | document.body.appendChild(component()); -------------------------------------------------------------------------------- /examples/webpack/threejs/src/jscad.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /*eslint no-restricted-globals: 0*/ 3 | 4 | import { initializationComplete, onMessageInput } from "@bitbybit-dev/jscad-worker"; 5 | 6 | import("@bitbybit-dev/jscad/jscad-generated") 7 | .then((s) => { 8 | initializationComplete(s.default()); 9 | }); 10 | 11 | addEventListener('message', ({ data }) => { 12 | onMessageInput(data, postMessage); 13 | }); 14 | -------------------------------------------------------------------------------- /examples/webpack/threejs/src/manifold.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { initializationComplete, onMessageInput } from "@bitbybit-dev/manifold-worker"; 4 | import Module from "manifold-3d"; 5 | 6 | const init = async () => { 7 | const wasm = await Module({ 8 | locateFile: () => { 9 | return "static/js/manifold-3-0-0.wasm"; 10 | }, 11 | }); 12 | wasm.setup(); 13 | initializationComplete(wasm); 14 | }; 15 | 16 | init(); 17 | 18 | addEventListener("message", ({ data }) => { 19 | onMessageInput(data, postMessage); 20 | }); 21 | -------------------------------------------------------------------------------- /examples/webpack/threejs/src/occ.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /*eslint no-restricted-globals: 0*/ 3 | import initOpenCascade from "@bitbybit-dev/occt/bitbybit-dev-occt/cdn"; 4 | import { OpenCascadeInstance } from "@bitbybit-dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.js"; 5 | import { initializationComplete, onMessageInput } from "@bitbybit-dev/occt-worker"; 6 | 7 | initOpenCascade().then((occ: OpenCascadeInstance) => { 8 | initializationComplete(occ, undefined); 9 | }); 10 | 11 | addEventListener('message', ({ data }) => { 12 | onMessageInput(data, postMessage); 13 | }); 14 | -------------------------------------------------------------------------------- /examples/webpack/threejs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./dist/", 4 | "sourceMap": true, 5 | "noImplicitAny": true, 6 | "module": "esnext", 7 | "target": "es5", 8 | "jsx": "react", 9 | "allowJs": true, 10 | "moduleResolution": "node" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bitbybit", 3 | "version": "0.19.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "bitbybit", 9 | "version": "0.19.0", 10 | "license": "MIT", 11 | "devDependencies": { 12 | "typescript": "^4.3.5" 13 | } 14 | }, 15 | "node_modules/typescript": { 16 | "version": "4.9.5", 17 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", 18 | "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", 19 | "dev": true, 20 | "bin": { 21 | "tsc": "bin/tsc", 22 | "tsserver": "bin/tsserver" 23 | }, 24 | "engines": { 25 | "node": ">=4.2.0" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/.gitignore: -------------------------------------------------------------------------------- 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/babel.config.cjs: -------------------------------------------------------------------------------- 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 | }; 14 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of bitbybit-core 3 | */ 4 | 5 | export * from "./lib"; -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/camera/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./arc-rotate-camera"; 2 | export * from "./camera"; 3 | export * from "./free-camera"; 4 | export * from "./target-camera"; 5 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/engine.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Context } from "../../context"; 3 | import * as BABYLON from "@babylonjs/core"; 4 | 5 | export class BabylonEngine { 6 | 7 | constructor(private readonly context: Context) { } 8 | 9 | /** 10 | * Gets the engine for the current context 11 | * @ignore true 12 | * @group engine 13 | * @shortname get engine 14 | */ 15 | getEngine(): BABYLON.Engine | BABYLON.WebGPUEngine { 16 | return this.context.engine; 17 | } 18 | 19 | /** 20 | * Gets the rendering canvas on which scene cameras can be attached 21 | * @ignore true 22 | * @group engine 23 | * @shortname get rendering canvas 24 | */ 25 | getRenderingCanvas(): HTMLCanvasElement { 26 | return this.context.engine.getRenderingCanvas(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/gizmo/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./gizmo"; -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/gui/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./gui"; 2 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./camera"; 2 | export * from "./material"; 3 | export * from "./web-xr"; 4 | export * from "./babylon"; 5 | export * from "./io"; 6 | export * from "./mesh"; 7 | export * from "./node"; 8 | export * from "./pick"; 9 | export * from "./ray"; 10 | export * from "./scene"; 11 | export * from "./engine"; 12 | export * from "./transforms"; 13 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/lights/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./lights"; 2 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/lights/lights.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Context } from "../../../context"; 3 | import { BabylonShadowLight } from "./shadow-light"; 4 | 5 | export class BabylonLights { 6 | shadowLight: BabylonShadowLight; 7 | constructor(private readonly context: Context) { 8 | this.shadowLight = new BabylonShadowLight(context); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/material/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./material"; 2 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/material/material.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Context } from "../../../context"; 3 | import { Color } from "@bitbybit-dev/base"; 4 | import { BabylonMaterialPbrMetallicRoughness } from "./pbr-metallic-roughness"; 5 | import { BabylonMaterialSky } from "./sky-material"; 6 | 7 | export class BabylonMaterial { 8 | 9 | pbrMetallicRoughness: BabylonMaterialPbrMetallicRoughness; 10 | skyMaterial: BabylonMaterialSky; 11 | 12 | constructor(private readonly context: Context, private readonly color: Color) { 13 | this.pbrMetallicRoughness = new BabylonMaterialPbrMetallicRoughness(context, color); 14 | this.skyMaterial = new BabylonMaterialSky(context); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/web-xr/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./web-xr"; 2 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/babylon/web-xr/web-xr.ts: -------------------------------------------------------------------------------- 1 | import { Context } from "../../../context"; 2 | // import { BabylonWebXRBase } from "./base"; 3 | import { BabylonWebXRSimple } from "./simple"; 4 | 5 | export class BabylonWebXR { 6 | 7 | simple: BabylonWebXRSimple; 8 | // base: BabylonWebXRBase; 9 | 10 | constructor( 11 | private readonly context: Context, 12 | ) { 13 | this.simple = new BabylonWebXRSimple(context); 14 | // this.base = new BabylonWebXRBase(context); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/bitbybit/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./babylon"; 2 | export * from "./draw"; -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./bitbybit"; 2 | export * from "./context"; 3 | export * from "./draw-helper"; 4 | export * from "./bitbybit-base"; 5 | export * as Inputs from "./inputs"; 6 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/inputs/babylon-gaussian-splatting-inputs.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-namespace */ 2 | import * as BABYLON from "@babylonjs/core"; 3 | 4 | export namespace BabylonGaussianSplatting { 5 | 6 | 7 | export class CreateGaussianSplattingMeshDto { 8 | constructor(url?: string) { 9 | if (url !== undefined) { this.url = url; } 10 | } 11 | /** 12 | * Babylon Mesh that needs to be updated 13 | * @default undefined 14 | */ 15 | url: string; 16 | } 17 | export class GaussianSplattingMeshDto { 18 | constructor(babylonMesh?: BABYLON.GaussianSplattingMesh) { 19 | if (babylonMesh !== undefined) { this.babylonMesh = babylonMesh; } 20 | } 21 | /** 22 | * Gaussian Splatting Mesh that needs to be updated 23 | */ 24 | babylonMesh: BABYLON.GaussianSplattingMesh; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/inputs/babylon-pick-inputs.ts: -------------------------------------------------------------------------------- 1 | import * as BABYLON from "@babylonjs/core"; 2 | 3 | /* eslint-disable @typescript-eslint/no-namespace */ 4 | 5 | export namespace BabylonPick { 6 | export class RayDto { 7 | constructor(ray?: BABYLON.Ray) { 8 | if (ray !== undefined) { this.ray = ray; } 9 | } 10 | /** 11 | * Ray 12 | */ 13 | ray: BABYLON.Ray; 14 | } 15 | export class PickInfo { 16 | constructor(pickInfo?: BABYLON.PickingInfo) { 17 | if (pickInfo !== undefined) { this.pickInfo = pickInfo; } 18 | } 19 | /** 20 | * Information about picking result 21 | */ 22 | pickInfo: BABYLON.PickingInfo; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/inputs/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./babylon-camera-inputs"; 2 | export * from "./babylon-io-inputs"; 3 | export * from "./babylon-material-inputs"; 4 | export * from "./babylon-light-inputs"; 5 | export * from "./babylon-gui-inputs"; 6 | export * from "./babylon-gaussian-splatting-inputs"; 7 | export * from "./babylon-transform-inputs"; 8 | export * from "./babylon-mesh-inputs"; 9 | export * from "./babylon-pick-inputs"; 10 | export * from "./babylon-ray-inputs"; 11 | export * from "./babylon-texture-inputs"; 12 | export * from "./babylon-tools-inputs"; 13 | export * from "./babylon-mesh-builder"; 14 | export * from "./babylon-gizmo-inputs"; 15 | export * from "./babylon-webxr"; 16 | export * from "./scene-inputs"; 17 | export * from "./node-inputs"; 18 | export * from "./draw-inputs"; 19 | export * from "./base-inputs"; 20 | export * from "@bitbybit-dev/core/lib/api/inputs/inputs"; -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/inputs/inputs.ts: -------------------------------------------------------------------------------- 1 | export * from "./babylon-camera-inputs"; 2 | export * from "./babylon-io-inputs"; 3 | export * from "./babylon-material-inputs"; 4 | export * from "./babylon-light-inputs"; 5 | export * from "./babylon-gui-inputs"; 6 | export * from "./babylon-gaussian-splatting-inputs"; 7 | export * from "./babylon-mesh-inputs"; 8 | export * from "./babylon-transform-inputs"; 9 | export * from "./babylon-pick-inputs"; 10 | export * from "./babylon-ray-inputs"; 11 | export * from "./babylon-texture-inputs"; 12 | export * from "./babylon-tools-inputs"; 13 | export * from "./babylon-mesh-builder"; 14 | export * from "./babylon-gizmo-inputs"; 15 | export * from "./babylon-webxr"; 16 | export * from "./scene-inputs"; 17 | export * from "./node-inputs"; 18 | export * from "./draw-inputs"; 19 | export * from "@bitbybit-dev/core/lib/api/inputs/inputs"; 20 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/api/models/index.ts: -------------------------------------------------------------------------------- 1 | 2 | export * from "@bitbybit-dev/core/lib/api/models"; -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/gui-enriched-babylon.ts: -------------------------------------------------------------------------------- 1 | import { Texture, Color3, AbstractMesh } from "@babylonjs/core"; 2 | import * as GUI from "@babylonjs/gui"; 3 | 4 | export { GUI, Texture, Color3, AbstractMesh }; 5 | // this is quite weird, but incorporating GUI into BABYLON namespace is necessary for good type definitions on the front side, will need to find better solutons later... 6 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api"; 2 | export * from "./models"; -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./print-save.model"; 2 | export * from "./tag.interface"; 3 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/models/print-save.model.ts: -------------------------------------------------------------------------------- 1 | export interface PrintSaveInterface { 2 | text: string; 3 | isJson: boolean; 4 | hidden: boolean; 5 | } 6 | -------------------------------------------------------------------------------- /packages/dev/babylonjs/lib/models/tag.interface.ts: -------------------------------------------------------------------------------- 1 | export interface TagInterface { 2 | text: string; 3 | position: {x: number, y: number, z: number}; 4 | colour: string; 5 | size: number; 6 | adaptDepth: boolean; 7 | needsUpdate: boolean; 8 | id: string; 9 | } -------------------------------------------------------------------------------- /packages/dev/base/.gitignore: -------------------------------------------------------------------------------- 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/base/babel.config.cjs: -------------------------------------------------------------------------------- 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 | }; 14 | -------------------------------------------------------------------------------- /packages/dev/base/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of bitbybit-core 3 | */ 4 | 5 | export * from "./lib"; -------------------------------------------------------------------------------- /packages/dev/base/lib/api/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./services"; 2 | -------------------------------------------------------------------------------- /packages/dev/base/lib/api/inputs/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./color-inputs"; 2 | export * from "./lists-inputs"; 3 | export * from "./logic-inputs"; 4 | export * from "./math-inputs"; 5 | export * from "./point-inputs"; 6 | export * from "./text-inputs"; 7 | export * from "./vector-inputs"; 8 | export * from "./transforms-inputs"; 9 | export * from "./base-inputs"; 10 | export * from "./dates-inputs"; 11 | export * from "./line-inputs"; 12 | export * from "./polyline-inputs"; 13 | export * from "./mesh-inputs"; 14 | -------------------------------------------------------------------------------- /packages/dev/base/lib/api/inputs/inputs.ts: -------------------------------------------------------------------------------- 1 | export * from "./color-inputs"; 2 | export * from "./lists-inputs"; 3 | export * from "./logic-inputs"; 4 | export * from "./math-inputs"; 5 | export * from "./point-inputs"; 6 | export * from "./text-inputs"; 7 | export * from "./text-inputs"; 8 | export * from "./vector-inputs"; 9 | export * from "./transforms-inputs"; 10 | export * from "./dates-inputs"; 11 | export * from "./line-inputs"; 12 | export * from "./polyline-inputs"; 13 | export * from "./mesh-inputs"; 14 | 15 | -------------------------------------------------------------------------------- /packages/dev/base/lib/api/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./text"; 2 | export * from "./point"; -------------------------------------------------------------------------------- /packages/dev/base/lib/api/models/point/bucket.ts: -------------------------------------------------------------------------------- 1 | export * from "./hex-grid-data"; 2 | -------------------------------------------------------------------------------- /packages/dev/base/lib/api/models/point/hex-grid-data.ts: -------------------------------------------------------------------------------- 1 | import { Base } from "../../inputs/base-inputs"; 2 | 3 | export class HexGridData { 4 | centers: Base.Point3[]; 5 | hexagons: Base.Point3[][]; 6 | shortestDistEdge: number; 7 | longestDistEdge: number; 8 | maxFilletRadius: number; 9 | } -------------------------------------------------------------------------------- /packages/dev/base/lib/api/models/point/index.ts: -------------------------------------------------------------------------------- 1 | export * as Point from "./bucket"; 2 | -------------------------------------------------------------------------------- /packages/dev/base/lib/api/models/text/bucket.ts: -------------------------------------------------------------------------------- 1 | export * from "./vector-char-data"; 2 | export * from "./vector-text-data"; -------------------------------------------------------------------------------- /packages/dev/base/lib/api/models/text/index.ts: -------------------------------------------------------------------------------- 1 | export * as Text from "./bucket"; 2 | -------------------------------------------------------------------------------- /packages/dev/base/lib/api/models/text/vector-char-data.ts: -------------------------------------------------------------------------------- 1 | import { Base } from "../../inputs/base-inputs"; 2 | 3 | export class VectorCharData { 4 | constructor(width?: number, height?: number, paths?: Base.Point3[][]) { 5 | if (width !== undefined) { this.width = width; } 6 | if (height !== undefined) { this.height = height; } 7 | if (paths !== undefined) { this.paths = paths; } 8 | } 9 | /** 10 | * The width of the char 11 | * @default undefined 12 | */ 13 | width?: number; 14 | /** 15 | * The height of the char 16 | * @default undefined 17 | */ 18 | height?: number; 19 | /** 20 | * The segments of the char 21 | * @default undefined 22 | */ 23 | paths?: Base.Point3[][]; 24 | } -------------------------------------------------------------------------------- /packages/dev/base/lib/api/models/text/vector-text-data.ts: -------------------------------------------------------------------------------- 1 | 2 | import { VectorCharData } from "./vector-char-data"; 3 | 4 | export class VectorTextData { 5 | constructor(width?: number, height?: number, chars?: VectorCharData[]) { 6 | if (width !== undefined) { this.width = width; } 7 | if (height !== undefined) { this.height = height; } 8 | if (chars !== undefined) { this.chars = chars; } 9 | } 10 | /** 11 | * The width of the char 12 | * @default undefined 13 | */ 14 | width?: number; 15 | /** 16 | * The height of the char 17 | * @default undefined 18 | */ 19 | height?: number; 20 | /** 21 | * The segments of the char 22 | * @default undefined 23 | */ 24 | chars?: VectorCharData[]; 25 | } -------------------------------------------------------------------------------- /packages/dev/base/lib/api/services/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./color"; 2 | export * from "./lists"; 3 | export * from "./logic"; 4 | export * from "./math"; 5 | export * from "./point"; 6 | export * from "./text"; 7 | export * from "./dates"; 8 | export * from "./vector"; 9 | export * from "./transforms"; 10 | export * from "./geometry-helper"; 11 | export * from "./line"; 12 | export * from "./polyline"; 13 | export * from "./mesh"; -------------------------------------------------------------------------------- /packages/dev/base/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api"; 2 | 3 | -------------------------------------------------------------------------------- /packages/dev/base/tsconfig.bitbybit.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "exclude": [ 5 | "./**/*.test.ts" 6 | ], 7 | "compilerOptions": { 8 | "outDir": "./dist", 9 | "baseUrl": "./", 10 | "sourceMap": false, 11 | "declaration": true, 12 | "downlevelIteration": true, 13 | "experimentalDecorators": true, 14 | "moduleResolution": "node", 15 | "skipLibCheck": true, 16 | "target": "es2015", 17 | "module": "es2020", 18 | "allowJs": true, 19 | "emitDeclarationOnly": false, 20 | "paths": {}, 21 | "lib": [ 22 | "es2020", 23 | "dom" 24 | ], 25 | } 26 | } -------------------------------------------------------------------------------- /packages/dev/base/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "outDir": "./dist/bitbybit-dev", 6 | "baseUrl": "./", 7 | "sourceMap": false, 8 | "declaration": true, 9 | "downlevelIteration": true, 10 | "experimentalDecorators": true, 11 | "moduleResolution": "node", 12 | "skipLibCheck": true, 13 | "target": "es2015", 14 | "module": "es2020", 15 | "strict": false, 16 | "allowJs": true, 17 | "emitDeclarationOnly": false, 18 | "paths": {}, 19 | "lib": [ 20 | "es2020", 21 | "dom" 22 | ], 23 | } 24 | } -------------------------------------------------------------------------------- /packages/dev/core/.gitignore: -------------------------------------------------------------------------------- 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/core/babel.config.cjs: -------------------------------------------------------------------------------- 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 | }; 14 | -------------------------------------------------------------------------------- /packages/dev/core/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of bitbybit-core 3 | */ 4 | 5 | export * from "./lib"; -------------------------------------------------------------------------------- /packages/dev/core/lib/api/bitbybit/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./occt"; 2 | export * from "./verb"; 3 | export * from "./asset"; 4 | export * from "./base-types"; 5 | export * from "./json"; 6 | export * from "./tag"; 7 | export * from "./time"; -------------------------------------------------------------------------------- /packages/dev/core/lib/api/bitbybit/occt/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./io"; 2 | export * from "./occt"; 3 | -------------------------------------------------------------------------------- /packages/dev/core/lib/api/bitbybit/occt/occt.ts: -------------------------------------------------------------------------------- 1 | 2 | import { ContextBase } from "../../context"; 3 | // import { DrawHelper } from "../../draw-helper"; 4 | import { OCCTWIO } from "./io"; 5 | import { OCCTWorkerManager, OCCT } from "@bitbybit-dev/occt-worker"; 6 | 7 | /** 8 | * Contains various methods for OpenCascade implementation 9 | */ 10 | export class OCCTW extends OCCT { 11 | override readonly io: OCCTWIO; 12 | 13 | constructor( 14 | readonly context: ContextBase, 15 | override readonly occWorkerManager: OCCTWorkerManager, 16 | // readonly drawHelper: DrawHelper, 17 | ) { 18 | super(occWorkerManager); 19 | this.io = new OCCTWIO(occWorkerManager, context); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /packages/dev/core/lib/api/bitbybit/time.ts: -------------------------------------------------------------------------------- 1 | 2 | import { ContextBase } from "../context"; 3 | 4 | /** 5 | * Time functions help to create various interactions which happen in time 6 | */ 7 | 8 | export class Time { 9 | 10 | private context: ContextBase; 11 | constructor(context: ContextBase) { 12 | this.context = context; 13 | } 14 | 15 | /** 16 | * Registers a function to render loop 17 | * @param update The function to call in render loop 18 | */ 19 | registerRenderFunction(update: (timePassedMs: number) => void): void { 20 | this.context.renderLoopBag.push((timePassedMs) => { 21 | update(timePassedMs); 22 | }); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /packages/dev/core/lib/api/bitbybit/verb/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./curve-circle"; 2 | export * from "./curve-ellipse"; 3 | export * from "./curve"; 4 | export * from "./intersect"; 5 | export * from "./surface-conical"; 6 | export * from "./surface-cylindrical"; 7 | export * from "./surface-extrusion"; 8 | export * from "./surface-revolved"; 9 | export * from "./surface-spherical"; 10 | export * from "./surface-sweep"; 11 | export * from "./surface"; 12 | export * from "./verb"; 13 | 14 | 15 | -------------------------------------------------------------------------------- /packages/dev/core/lib/api/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./bitbybit"; 2 | export * from "./context"; 3 | export * from "./draw-core"; 4 | export * from "./draw-helper-core"; 5 | export * as Inputs from "./inputs"; 6 | -------------------------------------------------------------------------------- /packages/dev/core/lib/api/inputs/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./asset-inputs"; 2 | export * from "./json-inputs"; 3 | export * from "./tag-inputs"; 4 | export * from "./time-inputs"; 5 | export * from "./verb-inputs"; 6 | export * from "./base-inputs"; 7 | export * from "@bitbybit-dev/jscad/lib/api/inputs/jscad-inputs"; 8 | export * from "@bitbybit-dev/manifold/lib/api/inputs/manifold-inputs"; 9 | export * from "@bitbybit-dev/occt/lib/api/inputs/occ-inputs"; 10 | export * from "@bitbybit-dev/base/lib/api/inputs/inputs"; 11 | -------------------------------------------------------------------------------- /packages/dev/core/lib/api/inputs/inputs.ts: -------------------------------------------------------------------------------- 1 | export * from "./asset-inputs"; 2 | export * from "./json-inputs"; 3 | export * from "./tag-inputs"; 4 | export * from "./time-inputs"; 5 | export * from "./verb-inputs"; 6 | export * from "@bitbybit-dev/jscad/lib/api/inputs/jscad-inputs"; 7 | export * from "@bitbybit-dev/manifold/lib/api/inputs/manifold-inputs"; 8 | export * from "@bitbybit-dev/occt/lib/api/inputs/occ-inputs"; 9 | export * from "@bitbybit-dev/base/lib/api/inputs/inputs"; 10 | -------------------------------------------------------------------------------- /packages/dev/core/lib/api/inputs/time-inputs.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-namespace */ 2 | 3 | export namespace Time { 4 | export class PostFromIframe { 5 | constructor(data?: any, targetOrigin?: string) { 6 | if (data !== undefined) { this.data = data; } 7 | if (targetOrigin !== undefined) { this.targetOrigin = targetOrigin; } 8 | } 9 | /** 10 | * The data object to post 11 | */ 12 | data: any; 13 | /** 14 | * Thir party iframe origin url to which data should be posted 15 | */ 16 | targetOrigin: string; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/dev/core/lib/api/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from "@bitbybit-dev/occt/lib/api/models"; 2 | -------------------------------------------------------------------------------- /packages/dev/core/lib/asset-manager.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a manager of assets. 3 | */ 4 | 5 | export class AssetManager { 6 | getAsset: (fileName: string) => Promise; 7 | getLocalAsset: (fileName: string) => Promise; 8 | fetch: (url: string) => Promise; 9 | } 10 | -------------------------------------------------------------------------------- /packages/dev/core/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api"; 2 | export * from "./models"; -------------------------------------------------------------------------------- /packages/dev/core/lib/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./print-save.model"; 2 | export * from "./tag.interface"; 3 | -------------------------------------------------------------------------------- /packages/dev/core/lib/models/print-save.model.ts: -------------------------------------------------------------------------------- 1 | export interface PrintSaveInterface { 2 | text: string; 3 | isJson: boolean; 4 | hidden: boolean; 5 | } 6 | -------------------------------------------------------------------------------- /packages/dev/core/lib/models/tag.interface.ts: -------------------------------------------------------------------------------- 1 | export interface TagInterface { 2 | text: string; 3 | position: {x: number, y: number, z: number}; 4 | colour: string; 5 | size: number; 6 | adaptDepth: boolean; 7 | needsUpdate: boolean; 8 | id: string; 9 | } -------------------------------------------------------------------------------- /packages/dev/core/mvdocpictures.js: -------------------------------------------------------------------------------- 1 | const mvdir = require('mvdir'); 2 | 3 | mvdir('blockly-images-zelos/', 'ts-api-docs/assets/images/blockly-images/', { copy: true }).then(err => { 4 | if (!err) console.log('done.'); 5 | }); -------------------------------------------------------------------------------- /packages/dev/jscad-worker/.gitignore: -------------------------------------------------------------------------------- 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/jscad-worker/babel.config.cjs: -------------------------------------------------------------------------------- 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 | }; 14 | -------------------------------------------------------------------------------- /packages/dev/jscad-worker/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of bitbybit-core 3 | */ 4 | 5 | export * from "./lib"; -------------------------------------------------------------------------------- /packages/dev/jscad-worker/lib/api/bitbybit-jscad.ts: -------------------------------------------------------------------------------- 1 | import { JSCAD } from "./jscad"; 2 | import { JSCADWorkerManager } from "../jscad-worker/jscad-worker-manager"; 3 | 4 | /** 5 | * This should be used only if you want to use only JSCAD worker without other of the bitbybit packages 6 | */ 7 | export class BitByBitJSCAD { 8 | 9 | public jscadWorkerManager: JSCADWorkerManager; 10 | public jscad: JSCAD; 11 | 12 | constructor( 13 | ) { 14 | this.jscadWorkerManager = new JSCADWorkerManager(); 15 | this.jscad = new JSCAD(this.jscadWorkerManager); 16 | } 17 | 18 | init(jscad: Worker) { 19 | if (jscad) { 20 | this.jscadWorkerManager.setJscadWorker(jscad); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/dev/jscad-worker/lib/api/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./jscad"; 2 | export * from "./text"; 3 | export * from "./bitbybit-jscad"; -------------------------------------------------------------------------------- /packages/dev/jscad-worker/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api"; 2 | export * from "./jscad-worker"; -------------------------------------------------------------------------------- /packages/dev/jscad-worker/lib/jscad-worker/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./cache-helper"; 2 | export * from "./jscad-info"; 3 | export * from "./jscad-state.enum"; 4 | export * from "./jscad-worker-manager"; 5 | export * from "./jscad-worker"; 6 | -------------------------------------------------------------------------------- /packages/dev/jscad-worker/lib/jscad-worker/jscad-info.ts: -------------------------------------------------------------------------------- 1 | import { JscadStateEnum } from "./jscad-state.enum"; 2 | 3 | export class JscadInfo { 4 | state: JscadStateEnum; 5 | } 6 | -------------------------------------------------------------------------------- /packages/dev/jscad-worker/lib/jscad-worker/jscad-state.enum.ts: -------------------------------------------------------------------------------- 1 | export enum JscadStateEnum { 2 | loading, 3 | loaded, 4 | initialised, 5 | computing, 6 | } 7 | -------------------------------------------------------------------------------- /packages/dev/jscad-worker/lib/jscad-worker/jscad-types.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/packages/dev/jscad-worker/lib/jscad-worker/jscad-types.ts -------------------------------------------------------------------------------- /packages/dev/jscad-worker/lib/jscad-worker/jscad-worker-mock.ts: -------------------------------------------------------------------------------- 1 | import { initializationComplete, onMessageInput } from "./jscad-worker"; 2 | 3 | export class JSCADWorkerMock { 4 | initializationComplete = (jscad, plugins: any, doNotPost?: boolean) => { initializationComplete(jscad, plugins, doNotPost); }; 5 | onMessageInput = (inputs) => { 6 | onMessageInput(inputs, (res) => { 7 | if (this.onmessage) { 8 | this.onmessage({ data: res }); 9 | } else { 10 | console.log("No onmessage function defined"); 11 | } 12 | }); 13 | }; 14 | 15 | postMessage(data) { 16 | if (data !== "busy") { 17 | this.onMessageInput(data); 18 | } 19 | } 20 | 21 | onmessage: (data) => void; 22 | } -------------------------------------------------------------------------------- /packages/dev/jscad/.gitignore: -------------------------------------------------------------------------------- 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/jscad/babel.config.cjs: -------------------------------------------------------------------------------- 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 | }; 14 | -------------------------------------------------------------------------------- /packages/dev/jscad/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of bitbybit-core 3 | */ 4 | 5 | export * from "./lib"; -------------------------------------------------------------------------------- /packages/dev/jscad/lib/api/inputs/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./jscad-inputs"; 2 | export * from "@bitbybit-dev/base/lib/api/inputs"; -------------------------------------------------------------------------------- /packages/dev/jscad/lib/api/inputs/inputs.ts: -------------------------------------------------------------------------------- 1 | export * from "./jscad-inputs"; 2 | export * from "./base-inputs"; -------------------------------------------------------------------------------- /packages/dev/jscad/lib/api/jscad-service.test.ts: -------------------------------------------------------------------------------- 1 | import { Jscad } from "./jscad-service"; 2 | 3 | describe("Jscad unit tests", () => { 4 | let jscad: Jscad; 5 | beforeAll(async () => { 6 | const s = await import("../../jscad-generated"); 7 | jscad = new Jscad(s.default()); 8 | }); 9 | 10 | it("should create jscad instance", () => { 11 | expect(jscad).toBeDefined(); 12 | }); 13 | 14 | it("should create booleans service", () => { 15 | expect(jscad.booleans).toBeDefined(); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/dev/jscad/lib/api/services/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./jscad-booleans"; 2 | export * from "./jscad-expansions"; 3 | export * from "./jscad-extrusions"; 4 | export * from "./jscad-hulls"; 5 | export * from "./jscad-path"; 6 | export * from "./jscad-polygon"; 7 | export * from "./jscad-shapes"; 8 | export * from "./jscad-text"; 9 | -------------------------------------------------------------------------------- /packages/dev/jscad/lib/api/services/jscad-colors.ts: -------------------------------------------------------------------------------- 1 | import * as Inputs from "../inputs/jscad-inputs"; 2 | import * as JSCAD from "@jscad/modeling"; 3 | 4 | /** 5 | * Contains various functions for colors from JSCAD library https://github.com/jscad/OpenJSCAD.org 6 | * Thanks JSCAD community for developing this kernel 7 | */ 8 | export class JSCADColors { 9 | 10 | constructor(private readonly jscad: typeof JSCAD) { } 11 | 12 | 13 | colorize(inputs: Inputs.JSCAD.ColorizeDto): Inputs.JSCAD.JSCADEntity | Inputs.JSCAD.JSCADEntity[] { 14 | const geometry = inputs.geometry; 15 | const color = inputs.color; 16 | return this.jscad.colors.colorize(this.jscad.colors.hexToRgb(color), geometry); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /packages/dev/jscad/lib/api/services/jscad-hulls.ts: -------------------------------------------------------------------------------- 1 | import * as Inputs from "../inputs/jscad-inputs"; 2 | import * as JSCAD from "@jscad/modeling"; 3 | 4 | /** 5 | * Contains various functions for Solid hulls from JSCAD library https://github.com/jscad/OpenJSCAD.org 6 | * Thanks JSCAD community for developing this kernel 7 | */ 8 | export class JSCADHulls { 9 | 10 | constructor( 11 | private readonly jscad: typeof JSCAD, 12 | ) { } 13 | 14 | hullChain(inputs: Inputs.JSCAD.HullDto): Inputs.JSCAD.JSCADEntity { 15 | return this.jscad.hulls.hullChain(...inputs.meshes); 16 | } 17 | 18 | hull(inputs: Inputs.JSCAD.HullDto): Inputs.JSCAD.JSCADEntity { 19 | return this.jscad.hulls.hull(...inputs.meshes); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/dev/jscad/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api/inputs"; 2 | export * from "./api/jscad-service"; 3 | -------------------------------------------------------------------------------- /packages/dev/jscad/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "outDir": "./dist/bitbybit-dev", 6 | "baseUrl": "./", 7 | "sourceMap": false, 8 | "declaration": true, 9 | "downlevelIteration": true, 10 | "experimentalDecorators": true, 11 | "moduleResolution": "node", 12 | "skipLibCheck": true, 13 | "target": "es2015", 14 | "module": "es2020", 15 | "strict": false, 16 | "allowJs": true, 17 | "emitDeclarationOnly": false, 18 | "paths": { 19 | "@bitbybit-dev/base": [ 20 | "../base/dist" 21 | ], 22 | "@bitbybit-dev/base/*": [ 23 | "../base/dist/*" 24 | ], 25 | }, 26 | "lib": [ 27 | "es2020", 28 | "dom" 29 | ], 30 | } 31 | } -------------------------------------------------------------------------------- /packages/dev/manifold-worker/.gitignore: -------------------------------------------------------------------------------- 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/manifold-worker/babel.config.cjs: -------------------------------------------------------------------------------- 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 | }; 14 | -------------------------------------------------------------------------------- /packages/dev/manifold-worker/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of bitbybit-core 3 | */ 4 | 5 | export * from "./lib"; -------------------------------------------------------------------------------- /packages/dev/manifold-worker/lib/api/bitbybit-manifold.ts: -------------------------------------------------------------------------------- 1 | import { ManifoldBitByBit } from "./manifold-bitbybit"; 2 | import { ManifoldWorkerManager } from "../manifold-worker/manifold-worker-manager"; 3 | 4 | /** 5 | * This should be used only if you want to use only Manifold worker without other of the bitbybit packages 6 | */ 7 | export class BitByBitManifold { 8 | 9 | public manifoldWorkerManager: ManifoldWorkerManager; 10 | public manifold: ManifoldBitByBit; 11 | 12 | constructor( 13 | ) { 14 | this.manifoldWorkerManager = new ManifoldWorkerManager(); 15 | this.manifold = new ManifoldBitByBit(this.manifoldWorkerManager); 16 | } 17 | 18 | init(manifold: Worker) { 19 | if (manifold) { 20 | this.manifoldWorkerManager.setManifoldWorker(manifold); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/dev/manifold-worker/lib/api/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./manifold-bitbybit"; 2 | export * from "./bitbybit-manifold"; -------------------------------------------------------------------------------- /packages/dev/manifold-worker/lib/api/manifold/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./manifold"; 2 | export * from "./operations"; 3 | export * from "./shapes"; 4 | export * from "./transforms"; 5 | export * from "./booleans"; 6 | -------------------------------------------------------------------------------- /packages/dev/manifold-worker/lib/api/mesh/mesh.ts: -------------------------------------------------------------------------------- 1 | import { ManifoldWorkerManager } from "../../manifold-worker/manifold-worker-manager"; 2 | import { MeshOperations } from "./operations"; 3 | import { MeshEvaluate } from "./evaluate"; 4 | 5 | /** 6 | * Contains various functions for Solid meshes from Manifold library https://github.com/elalish/manifold 7 | * Thanks Manifold community for developing this kernel 8 | */ 9 | export class Mesh { 10 | 11 | public readonly operations: MeshOperations; 12 | public readonly evaluate: MeshEvaluate; 13 | constructor( 14 | private readonly manifoldWorkerManager: ManifoldWorkerManager, 15 | ) { 16 | this.operations = new MeshOperations(manifoldWorkerManager); 17 | this.evaluate = new MeshEvaluate(manifoldWorkerManager); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /packages/dev/manifold-worker/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api"; 2 | export * from "./manifold-worker"; -------------------------------------------------------------------------------- /packages/dev/manifold-worker/lib/manifold-worker/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./cache-helper"; 2 | export * from "./manifold-info"; 3 | export * from "./manifold-state.enum"; 4 | export * from "./manifold-worker-manager"; 5 | export * from "./manifold-worker"; 6 | -------------------------------------------------------------------------------- /packages/dev/manifold-worker/lib/manifold-worker/manifold-info.ts: -------------------------------------------------------------------------------- 1 | import { ManifoldStateEnum } from "./manifold-state.enum"; 2 | 3 | export class ManifoldInfo { 4 | state: ManifoldStateEnum; 5 | } 6 | -------------------------------------------------------------------------------- /packages/dev/manifold-worker/lib/manifold-worker/manifold-state.enum.ts: -------------------------------------------------------------------------------- 1 | export enum ManifoldStateEnum { 2 | loading, 3 | loaded, 4 | initialised, 5 | computing, 6 | } 7 | -------------------------------------------------------------------------------- /packages/dev/manifold-worker/lib/manifold-worker/manifold-worker-mock.ts: -------------------------------------------------------------------------------- 1 | import { initializationComplete, onMessageInput } from "./manifold-worker"; 2 | 3 | export class ManifoldWorkerMock { 4 | initializationComplete = (jscad, plugins: any, doNotPost?: boolean) => { initializationComplete(jscad, plugins, doNotPost); }; 5 | onMessageInput = (inputs) => { 6 | onMessageInput(inputs, (res) => { 7 | if (this.onmessage) { 8 | this.onmessage({ data: res }); 9 | } else { 10 | console.log("No onmessage function defined"); 11 | } 12 | }); 13 | }; 14 | 15 | postMessage(data) { 16 | if (data !== "busy") { 17 | this.onMessageInput(data); 18 | } 19 | } 20 | 21 | onmessage: (data) => void; 22 | } -------------------------------------------------------------------------------- /packages/dev/manifold-worker/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "outDir": "./dist/bitbybit-dev", 6 | "baseUrl": "./", 7 | "sourceMap": false, 8 | "declaration": true, 9 | "downlevelIteration": true, 10 | "experimentalDecorators": true, 11 | "moduleResolution": "node", 12 | "skipLibCheck": true, 13 | "target": "es2015", 14 | "module": "es2020", 15 | "strict": false, 16 | "allowJs": true, 17 | "emitDeclarationOnly": false, 18 | "paths": { 19 | "@bitbybit-dev/manifold": [ 20 | "../manifold/dist" 21 | ], 22 | "@bitbybit-dev/manifold/*": [ 23 | "../manifold/dist/*" 24 | ], 25 | }, 26 | "lib": [ 27 | "es2020", 28 | "dom" 29 | ], 30 | } 31 | } -------------------------------------------------------------------------------- /packages/dev/manifold/.gitignore: -------------------------------------------------------------------------------- 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/manifold/babel.config.cjs: -------------------------------------------------------------------------------- 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 | plugins: [ 14 | "babel-plugin-transform-import-meta" 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /packages/dev/manifold/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of bitbybit-core 3 | */ 4 | 5 | export * from "./lib"; -------------------------------------------------------------------------------- /packages/dev/manifold/lib/api/inputs/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./manifold-inputs"; 2 | export * from "./base-inputs"; -------------------------------------------------------------------------------- /packages/dev/manifold/lib/api/inputs/inputs.ts: -------------------------------------------------------------------------------- 1 | export * from "./manifold-inputs"; 2 | export * from "./base-inputs"; -------------------------------------------------------------------------------- /packages/dev/manifold/lib/api/manifold-service.test.ts: -------------------------------------------------------------------------------- 1 | // import Module from "manifold-3d"; 2 | import { ManifoldService } from "./manifold-service"; 3 | 4 | // TODO - if possible, configure to run manifold against actual Module (could be useful to find degradations in expectations), otherwise let's just use mocks 5 | describe("Manifold unit tests", () => { 6 | let manifold: ManifoldService; 7 | beforeAll(async () => { 8 | // const wasm = await Module(); 9 | // wasm.setup(); 10 | manifold = new ManifoldService({} as any); 11 | }); 12 | 13 | it("should create manifold instance", () => { 14 | expect(manifold).toBeDefined(); 15 | }); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /packages/dev/manifold/lib/api/services/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/packages/dev/manifold/lib/api/services/index.ts -------------------------------------------------------------------------------- /packages/dev/manifold/lib/api/services/mesh/mesh-operations.ts: -------------------------------------------------------------------------------- 1 | import * as Inputs from "../../inputs"; 2 | import * as Manifold3D from "manifold-3d"; 3 | 4 | export class MeshOperations { 5 | 6 | private manifold: Manifold3D.ManifoldToplevel; 7 | 8 | constructor(wasm: Manifold3D.ManifoldToplevel) { 9 | this.manifold = wasm; 10 | } 11 | 12 | merge(inputs: Inputs.Manifold.MeshDto): boolean { 13 | return inputs.mesh.merge(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/dev/manifold/lib/api/services/mesh/mesh.ts: -------------------------------------------------------------------------------- 1 | import * as Manifold3D from "manifold-3d"; 2 | import { MeshEvaluate } from "./mesh-evaluate"; 3 | import { MeshOperations } from "./mesh-operations"; 4 | 5 | // Worker make an instance of this class itself 6 | export class Mesh { 7 | 8 | plugins: any; 9 | 10 | public operations: MeshOperations; 11 | public evaluate: MeshEvaluate; 12 | 13 | constructor(wasm: Manifold3D.ManifoldToplevel) { 14 | this.operations = new MeshOperations(wasm); 15 | this.evaluate = new MeshEvaluate(wasm); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/dev/manifold/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api/inputs"; 2 | export * from "./api/manifold-service"; 3 | -------------------------------------------------------------------------------- /packages/dev/manifold/tsconfig.bitbybit.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "exclude": [ 5 | "./**/*.test.ts" 6 | ], 7 | "compilerOptions": { 8 | "outDir": "./dist", 9 | "baseUrl": "./", 10 | "sourceMap": false, 11 | "declaration": true, 12 | "downlevelIteration": true, 13 | "experimentalDecorators": true, 14 | "moduleResolution": "node", 15 | "skipLibCheck": true, 16 | "target": "es2015", 17 | "module": "es2020", 18 | "allowJs": true, 19 | "emitDeclarationOnly": false, 20 | "paths": {}, 21 | "lib": [ 22 | "es2020", 23 | "dom" 24 | ], 25 | } 26 | } -------------------------------------------------------------------------------- /packages/dev/manifold/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "outDir": "./dist/bitbybit-dev", 6 | "baseUrl": "./", 7 | "sourceMap": false, 8 | "declaration": true, 9 | "downlevelIteration": true, 10 | "experimentalDecorators": true, 11 | "moduleResolution": "node", 12 | "skipLibCheck": true, 13 | "target": "es2015", 14 | "module": "es2020", 15 | "strict": false, 16 | "allowJs": true, 17 | "emitDeclarationOnly": false, 18 | "paths": {}, 19 | "lib": [ 20 | "es2020", 21 | "dom" 22 | ], 23 | } 24 | } -------------------------------------------------------------------------------- /packages/dev/occt-worker/.gitignore: -------------------------------------------------------------------------------- 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 | ts-doc-theme 12 | coverage -------------------------------------------------------------------------------- /packages/dev/occt-worker/babel.config.cjs: -------------------------------------------------------------------------------- 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 | }; 14 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of bitbybit-core 3 | */ 4 | 5 | export * from "./lib"; 6 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/api/bitbybit-occt.ts: -------------------------------------------------------------------------------- 1 | import { OCCT } from "./occt/occt"; 2 | import { OCCTWorkerManager } from "../occ-worker/occ-worker-manager"; 3 | 4 | export class BitByBitOCCT { 5 | 6 | public occtWorkerManager: OCCTWorkerManager; 7 | public occt: OCCT; 8 | 9 | constructor( 10 | ) { 11 | this.occtWorkerManager = new OCCTWorkerManager(); 12 | this.occt = new OCCT(this.occtWorkerManager); 13 | } 14 | 15 | init(occt: Worker) { 16 | if (occt) { 17 | this.occtWorkerManager.setOccWorker(occt); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/api/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./occt"; 2 | export * from "./bitbybit-occt"; 3 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/api/occt/geom/geom.ts: -------------------------------------------------------------------------------- 1 | 2 | import { OCCTCurves } from "./curves"; 3 | import { OCCTSurfaces } from "./surfaces"; 4 | import { OCCTWorkerManager } from "../../../occ-worker/occ-worker-manager"; 5 | 6 | export class OCCTGeom { 7 | 8 | public readonly curves: OCCTCurves; 9 | public readonly surfaces: OCCTSurfaces; 10 | 11 | constructor( 12 | occWorkerManager: OCCTWorkerManager 13 | ) { 14 | this.curves = new OCCTCurves(occWorkerManager); 15 | this.surfaces = new OCCTSurfaces(occWorkerManager); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/api/occt/geom/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./curves"; 2 | export * from "./geom"; 3 | export * from "./surfaces"; 4 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/api/occt/index.ts: -------------------------------------------------------------------------------- 1 | // export * from './assembly'; 2 | export * from "./geom"; 3 | export * from "./shapes"; 4 | export * from "./booleans"; 5 | export * from "./fillets"; 6 | export * from "./io"; 7 | export * from "./occt"; 8 | export * from "./operations"; 9 | export * from "./transforms"; 10 | export * from "./shape-fix"; 11 | 12 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/api/occt/shapes/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./compound"; 2 | export * from "./edge"; 3 | export * from "./face"; 4 | export * from "./shapes"; 5 | export * from "./shell"; 6 | export * from "./solid"; 7 | export * from "./wire"; 8 | 9 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api"; 2 | export * from "./occ-worker"; 3 | export * from "./shape-parser"; 4 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/occ-worker/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./cache-helper"; 2 | export * from "./occ-info"; 3 | export * from "./occ-state.enum"; 4 | export * from "./occ-worker-manager"; 5 | export * from "./occ-worker"; 6 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/occ-worker/occ-info.ts: -------------------------------------------------------------------------------- 1 | import { OccStateEnum } from "./occ-state.enum"; 2 | 3 | export class OccInfo { 4 | state: OccStateEnum; 5 | } 6 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/occ-worker/occ-state.enum.ts: -------------------------------------------------------------------------------- 1 | export enum OccStateEnum { 2 | loading = "loading", 3 | loaded = "loaded", 4 | initialised = "initialised", 5 | computing = "computing", 6 | } 7 | -------------------------------------------------------------------------------- /packages/dev/occt-worker/lib/occ-worker/occ-worker-mock.ts: -------------------------------------------------------------------------------- 1 | import { initializationComplete, onMessageInput } from "./occ-worker"; 2 | 3 | export class OCCTWorkerMock { 4 | initializationComplete = (occ, plugins: any, doNotPost?: boolean) => { initializationComplete(occ, plugins, doNotPost); }; 5 | onMessageInput = (inputs) => { 6 | onMessageInput(inputs, (res) => { 7 | if (this.onmessage) { 8 | this.onmessage({ data: res }); 9 | } else { 10 | console.log("No onmessage function defined"); 11 | } 12 | }); 13 | }; 14 | 15 | postMessage(data) { 16 | if (data !== "busy") { 17 | this.onMessageInput(data); 18 | } 19 | } 20 | 21 | onmessage: (data) => void; 22 | } -------------------------------------------------------------------------------- /packages/dev/occt/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | ts-api-docs 4 | ts-doc-theme 5 | coverage 6 | bitbybit-dev-occt -------------------------------------------------------------------------------- /packages/dev/occt/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "plugins": [ 5 | "@typescript-eslint" 6 | ], 7 | "extends": [ 8 | "eslint:recommended", 9 | "plugin:@typescript-eslint/eslint-recommended", 10 | "plugin:@typescript-eslint/recommended" 11 | ], 12 | "rules": { 13 | "quotes": [ 14 | "error", 15 | "double" 16 | ], 17 | "import/no-unresolved": 0, 18 | "indent": ["error", 4], 19 | "semi": ["error", "always"] 20 | } 21 | } -------------------------------------------------------------------------------- /packages/dev/occt/.gitignore: -------------------------------------------------------------------------------- 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 | ts-doc-theme 12 | coverage -------------------------------------------------------------------------------- /packages/dev/occt/babel.config.cjs: -------------------------------------------------------------------------------- 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 | }; 14 | -------------------------------------------------------------------------------- /packages/dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitbybit-dev/bitbybit/4615d654276ae2906d677835e25c8aa6f755abc0/packages/dev/occt/bitbybit-dev-occt/bitbybit-dev-occt.wasm -------------------------------------------------------------------------------- /packages/dev/occt/bitbybit-dev-occt/index.js: -------------------------------------------------------------------------------- 1 | import ocFullJS from "./bitbybit-dev-occt.js"; 2 | import ocFullWasm from "./bitbybit-dev-occt.wasm"; 3 | 4 | const initOpenCascade = ({ 5 | mainJS = ocFullJS, 6 | mainWasm = ocFullWasm, 7 | worker = undefined, 8 | libs = [], 9 | module = {}, 10 | } = {}) => { 11 | return new Promise((resolve, reject) => { 12 | new mainJS({ 13 | locateFile(path) { 14 | if (path.endsWith('.wasm')) { 15 | return mainWasm; 16 | } 17 | if (path.endsWith('.worker.js') && !!worker) { 18 | return worker; 19 | } 20 | return path; 21 | }, 22 | ...module 23 | }).then(async oc => { 24 | for (let lib of libs) { 25 | await oc.loadDynamicLibrary(lib, { loadAsync: true, global: true, nodelete: true, allowUndefined: false }); 26 | } 27 | resolve(oc); 28 | }); 29 | }); 30 | }; 31 | 32 | export default initOpenCascade; 33 | -------------------------------------------------------------------------------- /packages/dev/occt/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of bitbybit-core 3 | */ 4 | 5 | export * from "./lib"; 6 | export * from "./bitbybit-dev-occt/bitbybit-dev-occt"; 7 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/api/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./shapes-helper.service"; 2 | export * from "./vector-helper.service"; 3 | export * as Inputs from "./inputs"; 4 | export * as Models from "./models"; 5 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/api/inputs/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./occ-inputs"; 2 | export * from "@bitbybit-dev/base/lib/api/inputs/base-inputs"; 3 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/api/inputs/inputs.ts: -------------------------------------------------------------------------------- 1 | export * from "./occ-inputs"; 2 | export * from "@bitbybit-dev/base/lib/api/inputs/base-inputs"; -------------------------------------------------------------------------------- /packages/dev/occt/lib/api/models/bucket.ts: -------------------------------------------------------------------------------- 1 | export * from "./occ-models"; 2 | export * from "./text-wires-data"; 3 | export * from "./text-wires-char-shape-part"; -------------------------------------------------------------------------------- /packages/dev/occt/lib/api/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from "@bitbybit-dev/base/lib/api/models"; 2 | export * as OCCT from "./bucket"; 3 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/api/models/occ-models.ts: -------------------------------------------------------------------------------- 1 | export class ShapeWithId { 2 | id: string; 3 | shape: U; 4 | } 5 | 6 | export class ObjectDefinition { 7 | compound?: U; 8 | shapes?: ShapeWithId[]; 9 | data?: M; 10 | } -------------------------------------------------------------------------------- /packages/dev/occt/lib/api/models/text-wires-char-shape-part.ts: -------------------------------------------------------------------------------- 1 | export class TextWiresCharShapePart { 2 | id?: string; 3 | shapes?: { 4 | compound?: T, 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/api/models/text-wires-data.ts: -------------------------------------------------------------------------------- 1 | import { Base } from "../inputs"; 2 | import { TextWiresCharShapePart } from "./text-wires-char-shape-part"; 3 | 4 | export class TextWiresDataDto { 5 | type = "text"; 6 | name = "text"; 7 | compound?: T; 8 | characters?: TextWiresCharShapePart[]; 9 | width: number; 10 | height: number; 11 | center: Base.Point3; 12 | } 13 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api"; 2 | export * from "./services"; 3 | export * from "./occ-helper"; 4 | export * from "./occ-service"; 5 | export * from "./shape-parser"; -------------------------------------------------------------------------------- /packages/dev/occt/lib/services/geom/geom.ts: -------------------------------------------------------------------------------- 1 | import { OpenCascadeInstance } from "../../../bitbybit-dev-occt/bitbybit-dev-occt"; 2 | import { OccHelper } from "../../occ-helper"; 3 | import { OCCTCurves } from "./curves"; 4 | import { OCCTSurfaces } from "./surfaces"; 5 | 6 | export class OCCTGeom { 7 | 8 | public readonly curves: OCCTCurves; 9 | public readonly surfaces: OCCTSurfaces; 10 | 11 | constructor( 12 | occ: OpenCascadeInstance, 13 | och: OccHelper 14 | ) { 15 | this.curves = new OCCTCurves(occ, och); 16 | this.surfaces = new OCCTSurfaces(occ, och); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/services/geom/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./curves"; 2 | export * from "./geom"; 3 | export * from "./surfaces"; 4 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/services/geom/surfaces.ts: -------------------------------------------------------------------------------- 1 | import { OpenCascadeInstance, TopoDS_Face } from "../../../bitbybit-dev-occt/bitbybit-dev-occt"; 2 | import { OccHelper } from "../../occ-helper"; 3 | import * as Inputs from "../../api/inputs/inputs"; 4 | 5 | export class OCCTSurfaces { 6 | 7 | constructor( 8 | private readonly occ: OpenCascadeInstance, 9 | private readonly och: OccHelper 10 | ) { 11 | } 12 | 13 | cylindricalSurface(inputs: Inputs.OCCT.GeomCylindricalSurfaceDto) { 14 | const ax = this.och.entitiesService.gpAx3_4(inputs.center, inputs.direction); 15 | const res = new this.occ.Geom_CylindricalSurface_1(ax, inputs.radius); 16 | ax.delete(); 17 | return res; 18 | } 19 | 20 | surfaceFromFace(inputs: Inputs.OCCT.ShapeDto) { 21 | return this.och.surfaceFromFace(inputs); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/services/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./geom"; 2 | export * from "./shapes"; 3 | export * from "./booleans"; 4 | export * from "./fillets"; 5 | export * from "./io"; 6 | export * from "./operations"; 7 | export * from "./transforms"; 8 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/services/shapes/compound.ts: -------------------------------------------------------------------------------- 1 | import { OpenCascadeInstance, TopoDS_Compound, TopoDS_Shape } from "../../../bitbybit-dev-occt/bitbybit-dev-occt"; 2 | import { OccHelper } from "../../occ-helper"; 3 | import * as Inputs from "../../api/inputs/inputs"; 4 | 5 | export class OCCTCompound { 6 | 7 | constructor( 8 | private readonly occ: OpenCascadeInstance, 9 | private readonly och: OccHelper 10 | ) { 11 | } 12 | 13 | makeCompound(inputs: Inputs.OCCT.CompoundShapesDto): TopoDS_Compound { 14 | return this.och.converterService.makeCompound(inputs); 15 | } 16 | 17 | getShapesOfCompound(inputs: Inputs.OCCT.ShapeDto): TopoDS_Shape[] { 18 | return this.och.shapeGettersService.getShapesOfCompound(inputs); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /packages/dev/occt/lib/services/shapes/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./compound"; 2 | export * from "./edge"; 3 | export * from "./face"; 4 | export * from "./shapes"; 5 | export * from "./shell"; 6 | export * from "./solid"; 7 | export * from "./wire"; 8 | export * from "./shapes"; -------------------------------------------------------------------------------- /packages/dev/occt/lib/services/shapes/shell.ts: -------------------------------------------------------------------------------- 1 | import { OpenCascadeInstance, TopoDS_Face, TopoDS_Shell } from "../../../bitbybit-dev-occt/bitbybit-dev-occt"; 2 | import { OccHelper } from "../../occ-helper"; 3 | import * as Inputs from "../../api/inputs/inputs"; 4 | 5 | export class OCCTShell { 6 | 7 | constructor( 8 | private readonly occ: OpenCascadeInstance, 9 | private readonly och: OccHelper 10 | ) { 11 | } 12 | 13 | sewFaces(inputs: Inputs.OCCT.SewDto): TopoDS_Shell { 14 | return this.och.shellsService.sewFaces(inputs); 15 | } 16 | 17 | isClosed(inputs: Inputs.OCCT.ShapeDto): boolean { 18 | return this.occ.BRep_Tool.IsClosed_1(inputs.shape); 19 | } 20 | 21 | getShellSurfaceArea(inputs: Inputs.OCCT.ShapeDto): number { 22 | return this.och.shellsService.getShellSurfaceArea(inputs); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/dev/occt/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "outDir": "./dist/bitbybit-core", 6 | "baseUrl": "./", 7 | "sourceMap": false, 8 | "declaration": true, 9 | "downlevelIteration": true, 10 | "experimentalDecorators": true, 11 | "moduleResolution": "node", 12 | "skipLibCheck": true, 13 | "target": "es2015", 14 | "module": "es2020", 15 | "strict": false, 16 | "allowJs": true, 17 | "emitDeclarationOnly": false, 18 | "paths": { 19 | "@bitbybit-dev/base": [ 20 | "../base/dist" 21 | ], 22 | "@bitbybit-dev/base/*": [ 23 | "../base/dist/*" 24 | ], 25 | }, 26 | "lib": [ 27 | "es2020", 28 | "dom" 29 | ], 30 | } 31 | } -------------------------------------------------------------------------------- /packages/dev/threejs/.gitignore: -------------------------------------------------------------------------------- 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/threejs/babel.config.cjs: -------------------------------------------------------------------------------- 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 | }; 14 | -------------------------------------------------------------------------------- /packages/dev/threejs/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of bitbybit-core 3 | */ 4 | 5 | export * from "./lib"; -------------------------------------------------------------------------------- /packages/dev/threejs/lib/api/bitbybit/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./draw"; -------------------------------------------------------------------------------- /packages/dev/threejs/lib/api/bitbybit/threejs.ts: -------------------------------------------------------------------------------- 1 | import { DrawHelper } from "../draw-helper"; 2 | 3 | export class ThreeJS { 4 | constructor(private readonly drawHelper: DrawHelper) { } 5 | } -------------------------------------------------------------------------------- /packages/dev/threejs/lib/api/context.ts: -------------------------------------------------------------------------------- 1 | import { ContextBase } from "@bitbybit-dev/core"; 2 | import * as THREEJS from "three"; 3 | 4 | export class Context extends ContextBase { 5 | scene: THREEJS.Scene; 6 | } 7 | -------------------------------------------------------------------------------- /packages/dev/threejs/lib/api/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./bitbybit"; 2 | export * from "./context"; 3 | export * from "./draw-helper"; 4 | export * from "./bitbybit-base"; 5 | export * as Inputs from "./inputs"; 6 | -------------------------------------------------------------------------------- /packages/dev/threejs/lib/api/inputs/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./draw-inputs"; 2 | export * from "./base-inputs"; 3 | export * from "@bitbybit-dev/core/lib/api/inputs/inputs"; -------------------------------------------------------------------------------- /packages/dev/threejs/lib/api/inputs/inputs.ts: -------------------------------------------------------------------------------- 1 | export * from "./draw-inputs"; 2 | export * from "@bitbybit-dev/core/lib/api/inputs"; 3 | -------------------------------------------------------------------------------- /packages/dev/threejs/lib/api/models/index.ts: -------------------------------------------------------------------------------- 1 | 2 | export * from "@bitbybit-dev/core/lib/api/models"; -------------------------------------------------------------------------------- /packages/dev/threejs/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api"; --------------------------------------------------------------------------------