ST_3DBuffer

Ganos支持为三维点(Point)或线段(Linestring)构建缓冲区。

语法

meshgeom ST_3DBuffer(geometry geom3d, float8 buffer_radius, boolean round_end  default true, float8 smooth default 0.5);

参数

参数名称

描述

geom3d

geometry对象仅支持PointLinestring类型。

buffer_radius

浮点数,表示缓冲区半径。

round_end

布尔型,默认为true。对于Linestring类型:

  • round_end=true,表示线段两端使用半球形缓冲区。

  • round_end=false,两端不设置缓冲区。

smooth

浮点数,默认为0.5,取值为(0,1]。表示缓冲区表面的三角形的边长。取值越小,缓冲区表面三角形边长越小,表面越光滑,越近似曲面。

重要
  • 如果未配置round_end参数,则smooth 参数无需配置。

  • 如果未配置round_end参数,但是配置smooth 参数,会造成解析错误。

描述

将三维的点或线段往外延伸一定距离,形成一段密闭的缓冲区空间。

效果示意

图 1. 点的缓冲区 smooth = 0.5 图1

图 2. 点的缓冲区 smooth = 0.8 图2

图 3. 线段的缓冲区 round_end = true图3

图 4. 线段的缓冲区 round_end = false图4

图 5. 线段的缓冲区 round_end = true, smooth = 0.3图1

示例

SELECT ST_AsText(ST_3DBuffer('POINT(0 0 0)', 2));
---------------------------------------------------
MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(0 0 2,-0.894427190999916 0 1.78885438199983,-0.447213595499958 ...

SELECT ST_AsText(ST_3DBuffer('LINESTRING(1 2 3, 0 0 4)', 0.5, false));
---------------------------------------------------
MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(1.43294188107951 1.89763792560716 3.22821773229382,1.30266373925419...

SELECT ST_AsText(ST_3DBuffer('LINESTRING(0 1 0, 1 3 2, 2 1 1)', 1, true, 0.6));
------------------------------------------------------
MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(-0.89885050178969 1.01131599079557 0.438109260099278...