Bitbybit CAD Platform

repository·master·Indexed 41 days ago

https://github.com/bitbybit-dev/bitbybit

An open-source collection of 3D CAD algorithms and tools for the web. It provides high-performance CAD kernels (OCCT, JSCAD, Manifold) and integrations for web engines including Three.js, Babylon.js, and PlayCanvas. The ecosystem includes @bitbybit-dev/core for kernel assembly, @bitbybit-dev/base for math and utility functions, and @bitbybit-dev/cad-cloud-sdk for server-side interaction with the CAD Cloud API. Version 1.3.1.

Tokens
648.2K
Snippets
1.3K
Records
2.7K
Agent score
52%

What's inside Bitbybit

  1. Introduction to OCCT Solids

    master

    In Open CASCADE Technology (OCCT), Solids are closed, watertight volumes. They represent the most common shape kind required for downstream operations (such as Boolean operations or physical simulations).

    You can create solids in two primary ways:

    1. From Primitives: Using built-in geometric primitives.
    2. From Shells: Converting a closed shell (a collection of faces) into a solid volume.

    To ensure a solid can be used reliably in complex operations, you should also learn how to perform validity checks to confirm the volume is indeed watertight and closed.

  2. Overview of Bitbybit Studio

    master

    Bitbybit Studio is a browser-based dashboard and playground for the CAD Cloud API. It allows users to interact with the API visually without writing code, making it ideal for prototyping workflows that can later be automated.

    Key capabilities include:

    • Parametric Model Generation: Using a catalog of registered models with typed parameters.
    • File Conversion: Converting STEP/STP files to glTF using Simple or Advanced modes.
    • CAD Playground: Building visual DAG-style pipelines using primitives, booleans, transforms, and fillets.
    • Task Management: Monitoring asynchronous operations, viewing execution timelines, and downloading results.
    • 3D Previewing: Inspecting glTF/GLB outputs in an interactive 3D viewer.
    • Account Management: Tracking API key usage, rotating keys, and managing subscriptions.
  3. Overview of 3D Bits for Shopify

    master

    3D Bits is a Shopify application designed to build interactive 3D product configurators. It allows merchants to design 3D scenes where shoppers can manipulate products (spin, change materials, adjust dimensions) and see real-time updates. When a shopper completes a configuration, the total price is automatically updated and charged via Shopify at checkout.

    Key capabilities include:

    • Visual Editing: Use the Composer editor to upload 3D models, arrange scenes, and design UI options (dropdowns, color swatches, sliders, text fields, image uploads) without code.
    • Dynamic Pricing: Set starting prices, per-option costs, or formulas for size/length-based pricing.
    • Seamless Integration: Embed the configurator into your existing Shopify theme with a single switch; it appears next to your existing buy button without requiring per-product template editing.
    • Parametric Support: On Standard and Pro plans, you can drive scenes using scripts written in TypeScript or via a visual node editor.
  4. Overview of @bitbybit-dev/threejs

    master

    The @bitbybit-dev/threejs package integrates Bitbybit's CAD kernels (OCCT, JSCAD, and Manifold) with the Three.js rendering engine. It allows you to draw and interact with professional CAD geometry directly within Three.js scenes.

    Key features:

    • Integrated Dependencies: Includes three as a dependency, so you do not need to install Three.js separately.
    • Multi-Kernel Support: Access OCCT, JSCAD, and Manifold kernels for parametric 3D modeling.
    • Lightweight Rendering: Leverages Three.js for flexible and efficient 3D rendering of complex CAD geometry.
  5. Overview of Bitbybit Basics

    master

    The Bitbybit platform provides a suite of tools for visual and text-based programming. The 'Basics' category covers the fundamental workflows required to build and manage projects on bitbybit.dev.

    Key capabilities include:

    • Code Editors & Cloud Services: Navigating and utilizing the platform's integrated development environments.
    • Project Management: Running code, managing project files, and handling scripts.
    • Asset Management: Incorporating both cloud-hosted and local assets into your projects.
    • Error Handling: Understanding and interpreting error reporting to debug your work.
    • Publishing: Sharing your completed projects with the Bitbybit community.
  6. Overview of @bitbybit-dev/occt

    master

    @bitbybit-dev/occt is the core CAD (Computer-Aided Design) layer of the Bitbybit platform. It is built on top of the OpenCascade Technology (OCCT) 3D kernel and provides the 3D geometry algorithms necessary for creating complex 3D designs. It is shared with the open-source community under the MIT license.

    Key resources:

  7. Introduction to the Color class

    master

    The Color class in Bitbybit provides tools for defining, converting, and manipulating colors, primarily focusing on hexadecimal (hex) and RGB (Red, Green, Blue) color formats.

    Supported Color Formats

    • Hex Color (Inputs.Base.Color): A string representation of a color, such as #FF0000 (red) or #00FF00 (green).
    • RGB Color (Inputs.Base.ColorRGB): An object representing color with separate red, green, and blue components, typically as numbers. Example: { r: 255, g: 0, b: 0 } for red.

    Note: The Color class can handle RGB values in various ranges (e.g., 0-255, 0-1, or 0-100) and will remap them as needed during conversions.

  8. Introduction to Bitbybit Runner

    master

    Bitbybit Runner is a single JavaScript file provided via CDN that allows you to execute Bitbybit 3D scripts and CAD algorithms directly on any website. It bundles open-source components including CAD kernels (OCCT, JSCAD) and 3D algorithms.

    It is designed for two primary use cases:

    1. Executing Visual Scripts: Running scripts exported from Bitbybit's visual editors (Rete, Blockly, or TypeScript).
    2. Direct JavaScript Development: Using the runner as a library to build custom parametric 3D applications from scratch.
  9. Overview of @bitbybit-dev/jscad

    master

    The @bitbybit-dev/jscad package provides programmatic solid modeling using Constructive Solid Geometry (CSG). It wraps the OpenJSCAD kernel and adds additional algorithms from Bitbybit, enabling operations like extrusions, hulls, and parametric designs.

    Environments:

    • Node.js: Works natively.
    • Browser: For non-blocking browser applications, it is recommended to use @bitbybit-dev/jscad-worker, which wraps this library in a WebWorker.
  10. Overview of BabylonJS and its capabilities

    master

    BabylonJS is a WebGL and WebGPU-based 3D game and rendering engine designed for ease of use and high performance. It is a comprehensive engine suitable for games, data visualizations, and product configurators.

    Key Features:

    • Scene Graph: Management of 3D objects, lights, and cameras.
    • Physics: Support for engines like Havoc, Cannon.js, Oimo.js, and Ammo.js.
    • Advanced Rendering: PBR materials, Node Material Editor, advanced lighting, and post-processing.
    • GUI System: 2D user interfaces within 3D scenes.
    • Animation & Particles: Tools for animating meshes/skeletons and creating visual effects (fire, smoke, etc.).
    • Asset Loading: Support for various formats, with GLTF/GLB being highly recommended.
    • XR Support: Built-in WebXR support for VR and AR.
    • TypeScript First: Provides strong type safety and autocompletion.
  11. Overview of @bitbybit-dev/base

    master
    @bitbybit-dev/base is the foundational layer for the Bitbybit CAD platform. It provides lightweight, zero-dependency helper functions for math, vectors, matrices, lists, and text utilities, along with shared base types. It is designed to work in both Node.js and browser environments and serves as a core dependency for all higher-level Bitbybit packages (such as @bitbybit-dev/core, @bitbybit-dev/babylonjs, and @bitbybit-dev/threejs).
  12. Overview of @bitbybit-dev/base capabilities

    master

    The @bitbybit-dev/base package is the foundational utility layer for the Bitbybit ecosystem. It provides core mathematical, geometric, and data manipulation tools required for 3D modeling and geometric analysis.

    Key functional areas include:

    • Geometry: Vector, Point, Line, Polyline, and MeshBitByBit (for low-level mesh/triangle operations).
    • Mathematics: Math (arithmetic, easing, and number generation).
    • Data Management: Lists (array manipulation) and Logic (boolean operations).
    • Media & Representation: Color (RGB/Hex), Text (string manipulation and vector text generation), and Dates (time handling).