Skip to content
View as Markdown llms.txt

Facade layout

attachValues

Import from @infrared-city/infrared-sdk-ts.

attachValues(layout, columns, options): SurfaceColumns

Checks a facade layout against a result before values are draped onto it, and refuses a mismatch instead of placing values on plausible-looking wrong cells.

The layout's layoutKey must equal options.expectedLayoutKey. The key covers the geometry, synthesis parameters and surface-grid and core versions, so a rebuilt layout whose geometry drifted, even by a small hole inside a cell's footprint, has a different key and is refused before anything else is checked. Three further checks catch a result that does not belong to the layout: that columns contains each surface of the layout (joined by surface id, not by row), that its origin, axes and grid dimensions agree with the layout's, and that exactly the same grid cells carry a sensor, in the same row-major order. Frame keys must be unique across the layout. Store the layout key with every result.

Parameters

Parameter Type Description
layout FacadeLayout The layout rebuilt for the geometry you want to check.
columns SurfaceColumns The result columns (live or reloaded) to check against the layout.
options AttachValuesOptions expectedLayoutKey, the key stored with the result.

Returns

SurfaceColumns

columns, unchanged; this function only verifies.

Throws

when the layout key differs, a frame key is duplicated, a surface is missing from columns, or a surface's geometry or cell layout differs from the layout.


AttachValuesOptions

Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/tiling.

The options of attachValues.

Properties

Property Modifier Type Description
expectedLayoutKey readonly string The layoutKey you stored alongside the result when it first ran. Required. It must not be read off the layout you are checking: a layout always agrees with its own key, so that would check nothing.

FacadeCaptures

Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/tiling.

The facade captures of one client, in one capture store.

Accessors

heldBytes

Get Signature

get heldBytes(): number

The bytes held: the distinct captures and the syntheses made from them.

Returns

number


jobCount

Get Signature

get jobCount(): number

The number of jobs that hold a capture.

Returns

number


store

Get Signature

get store(): any

Returns

any

Methods

forget()

forget(jobId): void

Release a job's capture that no merge will use.

Parameters
Parameter Type
jobId string
Returns

void


forgetSchedule()

forgetSchedule(schedule): void

Release every capture of a schedule you will not merge.

Parameters
Parameter Type
schedule { jobs: ReadonlyMap<string, { jobId?: string; }>; }
schedule.jobs ReadonlyMap<string, { jobId?: string; }>
Returns

void


free()

free(): void

Free the held captures. Call it when you are done with the client.

Returns

void


lostCapture()

lostCapture(jobId): boolean

Whether the capture of this accepted job was not kept (the store refused it).

Parameters
Parameter Type
jobId string
Returns

boolean


remember()

remember(jobId, capture, cellTris): void

Keep the capture of an accepted job. cellTris: the run asked for the per-cell triangles.

Parameters
Parameter Type
jobId string
capture Uint8Array
cellTris boolean
Returns

void


wantsCellTris()

wantsCellTris(jobIds): boolean

Whether any of these jobs asked for the per-cell triangles.

Parameters
Parameter Type
jobIds readonly (string | undefined)[]
Returns

boolean


FacadeLayout

Import from @infrared-city/infrared-sdk-ts.

A rebuilt (or reloaded) facade or roof sensor layout.

Build one with synthesizeFacadeLayout or reload one with FacadeLayout.fromBytes. Call free() when finished with it in a long-running process, or declare it with using.

Accessors

coreVersion

Get Signature

get coreVersion(): string

Version of the bundled geometry engine that built this layout.

Returns

string


jobs

Get Signature

get jobs(): readonly FacadeLayoutJob[]

The rebuilt layout of each job.

Returns

readonly FacadeLayoutJob[]


layoutKey

Get Signature

get layoutKey(): string

Identifier of this layout. Store it with your results and check it on reload.

Returns

string


surfgridVersion

Get Signature

get surfgridVersion(): number

The sensor-layout version this layout was built at.

Returns

number


synthParams

Get Signature

get synthParams(): FacadeLayoutSynthParams

The sensor settings this layout was built with.

Returns

FacadeLayoutSynthParams

