Minkowski
Minkowski sum operations for 3D geometry. The Minkowski sum A ⊕ B inflates solid A by the shape of solid B — sweeping B through every surface point of A. Common uses: rounding all edges with a sphere, chamfering with a cube, or computing configuration-space obstacles for collision detection.
See also:
minkowskiSum
Section titled “minkowskiSum”function minkowskiSum(geometryA: Geom3, geometryB: Geom3): Geom3Compute the Minkowski sum of two 3D geometries.
The Minkowski sum A ⊕ B is the set of all points a + b where a ∈ A and b ∈ B. Intuitively, it “inflates” geometry A by the shape of geometry B: sweeping B’s centre through every point on A’s surface and taking the union.
Typical uses:
- Round all edges and corners of a solid by summing with a small sphere.
- Chamfer all edges by summing with a small cube.
- Compute the configuration-space obstacle for collision detection.
Both geometries must be Geom3. The second operand should be convex for best performance; non-convex first operands are supported (via tetrahedra decomposition) as long as the second is convex. Both non-convex is not supported.
Parameters:
| Name | Type | Description |
|---|---|---|
geometryA |
— | The base geometry to inflate. |
geometryB |
— | The shape to inflate by (should be convex). |
Returns: A new Geom3 representing the Minkowski sum.
const { minkowskiSum } = jscad.minkowskiconst { cuboid, sphere } = jscad.primitivesasync function main() { // Round every edge and corner of a box by 1 unit const box = cuboid({ size: [10, 8, 4] }) const kernel = sphere({ radius: 1, segments: 16 }) return minkowskiSum(box, kernel)}See also: