Name

CG_StraightSkeletonPartition — Computes the straight skeleton partition of a polygon.

Synopsis

geometry CG_StraightSkeletonPartition(geometry geom, boolean auto_orientation);

Description

Computes the straight skeleton partition of the input polygon geometry geom. The straight skeleton is a partitioning of the polygon into faces formed by tracing the collapse of its edges. If auto_orientation is set to true, the function will automatically adjust the orientation of the input polygon to ensure correct results.

Availability: 3.6.0 - requires SFCGAL >= 2.0.0.

This method needs SFCGAL backend.

Examples

SELECT ST_AsText(CG_StraightSkeletonPartition('POLYGON((0 0, 4 0, 2 2, 0 0))', true));
-- Result: MULTIPOLYGON(((0 0,2 0.83,2 2)),((4 0,2 0.83,0 0)),((2 2,2 0.83,4 0)))
SELECT CG_StraightSkeletonPartition(ST_GeomFromText('POLYGON (( 190 190, 10 190, 10 10, 190 10, 190 20
            , 160 30, 60 30, 60 130, 190 140, 190 190 ))')
            , true );

Original polygon

Straight Skeleton Partition of polygon