This topic describes the ST_3DBuffer function. This function constructs a buffer for a 3D point or linestring.
Syntax
meshgeom ST_3DBuffer(geometry geom3d, float8 buffer_radius, boolean round_end default true, float8 smooth default 0.5);
Parameters
Parameter | Description |
---|---|
geom3d | The geometry object, which can be of the Point or LineString type. |
buffer_radius | The buffer radius, which is a floating-point number. |
round_end | The value is of the Boolean type. Default value: true.
|
smooth | The side length of the triangle on the buffer surface. The value is a floating-point number. Default value: 0.5. Valid values: (0,1]. A small value indicates a small side length of the triangle. The surface is smoother and more approximate to a curved surface. |
Important
- If you do not configure the round_end parameter, you do not need to configure the smooth parameter.
- If you do not configure the round_end parameter but configure the smooth parameter, parsing errors occur.
Description
This function extends a 3D point or linestring by a certain distance to form a closed buffer.
Effect diagram





Examples
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...