Reference·JavaScript · @bimworks/jssdkJavaScript

Geometry3d

Class in @bimworks/jssdk.

API catalogue · @bimworks/jssdk · Class

TypeScript#
class Geometry3d

API Namespace Geometry3d is used for 3D geometry related API calls.

Members#

Member Kind Description
constructor Method
calculateAlignment Method The alignment that maps points of one model (b) onto points of another (a), in millimetres. One pair moves, two pairs also turn and scale (one scale for all …
downloadGltf Method Download a glTF model (GLB) for one or multiple models.
getGeometryMetaData Method
setAlignment Method Store the alignment of a version: a 4×4 matrix, sixteen numbers column-major (translation in elements 12, 13 and 14), in millimetres, applied to the version'…

constructor#

TypeScript#
constructor()

calculateAlignment#

TypeScript#
public calculateAlignment(point1a: AlignmentPoint, point1b: AlignmentPoint, point2a?: AlignmentPoint, point2b?: AlignmentPoint, point3a?: AlignmentPoint, point3b?: AlignmentPoint): Promise<(number)[]>

The alignment that maps points of one model (b) onto points of another (a), in millimetres. One pair moves, two pairs also turn and scale (one scale for all directions), three pairs give a full linear transform.

Parameters#

Name Type Description
point1a AlignmentPoint
point1b AlignmentPoint
point2a AlignmentPoint
point2b AlignmentPoint
point3a AlignmentPoint
point3b AlignmentPoint

Returns#

Sixteen numbers, column-major, for Geometry3d.setAlignment

downloadGltf#

TypeScript#
public downloadGltf(versionUuids: Iterable<string>, query: string, options?: CallOptions): Promise<string>

Download a glTF model (GLB) for one or multiple models.

Parameters#

Name Type Description
versionUuids Iterable<string> A list of models
query string You can filter the result by providing a BQL query
options CallOptions ui: the part of the UI a person asked this from

getGeometryMetaData#

TypeScript#
public getGeometryMetaData(versionUuids: Iterable<string>): Promise<unknown>

Parameters#

Name Type Description
versionUuids Iterable<string>

setAlignment#

TypeScript#
public setAlignment(versionUuid: string, alignment: ArrayLike<number> | null): Promise<Version>

Store the alignment of a version: a 4×4 matrix, sixteen numbers column-major (translation in elements 12, 13 and 14), in millimetres, applied to the version's geometry in every viewer that loads it afterwards.

Parameters#

Name Type Description
versionUuid string The version
alignment ArrayLike<number> | null The sixteen numbers (an array or a mat4), or null to clear the alignment

Returns#

The updated version