CG_ApproximateMedialAxis — 面ジオメトリの近似的な中心軸を計算します。
geometry CG_ApproximateMedialAxis(geometry geom);
geometry CG_ApproximateMedialAxis(geometry geom, boolean projected);
ストレートスケルトンを基に、実際の入力の近似的な中心軸を返します。可能な版(1.2.0以上)でビルドするとSFCGAL独自APIを使います。そうでない場合には、CG_StraightSkeleton (遅い)関数をラッピングした関数となります。
When projected is true, free endpoints of the medial axis are extended to reach the polygon boundary (projected medial axis). Requires SFCGAL 2.3.0+. When built against an older SFCGAL version, a notice is emitted and the non-projected result is returned instead.
Availability: 3.5.0
Availability: 3.7.0 - projected parameter. Requires SFCGAL >= 2.3.0 for projected result; falls back to non-projected with a notice on older versions.
|
|
|
この関数はZ値を無視します。この関数を3次元ジオメトリ上で使用したとしても、常に2次元の結果となります。 |
このメソッドにはSFCGALバックエンドが必要です。
この関数は多面体サーフェスに対応しています。
この関数は三角形と不規則三角網 (TIN)に対応しています。
SELECT CG_ApproximateMedialAxis(ST_GeomFromText('POLYGON (( 190 190, 10 190, 10 10, 190 10, 190 20, 160 30, 60 30, 60 130, 190 140, 190 190 ))'));
![]() ポリゴンと近似的な中心軸 |
-- Projected medial axis: free endpoints extended to polygon boundary
SELECT CG_ApproximateMedialAxis('POLYGON((0 0,2 0,2 1,0 1,0 0))', true);
-- Result: MULTILINESTRING((0 0.5,2 0.5))