Methods

_surfaceRenderBuffers()

_surfaceRenderBuffers(columns): unknown

Parameters
Parameter Type
columns SurfaceColumns
Returns

unknown


[dispose]()

[dispose](): void

Lets using layout = synthesizeFacadeLayout(...) call free() at the end of its scope.

Returns

void


free()

free(): void

Release the memory this layout holds. Safe to call more than once. Every other member keeps working after free(), except toBytes(): call it before free(), unless its result was already cached by an earlier toBytes() call.

jobs also keeps returning correct data after free(): its arrays are copied out of the held memory once, at that moment. Arrays you already took from an earlier read of jobs are independent and unaffected.

Returns

void


toBytes()

toBytes(): Uint8Array

The compact export of this layout: no full-cell triangles, compressed. It never rebuilds the layout, and is computed once and cached.

Returns

Uint8Array

The bytes to store and reload with FacadeLayout.fromBytes.

Throws

when the layout was already freed and its bytes were never cached.


fromBytes()

static fromBytes(bytes, options?): FacadeLayout

Load a layout from the format FacadeLayout.toBytes produces.

Parameters
Parameter Type Description
bytes Uint8Array The bytes returned by toBytes().
options? { schedule?: AreaSchedule; } Pass schedule, the saved tiled run, when the bytes were exported from a layout built from a schedule; the reloaded layout is then shifted into the site frame exactly as the original was.
options.schedule? AreaSchedule -
Returns

FacadeLayout

The reloaded layout.


FacadeLayoutFrame

Import from @infrared-city/infrared-sdk-ts.

One coplanar surface region and its sensor cells, in canonical cell order (cells[i * nu + j]).

Properties

Property Modifier Type Description
cells readonly readonly (number | null)[] Per-cell index into this job's flat sensor arrays, null outside the surface.
gridSize readonly number Edge length of one cell.
key readonly string Identifier of this surface region.
nu readonly number Number of cells along uAxis.
nv readonly number Number of cells along vAxis.
origin readonly readonly [number, number, number] Position of the grid origin, as x, y, z.
uAxis readonly readonly [number, number, number] Direction of the grid's first axis (cell index j).
vAxis readonly readonly [number, number, number] Direction of the grid's second axis (cell index i).

FacadeLayoutJob

Import from @infrared-city/infrared-sdk-ts.

One job's rebuilt sensor layout.

Properties

Property Modifier Type Description
cellArea? readonly Float32Array<ArrayBufferLike> Area of each sensor's cell, one value per sensor, when available.
cellTris? readonly Float32Array<ArrayBufferLike> Flat triangle floats (9 per triangle), undefined without triangles.
cellTrisOffsets? readonly Uint32Array<ArrayBufferLike> sensorCount + 1: sensor s owns cellTris[cellTrisOffsets[s]..cellTrisOffsets[s+1]].
culledBelowTerrain readonly number Number of sensors dropped for lying below the terrain.
entityHashes readonly readonly string[] Content hashes of the buildings that went into this job's layout.
frames readonly readonly FacadeLayoutFrame[] The coplanar surface regions the sensors were laid out on.
hasTerrain readonly boolean Whether the layout was built against terrain.
jobId readonly string Identifier of the job.
normals readonly Float64Array Interleaved surface normals (x, y, z), one triple per sensor.
points readonly Float64Array Interleaved xyz, one triple per sensor.
sensorLayoutHash readonly string Identical to the server's hash for the same inputs and settings.
warnings readonly readonly string[] Warnings raised while building the layout.

FacadeLayoutJobSpec

Import from @infrared-city/infrared-sdk-ts.

One job to rebuild a layout for, as named in SynthesizeFacadeLayoutInput.jobs.

Properties

Property Modifier Type Description
activeIds? readonly readonly string[] Ids of the buildings this job covers. Omit for every building.
jobId readonly string Identifier of the job, as it appears on the rebuilt FacadeLayoutJob.
tileOrigin? readonly FrameOrigin The reference point (longitude and latitude) of the tile this job ran for, so the layout is rebuilt in that tile's own frame. Required alongside SynthesizeFacadeLayoutInput.siteOrigin; omit both for an untiled run.

