名称

CG_StraightSkeletonPartition — 计算多边形的直骨架分割。

大纲

geometry CG_StraightSkeletonPartition(geometry geom, boolean auto_orientation);

描述

计算多边形几何体geom的直骨架分割。直骨架通过边缘简化将多边形分割成若干面。如果将auto_orientation设置为TRUE,函数会自动调整输入多边形的方向,以确保得到正确的结果。

可用性:3.6.0 - 需要 SFCGAL>= 2.0.0。

该方法需要SFCGAL后端。

示例

Code
SELECT CG_StraightSkeletonPartition('POLYGON((0 0,4 0,2 2,0 0))', true);
栅格输出
POLYHEDRALSURFACE(((0 0,2 0.82842712474619,2 2,0 0)),((4 0,2 0.82842712474619,0 0,4 0)),((2 2,2 0.82842712474619,4 0,2 2)))
Figure
Geometry figure for visual-cg-straightskeletonpartition-01

Straight skeleton partition of a polygon.

Code
WITH data AS (
  SELECT 'POLYGON((190 190,10 190,10 10,190 10,190 20,160 30,60 30,60 130,190 140,190 190))'::geometry AS polygon
)
SELECT polygon AS input_polygon,
       CG_StraightSkeletonPartition(polygon, true) AS skeleton_partition
FROM data;
栅格输出
POLYGON((190 190,10 190,10 10,190 10,190 20,160 30,60 30,60 130,190 140,190 190)) | POLYHEDRALSURFACE(((190 190,164.04 164.04,190 140,190 190)),((10 190,40.697 159.303,164.04 164.04,190 190,10 190)),((10 10,35 35,35 153.151,40.697 159.303,10 190,10 10)),((190 10,184.189 15.811,158.377 20,50 20,35 35,10 10,190 10)),((190 20,184.189 15.811,190 10,190 20)),((160 30,158.377 20,184.189 15.811,190 20,160 30)),((60 30,50 20,158.377 20,160 30,60 30)),((60 130,35 153.151,35 35,50 20,60 30,60 130)),((190 140,164.04 164.04,40.697 159.303,35 153.151,60 130,190 140)))
Figure
Geometry figure for visual-cg-straightskeletonpartition-02