Start clip editing in box mode
Start editing mode with current clip plane state
Start clip editing in single plane mode
Stop editing mode
When Compare tool is enabled, visalise in differencing view Models will be rendered in greyscale, detailing the difference/clash
Disable compare tool This also unloads the comparator models
Enable compare tool This starts the compare tool in clash mode
Enable compare tool This starts the compare tool in diff mode
Load comparator model for compare tool This returns a promise which will be resolved when the comparator model is loaded
teamspace
model ID
Specific revision ID/tag to load
returns a promise that resolves upon comparator model finished loading.
Compare transparent objects as of normal
Ignore semi-transparent objects in diff
Compare transparent objects as if they are opaque objects
Set an existing submodel/model as a comparator model This will return as a base model when you have cleared the comparator (i.e. disabled diff)
name of teamspace
model ID
Set tolerance threshold. In general you should not need to tweak this, but if the differencing looks off, this is the value to tweak
tolerance level for diffing/clashing
Only show the base model i.e. It will show only the original model, not the comparator nor the diff view
Only show the comparator model i.e. Only show the model you are trying to compare with, not the base model
Reset viewer background to default
Disable model caching
Disable shadows
Disable Snapping
Enable model caching
Enable hard shadows
Enable snapping to snap the cursor to the closest edge
Enable soft shadows - the highest shadow quality
Hide x y z coordinates of current point
Initialise Unity.
function to call when an error occurs. This function should take a string(message), boolean(requires reload), boolean(came from unity).
Loading another model. NOTE: this will also clear the canvas of existing models Use branch = master and revision = head to get the latest revision. If you want to know when the model finishes loading, use onLoaded
name of teamspace
name of model
ID of the branch (deprecated value)
ID of revision
returns a promise that resolves when the model start loading.
Launch the Unity Game.
the html dom of the unity canvas
host server URL (e.g. https://www.3drepo.io)
returns a promise which resolves when the game is loaded.
Offload a model that is currently loaded
name of teamspace
name of model
ID of revision
Clear the canvas and reset all settings
Set API host urls. This is needs to be called before loading model.
list of API names to use. (e.g ["https://api1.www.3drepo.io/api/"])
Set API key to use for authentication. Ensure setAPIHost is called before this.
Change the background colour of the viewer note: alpha defaults to 1 if an array of 3 numbers is sent
rgba colour value to set to e.g.[1,0,0,1] for solid red.
Set the default near plane value. This can be use to tweak situations where geometry closest to you are being clipped
the closest distance (in model units) the camera will render.
Set the maximum rending distance for shadows. Smaller value may increase shadow quality.
The maximum distance (in model units) the renderer will render shadows for
Set the number of simultaneously threads for cache access
Sets the render quality to default
Set the units By default, units are set to mm. This is used for GIS and measuring tool.
i.e. "m", "mm", "ft" etc.
Show x y z coordinates of current point
Toggle on/off rendering statistics. When it is toggled on, list of stats will be displayed in the top left corner of the viewer.
Add map source.
This can be "OSM", "HERE", "HERE_AERIAL", "HERE_TRAFFIC", "HERE_TRAFFIC_FLOW"
Initialise map tiles within unity
array of survey points and it's respective latitude and longitude value
Start map generation
Stop map generation
Remove map source.
This can be "OSM", "HERE", "HERE_AERIAL", "HERE_TRAFFIC", "HERE_TRAFFIC_FLOW"
Reset map sources. This removes all currently displayed maps
Clear all measurements
Enable the measure tool toolbar.
Disnable measure display mode to xyz.
Disable the Measuring tool.
Enable the measure tool toolbar.
Enable measure display mode to xyz.
Enable measuring tool. This will allow you to start measuring by clicking on the model
Set the measure tool mode.
The measuring mode, accepted values are "Point", "Raycast", "MinimumDistance", "SurfaceArea" or "PolygonArea".
Set the measure tool units.
The measuring units accepted values are "cm", "mm", "m"
Reset clipping plane This will also toggle edit mode to false
Get Object Status within the viewer. This will return you the list of objects that are currently set invisible, and a list of object that are currently highlighted.
The object status will be returned via the promise provided.
name of teamspace
name of the model
Hide objects that are hidden by default (e.g. IFCSpaces)
Move mesh/meshes by a given transformation matrix. NOTE: this currently only works as desired in Synchro Scenarios
teamspace of the model
modelID the meshes belongs in
array of mesh unique IDs
array of 16 numbers, representing the transformation on the meshes (row major)
Request a screenshot. The screenshot will be returned as a JSON object with a single field, ssByte, containing the screenshot in base64.
returns a promise which will resolve with an object with a screenshot in base64 format
Request the information of the current viewpoint
name of teamspace
name of model
returns a promises which will resolve with the viewpoint information
Move mesh/meshes by a given transformation matrix. NOTE: this currently only works as desired in Synchro Scenarios
teamspace of the model
modelID the meshes belongs in
array of mesh unique IDs
Sets the navigations interaction off
Sets the navigations interaction on
Change the colour of the clipping planes border
Change the width of the clipping planes border
the width of the clipping plane border
Sets the render quality to high
Sets the highlighting to show xray
Sets the highlighting to show xray
Make all hidden by default objects visible (typically IFC Spaces)
Toggle visibility of the given list of objects
name of teamspace
name of model
list of unique ids to toggle visibility
true = visible, false = invisible
Update the clipping plane to the given direction teamspace and model is only needed if the viewpoint is relative to a model Clipping plane is defined by the plane normal, distance from origin and it's direction direction = -1 means it will clip anything above the plane, 1 otherwise.
object containing the clipping plane
if set to true, A callback to viewer.clipBroadcast will be called after it is set.
name of teamspace
name of model
Zoom to highlighted meshes
Reset the viewpoint to the back of the model.
Reset the viewpoint to Bottom up view.
Move the pivot point to eh centre of the objects provided
array of json objects each recording { model: <account.modelID>, meshID: [array of mesh IDs] }
Reset the viewpoint to the front of the model.
Decrease the speed of Helicopter navigation (by x0.75)
Reset the speed of Helicopter navigation
Increase the speed of Helicopter navigation (by x1.25)
Reset the viewpoint to the left side of the model.
Reset the viewpoint to ISO view.
Reset the viewpoint to the right side of the model.
Set navigation mode.
This can be either "HELICOPTER" or "TURNTABLE"
Change the camera configuration teamspace and model is only needed if the viewpoint is relative to a model
3D point in space where the camera should be
Up vector
forward vector
point in space the camera is looking at. (pivot point)
name of teamspace
name of model
Reset the viewpoint to Top down view.
Clear all highlighting on currently highlighted objects
Highlight objects
name of teamspace
name of model
array of unique IDs associated with the objects to highlight
RGB value of the highlighting colour
If set to true, existing highlighted objects will stay highlighted. Also any objects that are already highlighted will be unhighlighted
If set to true, existing highlighted objects will be forced to re-highlight itself. This is typically used for re-colouring a highlight ] or when you want a specific set of objects to stay highlighted when toggle mode is on
Override the colour of given object(s)
teamspace the meshes resides in
model ID the meshes resides in
unique IDs of the meshes to operate on
RGB value of the override color (note: alpha will be ignored)
Override the alpha value of given object(s) If you are setting opacity to 0, use toggleVisibility instead.
teamspace the meshes resides in
model ID the meshes resides in
unique IDs of the meshes to operate on
opacity (>0 - 1) value to override with
Restore the meshes to its original color values
teamspace the meshes resides in
model ID the meshes resides in
unique IDs of the meshes to operate on
Reset override alpha value of given object(s)
teamspace the meshes resides in
model ID the meshes resides in
unique IDs of the meshes to operate on
Start rectangular select
Stop rectangular select
Unhighlight objects
name of teamspace
name of model
array of unique IDs associated with the objects to highlight
Remove a particular measurement.
The measurement id of the measurement to be removed
Hide progress bar while model is loading
Set color of a particular measurement.
The measurement id of the measurement that will change color
Set color of a particular measurement.
The measurement id of the measurement that will change name
Show progress bar while model is loading
Use orthographic view
Use perspective view
Change the colour of an existing pin
ID of the pin
colour RGB value of the colour to change to. e.g. [1, 0, 0]
Add a bookmark pin
Identifier for the pin
point in space where the pin should generate
normal vector for the pin (note: this is no longer used)
RGB value for the colour of the pin
Add an issue pin
Identifier for the pin
point in space where the pin should generate
normal vector for the pin (note: this is no longer used)
RGB value for the colour of the pin
Add a Risk pin
Identifier for the pin
point in space where the pin should generate
normal vector for the pin (note: this is no longer used)
RGB value for the colour of the pin
Remove a pin from the viewer
pin identifier
Returns a promise that lets you know when the model has finished loading.
returns a Promise that resolves when the model has finished loading. The Promise returns the bounding box of the model.
Returns a promise that lets you know when the model has started to load
returns a Promise that resolves when the model has started to load
Returns a promise that lets you know when the game is loaded.
returns a Promise that resolves when the game is loaded.
Generated using TypeDoc
viewer can be assigned, containing any callback function the user wishes to hook onto. The following functions are supported:
viewer.clipBroadcast(object): Called when a clipping plane broadcast occurs with the new clipping plane information
viewer.numClipPlanesUpdated(int): Called when the number of clipping planes changed, with the latest number of clipping planes in place
viewer.objectSelected(object): Notify the user which object/pin is clicked after a mouse event
viewer.objectsSelected(object): Notify the user which objects is selected after a rectangular select event
viewer.pickPointEvent(object): Notify the user what position within the 3D world was clicked after a mouse event.
UnityUtil.viewer = { numClipPlanesUpdated = (nPlanes) => console.log(`Current no. planes: ${nPlanes}`}