FacadeLayoutMesh

Import from @infrared-city/infrared-sdk-ts.

A triangle mesh as the geometries and ground documents carry it. Typed arrays are accepted as they are.

Properties

Property Modifier Type Description
coordinates readonly ArrayLike<number> Flat vertex coordinates: x, y, z for each vertex.
indices readonly ArrayLike<number> Flat triangle vertex indices: three per triangle.

FacadeLayoutSynthParams

Import from @infrared-city/infrared-sdk-ts.

The sensor settings a layout was built with, echoed back.

Properties

Property Modifier Type Description
emitCellTris readonly boolean Whether the layout keeps the clipped triangles of every cell.
gridSize readonly number Sensor grid size, in metres.
maxSensors readonly number Maximum number of sensors in one job.
meshCleaning readonly "auto" | "off" The mesh cleaning mode used.
minCoverage readonly number Minimum covered fraction a partial cell needed.
mode readonly "facades" | "roofs" | "all" Which surfaces carry sensors.
offset readonly number Offset of the sensors from the surface, in metres.
partialCells readonly boolean Whether partly covered cells got sensors.

synthesizeFacadeLayout

Import from @infrared-city/infrared-sdk-ts.

synthesizeFacadeLayout(input): FacadeLayout

Rebuild a facade or roof sensor layout offline from the original inputs. It makes no network request and costs nothing. It does not compute the export bytes; call FacadeLayout.toBytes.

Parameters

Parameter Type Description
input SynthesizeFacadeLayoutInput The original scene and sensor settings of the run.

Returns

FacadeLayout

The rebuilt layout.

Throws

when schedule is passed together with siteOrigin or jobs, or when the requested layout version cannot be built.


SynthesizeFacadeLayoutInput

Import from @infrared-city/infrared-sdk-ts.

The input to synthesizeFacadeLayout: the original scene and the sensor settings of the facade or roof run to rebuild.

Properties

Property Modifier Type Description
analysisSurfaces readonly "facades" | "roofs" | "all" Which surfaces carry sensors: "facades", "roofs" or "all".
buildings readonly Readonly<Record<string, FacadeLayoutMesh>> The buildings of the run, by id.
emitCellTris? readonly boolean Whether the layout keeps the clipped triangles of every cell (FacadeLayoutJob.cellTris). Default false. Set true only to draw the old per-cell mesh or to export the geometry of each cell. Do not set it to draw with surfaceRenderBuffers: that needs only the frames, the cells and the outline, which every layout holds. The triangles make the layout about three times larger. Sensors and hashes do not change.
ground? readonly Readonly<Record<string, FacadeLayoutMesh>> Ground meshes of the run, by id. Omit when the run had none.
jobs? readonly readonly FacadeLayoutJobSpec[] Reproduce a saved run's job split. Omit for one job over every building.
maxSensorsPerJob? readonly number Maximum number of sensors in one job. Default 262144.
meshCleaning? readonly "auto" | "off" Mesh cleaning before synthesis: "auto" (default) or "off".
minCoverage? readonly number Minimum covered fraction a partial cell needs to keep a sensor. Default 0.05.
partialCells? readonly boolean Whether cells partly covered by a surface get sensors. Default true.
schedule? readonly AreaSchedule The AreaSchedule of a tiled runArea() call; derives siteOrigin and jobs from it. Mutually exclusive with passing either explicitly.
siteOrigin? readonly FrameOrigin The reference point (longitude and latitude) that the coordinates of buildings and ground are expressed around. Required alongside a job's tileOrigin.
surfaceGridSize readonly number The sensor grid size of the run, in metres.
surfaceOffset? readonly number Offset of the sensors from the surface, in metres. Default 0.1 (as a live run); set only to rebuild a layout that used another value.
surfgridVersion? readonly number The sensor-layout version to rebuild at. Omit for the bundled engine's current version, echoed back on FacadeLayout.surfgridVersion. A version that cannot be built is refused, never mapped to the nearest one.
terrainAlignment? readonly string The terrain alignment setting of the run, passed as the run used it.