Difference solids

Difference solids script details
Author
matas
Type
Typescript logo image
typescript
App Version
0.14.4
Visibility
public
Date Created
Feb 23, 2024, 5:27:14 PM
Last Edit Date
Feb 23, 2024, 5:27:47 PM

Script Details

The Code
const start = async () => { const boxOpt = new Bit.Inputs.OCCT.BoxDto(); boxOpt.width = 5; boxOpt.length = 8; boxOpt.height = 5; const box = await bitbybit.occt.shapes.solid.createBox(boxOpt); const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto(); cylinderOpt.radius = 3; cylinderOpt.height = 7; cylinderOpt.center = [3, 0, 3]; const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt); const sphereOpt = new Bit.Inputs.OCCT.SphereDto(); sphereOpt.radius = 3; sphereOpt.center = [-1.5, 1.5, -5]; const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt); const diff = await bitbybit.occt.booleans.difference({ shape: box, shapes: [cylinder, sphere], keepEdges: false }) bitbybit.draw.drawAnyAsync({ entity: diff }); } start();