Returns the portion of a scene object that falls inside a closed meshgeom object.
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. |
Description
ST_Intersection clips a scene object against a closed meshgeom boundary and returns a new scene object containing only the geometry inside that boundary.
If the meshgeom object is not closed,
ST_Intersectionreturns NULL.If the meshgeom object is empty,
ST_Intersectionreturns NULL.
Example
The following example clips a sphere against a unit cube and returns the intersection 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-format scene object. The content is truncated here for readability; the actual output contains the full geometry data.