名前

CG_GenerateHippedRoof — 接地部ポリゴンから寄棟屋根を生成する。

概要

geometry CG_GenerateHippedRoof(geometry geom, float8 height);

説明

2次元接地部ポリゴンから寄棟屋根を3次元 PolyhedralSurface Zで生成します。全側面の傾斜は頂部が合うように上がります。屋根の高さは地平面から heightで指定した値です (デフォルト 3.0)。

Availability: 3.7.0 - SFCGAL >= 2.3.0 が必要。

このメソッドにはSFCGALバックエンドが必要です。

この関数は多面体サーフェスに対応しています。

The footprint and hipped roof are shown side-by-side so the generated 3D faces do not hide behind the input footprint.

Code
WITH data AS (
  SELECT 'POLYGON((0 0,5 0,5 4,0 4,0 0))'::geometry AS input_footprint
)
SELECT input_footprint AS input_footprint,
       CG_GenerateHippedRoof(input_footprint, 2.0) AS hipped_roof
FROM data;
出力:
POLYGON((0 0,5 0,5 4,0 4,0 0)) | POLYHEDRALSURFACE Z (((0 4 0,5 4 0,5 0 0,0 0 0,0 4 0)),((0 4 0,0 0 0,2 2 2,0 4 0)),((0 0 0,5 0 0,3 2 2,2 2 2,0 0 0)),((5 0 0,5 4 0,3 2 2,5 0 0)),((5 4 0,0 4 0,2 2 2,3 2 2,5 4 0)))
Figure
Geometry figure for visual-cg-generatehippedroof-01