Methods
Model

loadModelsFromToken

Loads models from a viewer token.

Example



Usage

JS


Parameters

url

Viewer token url.

Type

Required

String

Yes

options

Options when loading the model.

Type

Required

Object

No

Properties

Name

Type

Required

Description

color

String or Number

No

Color used on objects

headers

Object

No

Map of headers to send with the request

initialState

String

No

Initial visibility state of the model

mapObjectId

Function

No

Function for mapping the object id to a custom id

query

Object

No

Query to send with the request

transform

Object

No

Initial transform of the model

headers

Map of headers to send with the request.

Type

Map[String]

initialState

Initial visibility state of the model.

Valid values are:

  • hidden
  • visible

mapObjectId

Function for mapping the object id to a custom id.

Type

(modelId: String, objectId: String) => String

query

Query to send with the request.

Type

Map[Object]

transform

The initial transform of the model.

Name

Type

Required

Description

position

Vector3

No

Position to move to

rotation

Rotation

No

Rotation transform

scale

Vector3

No

Scale transform

Return Value

Promise that resolves to the model info for the loaded models.

Type

Promise => modelInfo: Object

modelInfo

Name

Type

Description

id

String

Id of the loaded model

boundingBox

Box3

Bounding box of the loaded model

originalBoundingBox

Box3

Bounding box without applying transform



Updated 27 Nov 2024
Did this page help you?