All Products
Search
Document Center

PolarDB:ST_3DIntersects

Last Updated:Mar 28, 2026

Tests whether two 3D geometry objects or 3D mesh models share any point in space. Supports meshgeom and sfmesh types.

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, geom2meshgeomThe meshgeom objects to test for intersection.
boxbox3dThe 3D bounding box to test against a meshgeom object.
sfmeshObject1, sfmeshObject2sfmeshThe sfmesh objects to test for intersection.

Description

ST_3DIntersects returns true if the two input objects share any point in 3D space, and false if they are completely disjoint.

The function supports three input type combinations:

  • Two meshgeom objects

  • One meshgeom object and one box3d bounding box

  • Two sfmesh objects

Returns NULL if the function fails.

Examples

Test two meshgeom objects that do not intersect

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);

Result:

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

The second meshgeom lies at x = -1, entirely outside the first mesh at x = 0, so the function returns f (false).