Name

CG_3DUnion — Perform 3D union using postgis_sfcgal.

Synopsis

geometry CG_3DUnion(geometry geom1, geometry geom2);

geometry CG_3DUnion(geometry set g1field);

描述

可用性:3.5.0

该方法需要SFCGAL后端。

该方法实现了SQL/MM规范。 SQL-MM IEC 13249-3: 5.1

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

该函数支持多面体曲面。

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

Aggregate variant: returns a geometry that is the 3D union of a rowset of geometries. The CG_3DUnion() function is an "aggregate" function in the terminology of PostgreSQL. That means that it operates on rows of data, in the same way the SUM() and AVG() functions do and like most aggregates, it also ignores NULL geometries.

示例

3D 图像是使用 ST_AsX3D生成的,并使用 X3Dom HTML Javascript 渲染库以 HTML 形式渲染。

SELECT CG_Extrude(ST_Buffer(ST_GeomFromText('POINT(100 90)'),
                                    50, 'quad_segs=2'),0,0,30) AS geom1,
                                    CG_Extrude(ST_Buffer(ST_GeomFromText('POINT(80 80)'),
                                    50, 'quad_segs=1'),0,0,30) AS geom2;
                                

原始 3D 几何图形叠加。 geom2是具有透明度的。

SELECT CG_3DUnion(geom1,geom2)
                                FROM ( SELECT CG_Extrude(ST_Buffer(ST_GeomFromText('POINT(100 90)'),
                                50, 'quad_segs=2'),0,0,30) AS geom1,
                                CG_Extrude(ST_Buffer(ST_GeomFromText('POINT(80 80)'),
                                50, 'quad_segs=1'),0,0,30) AS geom2 ) As t;

geom1 和 geom2 的并集