Bitbybit runner cube example in TypeScript

Bitbybit runner cube example in TypeScript script details
Type
Typescript logo image
typescript
App Version
0.15.13
Visibility
public
Date Created
Jul 22, 2024, 12:42:33 PM
Last Edit Date
Jul 25, 2024, 10:11:28 AM

Script Details

The 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);