名称

CG_IsSolid — 测试几何体是否为实体。 不执行有效性检查。

大纲

boolean CG_IsSolid(geometry geom1);

描述

Returns true when the input carries the solid flag, such as a geometry produced by CG_MakeSolid. A closed PolyhedralSurface remains a surface until it is explicitly converted. This tests the representation, not shell closure or validity; no validity check is performed.

可用性:3.5.0

该方法需要SFCGAL后端。

该函数支持 3d 并且不会丢失 z-index。

该函数支持多面体曲面。

此函数支持三角形和不规则三角网面 (TIN)。

示例

Compare the same closed shell before and after converting it to a solid.

Code
WITH data AS (
  SELECT 'POLYHEDRALSURFACE Z (
    ((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)),
    ((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),
    ((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0)),
    ((1 1 0,1 1 1,1 0 1,1 0 0,1 1 0)),
    ((0 1 0,0 1 1,1 1 1,1 1 0,0 1 0)),
    ((0 0 1,1 0 1,1 1 1,0 1 1,0 0 1))
  )'::geometry AS geom
)
SELECT CG_IsSolid(geom) AS shell_is_solid,
       CG_IsSolid(CG_MakeSolid(geom)) AS solid_is_solid
FROM data;
栅格输出
f | t
Figure
Geometry figure for visual-cg-issolid-01