Bitbybit Docs
    Preparing search index...
    TypeScript API Reference

    Bitbybit Documentation

    Version 1.2.0

    The complete reference for the Bitbybit 3D CAD API - every class, method, input type and enum, generated from the shipped TypeScript declarations so it never drifts from the code.
    Explore 1400+ functions across OCCT, JSCAD, Manifold and more.

    3 CAD Kernels
    1400+ API Functions
    3 Game Engines

    Quick start with npm packages

    Scaffold a fully configured 3D CAD project in seconds. The CLI sets up Vite, TypeScript and all three geometry kernels - OCCT, JSCAD and Manifold - with starter code for the engine you pick. The same packages run in Node.js, and the -worker variants keep the WASM kernels off the browser's main thread.

    npx @bitbybit-dev/create-app my-project
    Supports:
    Three.js Babylon.js PlayCanvas

    Quick Access - Main API Categories

    Each category is a property of the bitbybit object in your code, so bitbybit.occt.shapes is the occt card and then its shapes class. Use this site when you need the exact signature, parameter DTO or return type of a call; for walkthroughs and worked examples go to learn.bitbybit.dev.

    draw

    Render any geometry - points, lines, meshes, kernel shapes, tags - into the scene, then update or dispose what came back.

    babylon

    BabylonJS engine features: scene, cameras, lights, materials, textures, picking, gizmos, glTF and XR.

    vector

    2D and 3D vector arithmetic: add, subtract, scale, dot and cross products, normalise, angle and interpolation.

    point

    Points in 2D and 3D, singly or in grids, spirals and hexagonal sets; measure, sort and transform them.

    line

    Straight segments from start and end points: create in bulk, measure, reverse, transform and convert to kernel edges.

    polyline

    Connected line sequences, open or closed - the simplest outline before it becomes a face or a solid.

    mesh

    Polygonal mesh geometry - triangles, vertices, normals - and conversion between the representations the kernels use.

    occt

    The OpenCascade solid modelling kernel: exact BREP booleans, fillets, lofts, sweeps, offsets, shelling, STEP and IGES.

    advanced

    Higher-level tools on top of the kernels: dimension annotations, camera navigation, surface patterning and 3D text. Available in the bitbybit.dev editors.

    things

    Finished parametric models - furniture, vases, boxes, birdhouses - each exposing the parameters that shape it. Available in the bitbybit.dev editors.

    jscad

    The JSCAD constructive solid geometry kernel: primitives combined with booleans, expansions, hulls and extrusions.

    manifold

    The Manifold kernel: fast, reliably watertight mesh booleans, plus 2D cross sections and their extrusion.

    logic

    Comparisons, and/or/not, conditional selection and value gates that let a model react to its parameters.

    math

    Trigonometry, rounding, clamping, remapping between ranges, interpolation and seeded randomness.

    lists

    Array operations: create, slice, flatten, reverse, sort, group, zip, repeat and pick - what sits between two geometry calls.

    color

    Colours across hex, RGB and HSL, with blending, inversion and colour ranges for draw options and materials.

    text

    String utilities: join, split, replace, trim, case conversion, padding and formatting.

    dates

    Date and time values: create, parse, format, compare and do arithmetic on them.

    json

    Parse, stringify, query and edit JSON - the usual way to bring configuration in and hand results out.

    csv

    Read and write CSV: drive a model from a spreadsheet of parameters, or export a cutting list back out.

    verb

    NURBS curves and surfaces: interpolated curves, lofted and swept surfaces, intersections and closest-point queries.

    tag

    Text labels positioned in 3D space that stay readable as the camera moves - dimensions, part numbers, annotations.

    time

    Per-frame callbacks and the timing values that turn a static model into an animated one.

    asset

    Load 3D models, textures, fonts and data files from the project's asset store or a URL, ready for the kernels or the renderer.

    How the API is organised

    Everything lives under the root Bit namespace, split into three kinds of entry.

    Operation classes

    OCCT, JSCAD, Manifold, Vector, Draw, Babylon and their sub-classes carry the methods you call. A class such as OCCTShapes groups the constructors for a shape family; OCCTBooleans groups union, difference and intersection.

    Input DTOs

    Almost every method takes a single DTO argument rather than a positional list, so the DTO page is where the defaults and units live. They sit under Bit.Inputs.*, one namespace per kernel. Kernels deliberately repeat names - there is a CircleDto in each - so read the namespace in the page title.

    Models and enums

    Under Bit.Models.*: the shapes returned to you, plus the enumerations the DTOs use. The type hierarchy shows how the types relate, and the full symbol index lists every one in one place.

    The rest of the platform

    Working with an AI assistant? Point it at llms.txt for a compact index of this site, or see using AI with Bitbybit for context files and the Context7 MCP server.