@urban-toolkit/autk-core / TriangulatorBuildingWithWindows
Class: TriangulatorBuildingWithWindows
Defined in: triangulator-windows.ts:81
Triangulates simplified building roofs and procedural facade windows.
The class extracts supported building footprints, reduces them to convex hulls, resolves a usable building height, and derives a facade layout by sampling hull edges across the requested floor count. Roof geometry is emitted as a triangulated fan at the resolved height, while window geometry is emitted as indexed quads centered on the generated layout entries.
Example
const [geometry, components] = TriangulatorBuildingWithWindows.buildMesh(
buildings,
origin,
floors,
);Constructors
Constructor
new TriangulatorBuildingWithWindows():
TriangulatorBuildingWithWindows
Returns
TriangulatorBuildingWithWindows
Methods
buildMesh()
staticbuildMesh(geojson,origin,floors): [LayerGeometry[],LayerComponent[]]
Defined in: triangulator-windows.ts:94
Builds renderable roof and window geometry for a building collection.
Parameters
geojson
FeatureCollection
Source building features.
origin
number[]
World-space origin used to convert generated geometry into local coordinates.
floors
number
Requested number of procedural floors for window layout.
Returns
[LayerGeometry[], LayerComponent[]]
A tuple of geometry chunks and per-feature component metadata.
Throws
Never throws. Features without a usable hull are skipped.
Example
const [meshes, comps] = TriangulatorBuildingWithWindows.buildMesh(buildings, origin, 5);buildWindowLayout()
staticbuildWindowLayout(source,floors):BuildingWindowLayoutResult
Defined in: triangulator-windows.ts:146
Generates a procedural facade-window layout for a building collection.
Parameters
source
FeatureCollection
Source building features.
floors
number
Requested number of procedural floors (clamped to ≥1).
Returns
Generated window metadata as GeoJSON points and detailed layout entries.
Throws
Never throws. Features without usable hulls are silently skipped.
Example
const { collection, windows } = TriangulatorBuildingWithWindows.buildWindowLayout(buildings, 5);resolveHeight()
staticresolveHeight(feature):number
Defined in: triangulator-windows.ts:236
Resolves an effective building height from feature and part metadata.
Parameters
feature
Feature<Geometry | null, GeoJsonProperties>
Building feature whose height metadata should be parsed.
Returns
number
Resolved building height in world units (falls back to DEFAULT_BUILDING_HEIGHT).
Throws
Never throws.
Example
const h = TriangulatorBuildingWithWindows.resolveHeight(feature);
// h → 50 (from height tag) or 20 (default)