@bitbybit-dev/threejs

中文文档
1.6.0发布于 2026/10/29MITTypeScriptES Module构建来源已验证近 30 天下载 2438

Bit By Bit Developers THREEJS CAD Library to Program Geometry

原始使用文档
文档目录14 节
  1. Overview
  2. Quick Start
  3. Need Server-Side CAD?
  4. Use It With an AI Agent
  5. Learn
  6. Links
  7. API reference
  8. Example Applications
  9. Development
  10. Bitbybit Platform
  11. Support the Project
  12. Community
  13. Major Dependencies
  14. License

@bitbybit-dev/threejs

Three.js engine integration for Bitbybit - draw and interact with CAD geometry from OCCT, JSCAD, and Manifold kernels directly in your Three.js scenes.

Picture showing bitbybit.dev platform

Overview

This package connects Bitbybit's powerful CAD kernels to the Three.js rendering engine. It includes three as a dependency, so you don't need to install Three.js separately. Create parametric 3D models with professional CAD operations and render them with Three.js's lightweight yet flexible rendering capabilities.

Quick Start

The fastest way to scaffold a Three.js + Bitbybit project:

npx @bitbybit-dev/create-app my-project --engine threejs
cd my-project
npm install
npm run dev

This creates a complete Vite + TypeScript project with all three CAD kernels (OCCT, JSCAD, Manifold) pre-configured and rendering through Three.js. Learn more about the CLI.

Need Server-Side CAD?

The CLI first asks you to choose between a Frontend app or a CAD Cloud app. Select "cloud" to scaffold a full-stack project with a backend (Hono on Cloudflare Workers, Node.js Express, or ASP.NET Core) and a React + Three.js frontend. Your API key stays on the server and the frontend proxies requests through your backend:

npx @bitbybit-dev/create-app my-cloud-project --type cloud

Choose from 5 backend templates: Hono + SDK, Hono + REST, Node.js + SDK, Node.js + REST, or .NET + REST. Each includes ready-to-run examples with model generation, batch operations, and CAD pipelines. Learn more.

Use It With an AI Agent

An agent that does not know an API invents plausible names for it, and Bitbybit has more functions across its three CAD kernels than any model holds in memory. The free Bitbybit CAD MCP server removes the guesswork: your agent looks up the exact signature, parameter defaults, return type and examples for the version of @bitbybit-dev/threejs your project has installed, and writes code that compiles the first time.

claude mcp add --transport http bitbybit https://mcp.bitbybit.dev/mcp

Cursor, VS Code, claude.ai, ChatGPT and the Claude API connect to the same endpoint; npx -y @bitbybit-dev/mcp runs the same server locally, pinned to your installed version. Every configuration is here.

With a CAD Cloud key, the Bitbybit CAD Cloud MCP goes further and lets the agent run the geometry for you - measure a STEP file, run a pipeline, convert to glTF - and hand back the results as files. For assistants that cannot speak MCP, the whole API is also published as context files. The AI section of the documentation explains all of it.

Learn

TopicLink
Quick Start Tutorialhttps://learn.bitbybit.dev/learn/npm-packages/threejs/start-with-three-js
About Three.js Integrationhttps://learn.bitbybit.dev/learn/npm-packages/threejs/about-threejs
Advanced Parametric Modelhttps://learn.bitbybit.dev/learn/npm-packages/threejs/advanced-parametric-3d-model
Hex House Concepthttps://learn.bitbybit.dev/learn/npm-packages/threejs/hex-house-concept
Three.js Engine Setuphttps://learn.bitbybit.dev/learn/getting-started/engines/threejs
AI Coding Agents - Overviewhttps://learn.bitbybit.dev/learn/using-ai-with-bitbybit/intro
Bitbybit CAD MCPhttps://learn.bitbybit.dev/learn/using-ai-with-bitbybit/mcp/bitbybit-mcp
ResourceURL
GitHubhttps://github.com/bitbybit-dev/bitbybit/tree/master/packages/dev/threejs
Monorepohttps://github.com/bitbybit-dev/bitbybit
NPMhttps://www.npmjs.com/package/@bitbybit-dev/threejs
Documentationhttps://learn.bitbybit.dev/learn/npm-packages/threejs/start-with-three-js
API Referencehttps://docs.bitbybit.dev/modules/Bit
Unit Test Coveragehttps://github.com/bitbybit-dev/bitbybit/actions/workflows/verify.yml

API reference

Every class, method and input type in this package is documented in the generated TypeScript API reference:

Example Applications

AppSource Code
Hex ShellGitHub
Cup ConfiguratorGitHub
Hex House ConceptGitHub
Starter TemplateGitHub
Terrace Furniture (BabylonJS)Closed source

Development

# Build package
npm run build-p

# Run unit tests with coverage
npm run test:coverage

# Re-run them as you edit
npm run test:watch

Bitbybit Platform

Beyond NPM packages, Bitbybit offers:

  • Visual Programming Editors - Rete & Blockly drag-and-drop 3D modeling, plus a Monaco TypeScript editor
  • CAD Cloud API - Build full pipelines that compose all Bitbybit algorithms, where each step can reference outputs of previous steps. Supports parametric model generation, STEP-to-glTF conversion, and complex CAD workflows via HTTP
  • Bitbybit Studio - A growing visual dashboard where API Key users can generate models, convert files, build pipelines with a GUI, inspect tasks, and preview 3D results
  • 3D Bits for Shopify - Interactive 3D product configurators for e-commerce
  • Script Runners - Execute visual scripts directly on your website
  • Built for AI Coding Agents - The free Bitbybit CAD MCP gives Claude Code, Cursor, VS Code, claude.ai and ChatGPT the exact API of the version you use; with a key, the CAD Cloud MCP runs the geometry too
  • Business & Enterprise - We help businesses and enterprises develop custom applications and spin up optimized CAD tenant workflows on our managed servers

Support the Project

This package is part of the open-source Bitbybit ecosystem. Your subscription helps fund continued development.

⭐ Subscribe - Silver or Gold plan | Get API Key for CAD Cloud

Community

Major Dependencies

Three.js, OpenCascade, JSCAD, Manifold, Verbnurbs

License

MIT © Bit By Bit Developers

版本与发布记录

@bitbybit-dev/threejs 共发布 58 个版本,首次发布于 2024/11/04;过去 12 个月发布了 30 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.6.0latest2026/10/2910 天前
1.6.0-rc.0rc2026/10/2811 天前
1.5.02026/10/1227 天前
1.5.0-rc.02026/10/1227 天前
1.4.12026/10/021 个月前
1.4.02026/09/301 个月前

其他发布通道:alpha → 0.19.0-alpha.0,rc → 1.6.0-rc.0。

关于 @bitbybit-dev/threejs 的常见问题

@bitbybit-dev/threejs 是什么?

Bit By Bit Developers THREEJS CAD Library to Program Geometry

如何安装 @bitbybit-dev/threejs?

在项目目录运行 npm install @bitbybit-dev/threejs,或使用 pnpm add / yarn add / bun add。

@bitbybit-dev/threejs 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bitbybit-dev/threejs 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bitbybit-dev/threejs 可以商用吗?

@bitbybit-dev/threejs 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bitbybit-dev/threejs 的下载量有多少?

根据 npm 官方下载统计,@bitbybit-dev/threejs 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,438 次,日均约 81 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bitbybit-dev/threejs 还在维护吗?

最新版本 1.6.0 发布于 2026/10/29(10 天前);至今共发布 58 个版本,其中过去 12 个月发布了 30 个;首次发布于 2024/11/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。