All Products
Search
Document Center

PolarDB:ST_Intersection

Last Updated:Mar 28, 2026

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

ParameterDescription
scThe scene object to clip.
geomThe meshgeom object used as the clipping boundary. Must be closed and non-empty.

Usage notes

  • Returns NULL if geom is not closed.

  • Returns NULL if geom is 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 object

  • ST_3DMakeCuboid — creates a 3D cuboid meshgeom object

  • ST_AsText — converts a scene object to a text representation