Returns the portion of a scene object that lies inside a closed meshgeom object. The result is the spatial intersection of the two — the geometry that is shared between the scene and the clipping boundary.
Syntax
scene ST_Intersection(scene sc, meshgeom geom);Parameters
| Parameter | Description |
|---|---|
sc | The scene object to clip. |
geom | The meshgeom object used as the clipping boundary. Must be closed and non-empty. |
Usage notes
Returns
NULLifgeomis not closed.Returns
NULLifgeomis empty.
Example
Clip a sphere with a cuboid and return the result as text:
SELECT ST_AsText(ST_Intersection(ST_3DSphere(0.5,1), ST_3DMakeCuboid(1,1,1)));Output:
{"type" : "gltf", "content" : {"accessors":[{"bufferView":0,......}]}}The output is a glTF scene object containing the geometry that falls inside the cuboid.
See also
ST_3DSphere— creates a 3D sphere scene objectST_3DMakeCuboid— creates a 3D cuboid meshgeom objectST_AsText— converts a scene object to a text representation