All Products
Search
Document Center

PolarDB:ST_Intersection

Last Updated:Mar 28, 2026

Returns the portion of a scene object that falls inside a closed meshgeom object.

Syntax

scene ST_Intersection(scene sc, meshgeom geom);

Parameters

ParameterDescription
scThe scene object to clip.
geomThe 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_Intersection returns NULL.

  • If the meshgeom object is empty, ST_Intersection returns 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.