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
| Parameter | Type | Description |
|---|---|---|
geom1, geom2 | meshgeom | The meshgeom objects to test for intersection. |
box | box3d | The 3D bounding box to test against a meshgeom object. |
sfmeshObject1, sfmeshObject2 | sfmesh | The 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
meshgeomobjectsOne
meshgeomobject and onebox3dbounding boxTwo
sfmeshobjects
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
-----------------
fThe second meshgeom lies at x = -1, entirely outside the first mesh at x = 0, so the function returns f (false).