Script: Bitbybit runner cube example in TypeScript

Bitbybit runner cube example in TypeScript picture
Type
Typescript logo indicatortypescript
Date Created
Jul 22, 2024, 2:42:33 PM
Last Edit Date
May 27, 2025, 9:44:29 AM

Project Information

This project contains some examples used in various tutorials for showing how BITBYBIT-RUNNER.JS works

View Full Project

Script Code

type Inputs = {
    size: number;
}

Bit.mockBitbybitRunnerInputs({ size: 1 });
const inputs: Inputs = Bit.getBitbybitRunnerInputs();

const { occt } = bitbybit;

const start = async () => {
    const cube = await occt.shapes.solid.createCube({
        size: inputs.size,
        center: [0, 0, 0],
    });
    const filletCube = await occt.fillets.filletEdges({
        shape: cube,
        radius: 0.4
    });
    const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();
    drawOptions.faceColour = "#0000ff";
    drawOptions.edgeWidth = 1;
    drawOptions.precision = 0.005;
    const cubeMesh = await bitbybit.draw.drawAnyAsync({
        entity: filletCube,
        options: drawOptions,
    });
    return { cubeMesh };
}

const runnerOutput = start();
Bit.setBitbybitRunnerResult(runnerOutput);
Plans & Pricing

Choose Your Plan

Editor plans for 3D development, API keys for server-side CAD algorithms

B2B

ENTERPRISE

Custom pricing

Custom software development, dedicated servers & CAD automation at scale.

CAD Automation & Software
  • Custom software development
  • Cloud CAD automation pipelines
  • 3D configurators (STEP & GLTF)
  • Batch export jobs
  • Custom algorithms & deployment
Infrastructure & Support
  • Custom compute allocation
  • Dedicated / VPS server tenants
  • Long-running computation jobs
  • Custom upload limits & overage
  • SLA & premium support