All Products
Search
Document Center

PolarDB:ST_3DIntersects

Last Updated:Mar 28, 2026

Checks whether two 3D geometry objects or 3D models intersect.

Syntax

bool ST_3DIntersects(meshgeom geom1, meshgeom geom2);
bool ST_3DIntersects(meshgeom geom1, box3d box);
bool ST_3DIntersects(sfmesh sfmeshObject1, sfmesh sfmeshObject2);

Parameters

ParameterTypeDescription
geom1, geom2meshgeomA meshgeom object.
boxbox3dA box3d object.
sfmeshObject1, sfmeshObject2sfmeshAn sfmesh object.

Supported geometry types

ST_3DIntersects supports the following input combinations:

  • Two meshgeom objects

  • A meshgeom object and a box3d object

  • Two sfmesh objects

Return value

Returns true if the objects intersect, false if they do not. Returns NULL if the function fails.

Example

The following query checks whether two meshgeom objects intersect. The geometries do not share any 3D space, so the result is false.

select ST_3DIntersects(
    'MESHGEOM(PATCH(TRIANGLESTRIP Z(0 0 0,0 10 0,0 0 10,0 10 10), POINT Z(0 0 0)))'::meshgeom,
    'MESHGEOM(PATCH(LINESTRING(-1 0 0, -1 -0.5 0)))'::meshgeom);

Expected output:

 st_3dintersects
-----------------
 f