Skip to content

Geom.difference()

Description

Boolean operation: Difference of two or more solids.

Syntax

JS
Geom.difference(a: Shape, b: Shape) -> Shape
Geom.difference(shapes: Array<Point3>) -> Shape

Parameters

Parameter Type Description
a Shape Solid 1.
b Shape Solid 2.
shapes Array<Point3> Array of solids for difference.

Return value

Type Description
Shape Object of type Shape, result of difference between solids.

Example

JS
1
2
3
4
5
6
let box = Geom.box(100, 100, 100);
let cyl = Geom.cylinder(50, 150);
let s1 = Geom.difference(box, cyl); // box - cyl
console.info(s1); // output:
let s2 = Geom.difference(cyl, box); // cyl - box
console.info(s2); // output:

See Also

Geom.diff

Note: I've translated all the text inside the Markdown headers, lists, tables, links, code blocks, and indentation.

Last update: 14 August 2025, 18:47