Bitbybit 平台的 3D 算法单独仓库,可帮助在浏览器上编程几何图形。可与 ThreeJS、BabylonJS 或 PlayCanvas 结合使用。构建自己的核心
Bitbybit 平台的 3D 算法单独仓库,可帮助在浏览器上编程几何图形。可与 ThreeJS、BabylonJS 或 PlayCanvas 结合使用。构建自己的核心
Open-source 3D CAD algorithms for the web - MIT licensed. This monorepo contains all Bitbybit NPM packages plus example applications.
Source code in packages/, languages/, and examples/ is MIT licensed. Documentation text in docs/ is CC BY 4.0. Logos, trademarks, and media assets are not open-source — see CONTENT-LICENSE.md for details.
Essential introduction by Matas
Scaffold a fully-configured 3D CAD project in seconds:
npx @bitbybit-dev/create-app my-projectThe CLI first asks you to pick an app type:
cd my-project
npm install
npm run dev⭐ Subscribe - Silver or Gold plan | Get API Key for CAD Cloud
Check out 3D Bits app for Shopify - interactive 3D product configurators for e-commerce.
Your subscription directly funds continued open-source development of these packages.
| Package | Description |
|---|---|
| @bitbybit-dev/babylonjs | BabylonJS engine integration for drawing CAD geometry |
| @bitbybit-dev/threejs | Three.js engine integration for drawing CAD geometry |
| @bitbybit-dev/playcanvas | PlayCanvas engine integration for drawing CAD geometry |
| @bitbybit-dev/core | Core assembly layer combining all CAD kernels |
| @bitbybit-dev/occt | OpenCascade CAD kernel (works in Node.js & browser) |
| @bitbybit-dev/occt-worker | OCCT via WebWorker (non-blocking, browser only) |
| @bitbybit-dev/manifold | Manifold fast mesh booleans (works in Node.js & browser) |
| @bitbybit-dev/manifold-worker | Manifold via WebWorker (non-blocking, browser only) |
| @bitbybit-dev/jscad | JSCAD solid modeling (works in Node.js & browser) |
| @bitbybit-dev/jscad-worker | JSCAD via WebWorker (non-blocking, browser only) |
| @bitbybit-dev/base | Base math/vector/matrix algorithms used by all packages |
| @bitbybit-dev/create-app | CLI tool to scaffold 3D/CAD projects |
| @bitbybit-dev/cad-cloud-sdk | TypeScript SDK for the CAD Cloud API |
All examples live in the examples/ directory of this monorepo:
| App | Engine | Source Code |
|---|---|---|
| Hex Shell | Three.js | GitHub |
| Cup Configurator | Three.js | GitHub |
| Hex House Concept | Three.js | GitHub |
| Starter Template | BabylonJS | GitHub |
| Starter Template | Three.js | GitHub |
| Starter Template | PlayCanvas | GitHub |
| Terrace Furniture | BabylonJS | Closed source |
Beyond these open-source NPM packages, the Bitbybit platform includes:
If you're interested in contributing please check our Contribution guidelines & code of conduct
For first-time developers working on this project, follow these steps to set up the development environment and run all unit tests:
.tool-versions pins 22; the nightly workflow also runs 24)Clone the repository:
git clone https://github.com/bitbybit-dev/bitbybit.git
cd bitbybitInstall pnpm 11 once (the packages are one pnpm workspace; the packageManager field pins the exact version):
npm install -g pnpm@11Run the complete first-time setup (this will install all dependencies, build all packages, and run all unit tests):
npm run first-time-setupnpm run first-time-setup - Complete setup for new developers (installs dependencies, builds packages, runs tests)npm run setup - Install dependencies and build all packages without running testsnpm run setup-and-test - Install dependencies, build packages, and run all unit testsnpm run test - Run all unit tests (requires packages to be built first)npm run test:report - One report over every suite's last results (files, tests, failures, skipped, coverage); written to the job summary on GitHub Actionsnpm run ci-packages - Install dependencies for all packages (one pnpm install --frozen-lockfile for the workspace)npm run refresh-lockfile - Rewrite pnpm-lock.yaml after a dependency change, without touching node_modulesnpm run build-packages - Build and stage all packages (tsc -b over generated project references, run by pnpm in dependency order)npm run rebuild-all-packages - Empty every dist, then build all packagesnpm run gen:references - Regenerate the TypeScript project references from the package manifests after a dependency changenpm run check:references - Fail if the project references and the manifests disagree (the first step of npm test)npm run lint - ESLint over the repository, green by the committed suppression baseline; a new finding failsnpm run typecheck:strict - Every package's typecheck under the full strict setnpm run check:strict-baselines - Fail if any package has grown a strict baseline; every package is fully strict, so the check holds the line at zeronpm run api:check - Fail if any package's public API surface differs from the committed report in its etc/ foldernpm run api:update - Regenerate those API reports after a deliberate change to the public surfacenpm run check:tarballs - Pack every built package and install the tarballs together into an empty project, as a user wouldYou can also run tests for individual packages:
npm run test-base - Test base packagenpm run test-occt - Test OCCT package npm run test-core - Test core packagenpm run test-jscad - Test JSCAD packagenpm run test-manifold - Test Manifold packagenpm run test-threejs - Test ThreeJS packagenpm run test-playcanvas - Test PlayCanvas packagenpm run test-babylonjs - Test Bab暂无开放 Issues,或尚未同步最近议题。