ST_Difference

更新时间:
复制 MD 格式

Returns the part of a scene object that lies outside a meshgeom object.

Syntax

scene ST_Difference(scene sc, meshgeom geom);

Parameters

ParameterDescription
scThe scene object.
geomThe meshgeom object.

Returns

Returns a scene object representing the part of sc that does not intersect geom.

Returns NULL in the following cases:

  • geom is not a closed meshgeom object.

  • geom is empty.

Example

SELECT ST_AsText(
    ST_Difference(
        ST_3DSphere(0.5, 1),
        ST_Translate(ST_3DMakeCuboid(1, 1, 1), 0.5, 0, 0)
    )
);

Output:

{"type" : "gltf", "content" : {"accessors":[{"bufferView":0,......}]}}

The output is a glTF-formatted JSON object containing the geometry of the resulting scene.