All Products
Search
Document Center

PolarDB:ST_3DIntersection

Last Updated:Mar 28, 2026

Computes the 3D intersection of an sfmesh object with a box3d or meshgeom object and returns the result as a new sfmesh.

Syntax

sfmesh ST_3DIntersection(sfmesh sfmeshObject, box3d box);
sfmesh ST_3DIntersection(sfmesh sfmeshObject, meshgeom geom);

Parameters

ParameterDescription
sfmeshObjectThe sfmesh object.
boxThe box3d object.
geomThe closed meshgeom object.

Description

ST_3DIntersection supports two overloads with different intersection strategies:

  • sfmesh + box3d: Aligns axes and returns the intersection.

  • sfmesh + meshgeom: Computes and returns the intersection directly.

In both cases, the UV and Normal values of the input sfmesh are updated synchronously in the result.

Examples

Intersect a sphere with a box

Clip a sphere (radius 1.0, tessellation level 5) with a unit cube, then count the resulting patches.

SELECT ST_NumPatches(
    ST_3DIntersection(
        ST_3DMakeSphere(1.0, 5),
        'BOX3D(0 0 0, 1 1 1)'::box3d
    )
);

Result:

 st_numpatches
--------------
          2608