3D Text Cutout TypeScript

3D Text Cutout TypeScript script details
Author
matas
Type
Typescript logo image
typescript
App Version
0.14.6
Visibility
public
Date Created
Sep 18, 2023, 1:26:55 PM
Last Edit Date
Feb 27, 2024, 1:59:56 PM

Script Details

The Code
const start = async () => { const options = new Bit.Advanced.Text3D.Text3DDto(); options.text = "Hello World!"; options.fontType = Bit.Advanced.Text3D.fontsEnum.Silkscreen; options.direction = [0, 1, 0]; options.origin = [6, -1.5, 0.5]; options.height = 3; options.originAlignment = Bit.Advanced.Text3D.recAlignmentEnum.rightTop; const text = await bitbybit.advanced.text3d.create(options); const box = await bitbybit.occt.shapes.solid.createBox({ width: 20, height: 1, length: 5, center: [0, 0, 0], }); const boxFilleted = await bitbybit.occt.fillets.filletEdges({ shape: box, radius: 0.2, }); const cutout = await bitbybit.occt.booleans.difference({ shape: boxFilleted, shapes: [text.compound], keepEdges: false }); const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions(); drawOptions.faceColour = "#0000ff"; bitbybit.draw.drawAnyAsync({ entity: cutout, options: drawOptions }); } start();