Script
Intersection solids

- Author
- matas
- Created
- Feb 23, 2024, 6:59:09 PM
- Last edit
- Feb 27, 2024, 11:32:51 AM
Project
Getting Started Demos TypeScript
This project contains demo scripts for TypeScript Monaco editor that are used as examples in the "Getting Started" section of the documentation.
View full projectScript 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.intersection({
shapes: [box, cylinder, sphere],
keepEdges: false
})
bitbybit.draw.drawAnyAsync({
entity: diff
});
}
start();
