Returns the part of an sfmesh object that is not part of a box3d or meshgeom object.
Syntax
sfmesh ST_3DDifference(sfmesh sfmeshObject, box3d box);
sfmesh ST_3DDifference(sfmesh sfmeshObject, meshgeom geom);Parameters
| Parameter | Description |
| sfmeshObject | The sfmesh object. |
| box | The box3d object. |
| geom | The closed meshgeom object. |
Description
The UV and Normal values of the returned sfmesh object are synchronously updated to reflect the difference result.
The function behaves differently depending on the second argument:
sfmesh vs. box3d: Aligns the axes before computing and returns the difference.
sfmesh vs. meshgeom: Computes and returns the difference directly.
Example
SELECT ST_NumPatches(ST_3DDifference(ST_3DMakeSphere(1.0, 5), 'BOX3D(0 0 0, 0.2 0.2 0.2)'::box3d));
-----------------
20480This example subtracts a small box from a sphere created by ST_3DMakeSphere and counts the resulting patches with ST_NumPatches.
See also
ST_3DMakeSphere: Creates a sphere as an sfmesh objectST_NumPatches: Returns the number of faces in a polyhedral surface