Script
Bitbybit runner cube example in TypeScript

- Project
- Runner Examples
- Author
- bitbybit
- Created
- Jul 22, 2024, 12:42:33 PM
- Last edit
- May 27, 2025, 7:44:29 AM
Project
Runner Examples
This project contains some examples used in various tutorials for showing how BITBYBIT-RUNNER.JS works
View full projectScript 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);
