attachValues

Import from @infrared-city/infrared-sdk.

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

ParameterTypeDescription
layoutFacadeLayoutThe layout rebuilt for the geometry you want to check.
columnsSurfaceColumnsThe result columns (live or reloaded) to check against the layout.
optionsAttachValuesOptionsexpectedLayoutKey, 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, @infrared-city/infrared-sdk/tiling.

The options of attachValues.

Properties

PropertyModifierTypeDescription
expectedLayoutKeyreadonlystringThe 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, @infrared-city/infrared-sdk/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
ParameterType
jobIdstring
Returns

void


forgetSchedule()

forgetSchedule(schedule): void

Release every capture of a schedule you will not merge.

Parameters
ParameterType
schedule\{ jobs: ReadonlyMap<string, \{ jobId?: string; \}>; \}
schedule.jobsReadonlyMap<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
ParameterType
jobIdstring
Returns

boolean


remember()

remember(jobId, capture, cellTris): void

Keep the capture of an accepted job: its bytes, or a capture already held in this store. cellTris: the run asked for the per-cell triangles.

Parameters
ParameterType
jobIdstring
captureUint8Array<ArrayBufferLike> \\{ bind: void; \}
cellTrisboolean
Returns

void


wantsCellTris()

wantsCellTris(jobIds): boolean

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

Parameters
ParameterType
jobIdsreadonly (string \undefined)\[\]
Returns

boolean


FacadeLayout

Import from @infrared-city/infrared-sdk.

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
ParameterType
columnsSurfaceColumns
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
ParameterTypeDescription
bytesUint8ArrayThe 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.

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

Properties

PropertyModifierTypeDescription
cellsreadonlyreadonly (number \null)\[\]Per-cell index into this job's flat sensor arrays, null outside the surface.
gridSizereadonlynumberEdge length of one cell.
keyreadonlystringIdentifier of this surface region.
nureadonlynumberNumber of cells along uAxis.
nvreadonlynumberNumber of cells along vAxis.
originreadonlyreadonly \[number, number, number\]Position of the grid origin, as x, y, z.
uAxisreadonlyreadonly \[number, number, number\]Direction of the grid's first axis (cell index j).
vAxisreadonlyreadonly \[number, number, number\]Direction of the grid's second axis (cell index i).

FacadeLayoutJob

Import from @infrared-city/infrared-sdk.

One job's rebuilt sensor layout.

Properties

PropertyModifierTypeDescription
cellArea?readonlyFloat32Array<ArrayBufferLike>Area of each sensor's cell, one value per sensor, when available.
cellTris?readonlyFloat32Array<ArrayBufferLike>Flat triangle floats (9 per triangle), undefined without triangles.
cellTrisOffsets?readonlyUint32Array<ArrayBufferLike>sensorCount + 1: sensor s owns cellTris[cellTrisOffsets[s]..cellTrisOffsets[s+1]].
culledBelowTerrainreadonlynumberNumber of sensors dropped for lying below the terrain.
entityHashesreadonlyreadonly string\[\]Content hashes of the buildings that went into this job's layout.
framesreadonlyreadonly FacadeLayoutFrame\[\]The coplanar surface regions the sensors were laid out on.
hasTerrainreadonlybooleanWhether the layout was built against terrain.
jobIdreadonlystringIdentifier of the job.
normalsreadonlyFloat64ArrayInterleaved surface normals (x, y, z), one triple per sensor.
pointsreadonlyFloat64ArrayInterleaved xyz, one triple per sensor.
sensorLayoutHashreadonlystringIdentical to the server's hash for the same inputs and settings.
warningsreadonlyreadonly string\[\]Warnings raised while building the layout.

FacadeLayoutJobSpec

Import from @infrared-city/infrared-sdk.

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

Properties

PropertyModifierTypeDescription
activeIds?readonlyreadonly string\[\]Ids of the buildings this job covers. Omit for every building.
jobIdreadonlystringIdentifier of the job, as it appears on the rebuilt FacadeLayoutJob.
tileOrigin?readonlyFrameOriginThe 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.

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

Properties

PropertyModifierTypeDescription
coordinatesreadonlyArrayLike<number>Flat vertex coordinates: x, y, z for each vertex.
indicesreadonlyArrayLike<number>Flat triangle vertex indices: three per triangle.

FacadeLayoutSynthParams

Import from @infrared-city/infrared-sdk.

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

Properties

PropertyModifierTypeDescription
emitCellTrisreadonlybooleanWhether the layout keeps the clipped triangles of every cell.
gridSizereadonlynumberSensor grid size, in metres.
maxSensorsreadonlynumberMaximum number of sensors in one job.
meshCleaningreadonly"auto" \"off"The mesh cleaning mode used.
minCoveragereadonlynumberMinimum covered fraction a partial cell needed.
modereadonly"facades" \"roofs" \"all"Which surfaces carry sensors.
offsetreadonlynumberOffset of the sensors from the surface, in metres.
partialCellsreadonlybooleanWhether partly covered cells got sensors.

synthesizeFacadeLayout

Import from @infrared-city/infrared-sdk.

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

ParameterTypeDescription
inputSynthesizeFacadeLayoutInputThe 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.

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

Properties

PropertyModifierTypeDescription
analysisSurfacesreadonly"facades" \"roofs" \"all"Which surfaces carry sensors: "facades", "roofs" or "all".
buildingsreadonlyReadonly<Record<string, FacadeLayoutMesh>>The buildings of the run, by id.
emitCellTris?readonlybooleanWhether 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?readonlyReadonly<Record<string, FacadeLayoutMesh>>Ground meshes of the run, by id. Omit when the run had none.
jobs?readonlyreadonly FacadeLayoutJobSpec\[\]Reproduce a saved run's job split. Omit for one job over every building.
maxSensorsPerJob?readonlynumberMaximum number of sensors in one job. Default 262144.
meshCleaning?readonly"auto" \"off"Mesh cleaning before synthesis: "auto" (default) or "off".
minCoverage?readonlynumberMinimum covered fraction a partial cell needs to keep a sensor. Default 0.05.
partialCells?readonlybooleanWhether cells partly covered by a surface get sensors. Default true.
schedule?readonlyAreaScheduleThe AreaSchedule of a tiled runArea() call; derives siteOrigin and jobs from it. Mutually exclusive with passing either explicitly.
siteOrigin?readonlyFrameOriginThe reference point (longitude and latitude) that the coordinates of buildings and ground are expressed around. Required alongside a job's tileOrigin.
surfaceGridSizereadonlynumberThe sensor grid size of the run, in metres.
surfaceOffset?readonlynumberOffset 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?readonlynumberThe 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?readonlystringThe terrain alignment setting of the run, passed as the run used it.