ST_Loft

更新时间: 2026-03-28 16:18:24

Lofts a 2D polygon along a 3D path to produce a mesh geometry. Path corners are chamfered using Bezier curves.

Syntax

meshgeom ST_Loft(geometry geom2d, geometry line3d, int4 chamfer);

Parameters

ParameterTypeDescription
geom2dgeometryA 2D polygon to use as the cross-section profile. Only 2D polygons are accepted.
line3dgeometryA 3D linestring that defines the path along which the polygon is lofted.
chamferint4Number of Bezier curve segments used to chamfer each corner of the 3D path. A higher value produces more vertices in the output meshgeom.

Usage notes

  • geom2d must be a 2D polygon. 3D geometries and non-polygon types are not accepted.

  • line3d must be a 3D linestring.

  • If geom2d contains holes (interior rings), the function lofts the full polygon including holes.

  • The output meshgeom is compatible with ST_AsText.

Example

The following example lofts a 2D polygon with a hole along a four-vertex 3D path with chamfer=5.

SELECT ST_AsText(ST_Loft(
    'POLYGON((0 0, 1 0, 1 1, 0 0), (0.5 0.5, 0.6 0.5, 0.6 0.6, 0.5 0.5))',
    'LINESTRING(0 0 0, 10 0 0, 10 10 0, 10 10 10)', 5));

Output (truncated):

MESHGEOM(PATCH(POLYGON Z ((0 -0.333333333333333 0.666666666666667,0 0.666666666666667 -0.333333333333333,0 -0.333333333333333 -0.333333333333333 ...

Effect diagram

The following figure shows the result of lofting a 2D polygon with holes along a 3D path (chamfer=4). The output is a mesh geometry with Bezier-chamfered corners at each path vertex.

Figure 1
上一篇: ST_3DBuffer 下一篇: ST_3DRemoveDuplicateVertex
阿里云首页 云原生数据库 PolarDB 相关技术圈