View

class Communicator.View()

Object representing the view associated to a model. All major functionality that affects how a model is rendered including the currently active camera, the view mode and other functionality like selection are part of this object.

Properties

Methods


Properties

View.axisTriad
Type

AxisTriad()

View.navCube
Type

NavCube()

Methods

addLight

View.addLight(light)

Adds a light to the scene. The returned promise may be rejected if there are too many lights in the scene. See Light

See also: - clearLights - removeLight - updateLight - setAmbientLightColor

Arguments
Return type

Promise <LightKey>

See also: - clearLights - removeLight - updateLight - setAmbientLightColor

advanceIncrementalSelection

View.advanceIncrementalSelection(handle)

Returns the next batch of geometry selected by the supplied selection context.

Arguments
Return type

Promise <[NodeSelectionItem()] | null>

Returns

Returns selected items. If the resulting list is null then there are no more items to select.

advanceVolumeSelection

View.advanceVolumeSelection(handle)
Deprecated

Use advanceIncrementalSelection instead.

Arguments
Return type

Promise <[NodeSelectionItem()] | null>

beginConvexPolyhedronSelection

View.beginConvexPolyhedronSelection(volumePlanes, heuristicOrigin, config)

Creates a new and active selection context for the provided selection volume. The selection volume is a convex polyhedron defined by the bounded intersection of its half-spaces.

Arguments
  • volumePlanes ([Plane()]) – The planes used to define volume. A point p is inside the volume if and only if (plane.determineSide(p) == true) for all supplied planes.

  • heuristicOrigin (Point3()) – A point used to compute distances against for prioritizing returned results. This is typically (but not necessarily) the center of the volume.

  • config (IncrementalPickConfig()) – The configuration object used for this selection operation.

Return type

Promise <IncrementalSelectionId()>

Returns

The handle for the selection context.

beginRayDrillSelection

View.beginRayDrillSelection(rayCssOrigin, rayCssBoxRadius, config)

Creates a new and active selection context for the provided selection ray. The ray is created at the supplied ray origin and is cast into the scene. Faces are selected if they lie along the ray. Lines and points are selected if they lie within the ray’s box radius.

Note: Somewhat confusingly ray drill selection is actually a selection by volume. The provided ray origin and radius are used to create a frustum to preform the selection. This has some consequences. For example, the SelectionResults returned by advancing a ray drill selection will not have selection positions, since they were not selected at a single point.

Arguments
  • rayCssOrigin (Point2()) – The coordinate in CSS pixel space for the selection ray’s origin.

  • rayCssBoxRadius (number()) – The radius around the ray in CSS pixel space used for line and point selection proximity.

  • config (IncrementalPickConfig()) – The configuration object used for this selection operation.

Return type

Promise <IncrementalSelectionId()>

Returns

The handle for the selection context.

Note: Somewhat confusingly ray drill selection is actually a selection by volume. The provided ray origin and radius are used to create a frustum to preform the selection. This has some consequences. For example, the SelectionResults returned by advancing a ray drill selection will not have selection positions, since they were not selected at a single point.

beginScreenSelectByArea

View.beginScreenSelectByArea(areaCssMin, areaCssMax, config)

Creates a new and active selection context for the provided selection window.

Arguments
  • areaCssMin (Point2()) – The minimum coodinate in CSS pixel space for the selection window.

  • areaCssMax (Point2()) – The maximum coodinate in CSS pixel space for the selection window.

  • config (IncrementalPickConfig()) – The configuration object used for this selection operation.

Return type

Promise <IncrementalSelectionId()>

Returns

The handle for the selection context.

beginSphereSelection

View.beginSphereSelection(sphereCenter, sphereRadius, config)

Creates a new and active selection context for the provided selection sphere.

Arguments
  • sphereCenter (Point3()) – The center of the selection sphere.

  • sphereRadius (number()) – The radius of the selection sphere.

  • config (IncrementalPickConfig()) – The configuration object used for this selection operation.

Return type

Promise <IncrementalSelectionId()>

Returns

The handle for the selection context.

centerCameraOnNode

View.centerCameraOnNode(nodeId[, duration[, camera]])

Centers the camera on a specified node id.

Arguments
  • nodeId (NodeId) –

  • duration (number()) – optional the number of milliseconds to transition to the new camera.

  • camera (Camera()) – optional

Return type

Promise <void>

clearLights

View.clearLights()

Removes all lights from the scene. When there are no lights, material colors are drawn at full intensity. This has the same visual effect as calling setLightingEnabled(false).

See also: - InstanceModifier.DoNotLight - setLightingEnabled

Return type

void

See also: - InstanceModifier.DoNotLight - setLightingEnabled

compositePickFromPoint

View.compositePickFromPoint(point, config)

Performs a composite picking operation. This operation will return all candidate Node entities according to the PickConfig.

Arguments
  • point (Point2()) – Canvas position to pick from.

  • config (PickConfig()) – The configuration object used for this picking operation.

Return type

Promise <CompositeSelectionItem()>

Returns

An object containing the result of the picking operation.

endComparison

View.endComparison()

Disables a visual comparison of two sets of nodes enabled by startComparison

Return type

void

endIncrementalSelection

View.endIncrementalSelection(handle)

Deactivates and destroys the provided selection context.

Arguments
Return type

DeprecatedPromise()

endVolumeSelection

View.endVolumeSelection(handle)
Deprecated

Use endIncrementalSelection instead.

Arguments
Return type

DeprecatedPromise()

fitBounding

View.fitBounding(bounding[, duration[, camera]])

Fits the camera to the bounding box.

Arguments
  • bounding (Box()) – bounding box to fit the camera.

  • duration (number()) – optional Time in milliseconds for the camera transition to the new camera view.

  • camera (Camera()) – optional

Return type

Promise <void>

Returns

A promise that will be resolved once the transition is complete.

fitNodes

View.fitNodes(ids[, duration])

Fits the camera to the bounding box containing the node ids.

Arguments
  • ids ([NodeId]) –

  • duration (number()) – optional Time in milliseconds for the camera transition to the new camera view.

Return type

Promise <void>

Returns

A promise that will be resolved once the transition is complete.

fitWorld

View.fitWorld([duration[, camera]])

Fits the view to the model bounding box.

Arguments
  • duration (number()) – optional the number of milliseconds to transition to the new camera.

  • camera (Camera()) – optional

Return type

Promise <void>

Returns

A promise that will be resolved once the transition is complete.

getAmbientLightColor

View.getAmbientLightColor()

Gets the color of the ambient light applied to the scene.

See also setAmbientLightColor

Return type

Color()

See also setAmbientLightColor

getAmbientOcclusionEnabled

View.getAmbientOcclusionEnabled()
Return type

boolean

Returns

boolean value indicating whether ambient occlusion is enabled

getAmbientOcclusionRadius

View.getAmbientOcclusionRadius()
Return type

number

Returns

the ambient occlusion radius

getAntiAliasingMode

View.getAntiAliasingMode()

Gets the anti-aliasing mode for the scene. The Default value is AntiAliasingMode.SMAA

Return type

AntiAliasingMode

Returns

the current anti-aliasing mode.

getAxisTriad

View.getAxisTriad()
Return type

AxisTriad()

getBackfacesVisible

View.getBackfacesVisible()

Gets whether backfaces are being rendered in the scene.

Return type

boolean

Returns

Boolean value indicating whether backfaces are being rendered in the scene.

getBackgroundColor

View.getBackgroundColor()

Returns the background colors of the canvas.

Return type

VerticalGradient()

Returns

the canvas background colors.

getBloomEnabled

View.getBloomEnabled()

Returns whether bloom is enabled.

See setBloomEnabled

Return type

boolean

See setBloomEnabled

getBloomIntensityScale

View.getBloomIntensityScale()

Gets the intensity of the bloom effect.

See setBloomIntensityScale

Return type

number

See setBloomIntensityScale

getBloomLayers

View.getBloomLayers()

Returns an array of objects describing each layer in the bloom effect.

See setBloomLayers

Return type

[BloomLayerInfo()]

See setBloomLayers

getBloomThreshold

View.getBloomThreshold()

Returns the minimum luminance value a pixel must have for it to contribute to bloom.

See setBloomThreshold getBloomThresholdRampWidth

Return type

number

See setBloomThreshold getBloomThresholdRampWidth

getBloomThresholdRampWidth

View.getBloomThresholdRampWidth()

Returns how much greater than the threshold set by setBloomThreshold a pixel’s luminance value must be before it contributes fully to the bloom effect.

See setBloomThresholdRampWidth

Return type

number

See setBloomThresholdRampWidth

getBoundingCalculationIgnoresInvisible

View.getBoundingCalculationIgnoresInvisible()
Return type

boolean

Returns

whether or not bounding calculations by this View object ignores invisible geometry.

getCamera

View.getCamera()

Gets the current camera

Return type

Camera()

Returns

the current camera

getCanvasSize

View.getCanvasSize()

Returns the size of the viewer canvas.

Return type

Point2()

Returns

the current size of the viewer canvas.

getDrawMode

View.getDrawMode()
Return type

DrawMode

Returns

The current draw mode

getDrawStrategy

View.getDrawStrategy()

Gets the draw strategy.

Return type

DrawStrategy

Returns

The current draw strategy.

getEyeDomeLightingBlurEdgeDistance

View.getEyeDomeLightingBlurEdgeDistance()

Returns a value that controls the maximum Z-distance between samples taken by the blur filter used in eye-dome lighting for point clouds. The value is a proportion of the screen size.

Return type

Promise <number>

getEyeDomeLightingBlurInterval

View.getEyeDomeLightingBlurInterval()

Returns the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds.

Return type

Promise <number>

getEyeDomeLightingBlurSamples

View.getEyeDomeLightingBlurSamples()

Returns the diameter of the blur filter used in eye-dome lighting for point clouds. A value of 0 means that blurring is disabled.

Return type

Promise <number>

getEyeDomeLightingEnabled

View.getEyeDomeLightingEnabled()
Return type

Promise <boolean>

Returns

boolean value indicating if eye-dome lighting is enabled or disabled.

getEyeDomeLightingOpacity

View.getEyeDomeLightingOpacity()

Returns the opacity of the shading rendered by eye-dome lighting for point clouds. The value is in the range [0,1].

Return type

Promise <number>

getEyeDomeLightingShadingEdgeDistance

View.getEyeDomeLightingShadingEdgeDistance()

Returns a value that controls the shading contrast in eye-dome lighting for point clouds. The value is a number of pixels.

Return type

Promise <number>

getFaceVisibility

View.getFaceVisibility()

Gets the face visibility for the view.

Return type

boolean

Returns

whether faces are currently being drawn.

getFullCameraMatrix

View.getFullCameraMatrix()

This is equivalent to (projectionMatrix * viewMatrix).

Return type

Matrix()

Returns

The current full camera matrix.

getGoochBaseColorProminence

View.getGoochBaseColorProminence()

Gets the prominence of the object’s base color in Gooch shading.

Return type

number

getGoochBlue

View.getGoochBlue()

Gets the value to use as the blue tone in Gooch shading.

Return type

number

getGoochLuminanceShiftStrength

View.getGoochLuminanceShiftStrength()

Gets the strength of the luminance shift in Gooch shading.

Return type

number

getGoochYellow

View.getGoochYellow()

Gets the value to use as the yellow tone in Gooch shading.

Return type

number

getGroundPlane

View.getGroundPlane()

Returns information about the invisible ground plane onto which simple shadows and reflections are projected.

See also: - setGroundPlane

Return type

GroundPlane()

See also: - setGroundPlane

getHardEdgeColor

View.getHardEdgeColor()

Returns the color of hard edges.

See also: - setHardEdgeColor - setHardEdgesEnabled

Return type

Color()

See also: - setHardEdgeColor - setHardEdgesEnabled

getHardEdgeOpacity

View.getHardEdgeOpacity()

Returns the opacity of hard edges.

See also: - setHardEdgeOpacity - setHardEdgesEnabled

Return type

number

See also: - setHardEdgeOpacity - setHardEdgesEnabled

getHardEdgeThreshold

View.getHardEdgeThreshold()

Returns the angle threshold for hard edges. Edges will be drawn between two faces whose normals diverge beyond this angle.

See also: - setHardEdgeThreshold - setHardEdgeThresholdRampWidth - setHardEdgesEnabled

Return type

number

See also: - setHardEdgeThreshold - setHardEdgeThresholdRampWidth - setHardEdgesEnabled

getHardEdgeThresholdRampWidth

View.getHardEdgeThresholdRampWidth()

Returns the value set by setHardEdgeThresholdRampWidth

This value is added to the one set by setHardEdgeThreshold to create a secondary threshold. Angles greater than the secondary threshold will result in edges with full opacity, and angles between the two thresholds will result in edges with reduced opacity.

A value of 0 means that all edges are drawn at full opacity.

See also: - setHardEdgeThresholdRampWidth - setHardEdgesEnabled

Return type

number

This value is added to the one set by setHardEdgeThreshold to create a secondary threshold. Angles greater than the secondary threshold will result in edges with full opacity, and angles between the two thresholds will result in edges with reduced opacity.

A value of 0 means that all edges are drawn at full opacity.

See also: - setHardEdgeThresholdRampWidth - setHardEdgesEnabled

getHardEdgesEnabled

View.getHardEdgesEnabled()

Returns whether hard edges are enabled. Hard edges are edges between two faces whose normals diverge beyond a given angle.

Hard edges are always enabled in hidden line mode, regardless of the return value.

See setHardEdgesEnabled

Return type

boolean

Hard edges are always enabled in hidden line mode, regardless of the return value.

See setHardEdgesEnabled

getHiddenLineSettings

View.getHiddenLineSettings()
Return type

HiddenLineSettings()

Returns

a Settings.HiddenLineSettings object.

getImageBasedLightingEnabled

View.getImageBasedLightingEnabled()

Returns whether image-based lighting is enabled for physically-based materials.

See also: - setImageBasedLightingEnabled - setImageBasedLightingIntensity - setImageBasedLightingOrientation

Return type

boolean

See also: - setImageBasedLightingEnabled - setImageBasedLightingIntensity - setImageBasedLightingOrientation

getImageBasedLightingIntensity

View.getImageBasedLightingIntensity()

Returns the intensity (brightness) of image-based lighting applied to physically-based materials.

The default value is 1.

See also: - setImageBasedLightingIntensity - setImageBasedLightingEnabled - setImageBasedLightingOrientation

Return type

number

The default value is 1.

See also: - setImageBasedLightingIntensity - setImageBasedLightingEnabled - setImageBasedLightingOrientation

getImageBasedLightingOrientation

View.getImageBasedLightingOrientation()

Returns the orientation of the image-based lighting environment applied to physically-based materials.

See also: - setImageBasedLightingOrientation - setImageBasedLightingEnabled - setImageBasedLightingIntensity

Return type

ImageBasedLightingOrientation()

See also: - setImageBasedLightingOrientation - setImageBasedLightingEnabled - setImageBasedLightingIntensity

getInteractiveDrawLimitIncreaseEnabled

View.getInteractiveDrawLimitIncreaseEnabled()

Gets whether or not the viewer will periodically attempt to increase the amount drawn during interaction.

Return type

Promise <boolean>

Returns

boolean value indicating whether this feature is enabled or not

getLight

View.getLight(key)

Get a Light given its key if it exists.

Arguments
  • key (LightKey) – The key of the light to get.

Return type

Promise <Light() | undefined>

Returns

A Light given its key if it exists.

getLightKeys

View.getLightKeys()

Get the list of light keys in the scene.

Return type

Promise <[LightKey]>

Returns

The list of light keys in the scene.

getLightingEnabled

View.getLightingEnabled()

Returns whether lighting is enabled.

See also setLightingEnabled

Return type

boolean

See also setLightingEnabled

getLineJitterEnabled

View.getLineJitterEnabled()

Returns whether line jitter is enabled.

Line jitter makes lines look ‘sketchy’ by drawing them multiple times with randomized offsets applied to the vertices.

See also: - setLineJitterEnabled - getLineJitterInstanceCount - getLineJitterRadius - getLineJitterFrequency

Return type

boolean

Line jitter makes lines look ‘sketchy’ by drawing them multiple times with randomized offsets applied to the vertices.

See also: - setLineJitterEnabled - getLineJitterInstanceCount - getLineJitterRadius - getLineJitterFrequency

getLineJitterFrequency

View.getLineJitterFrequency()

Returns the frequency of the noise used to offset line vertices when line jitter is enabled. The default value is 5.

See also: - getLineJitterEnabled - getLineJitterInstanceCount - getLineJitterRadius - setLineJitterFrequency

Return type

number

See also: - getLineJitterEnabled - getLineJitterInstanceCount - getLineJitterRadius - setLineJitterFrequency

getLineJitterInstanceCount

View.getLineJitterInstanceCount()

Returns the number of times lines are drawn when line jitter is enabled. The default value is 4.

See also: - getLineJitterEnabled - setLineJitterInstanceCount - getLineJitterRadius - getLineJitterFrequency

Return type

number

See also: - getLineJitterEnabled - setLineJitterInstanceCount - getLineJitterRadius - getLineJitterFrequency

getLineJitterRadius

View.getLineJitterRadius()

Returns the radius of the random offset applied to line vertices when line jitter is enabled. The default value is 0.005.

The value is specified as a proportion of the canvas height, where 1 means the full height of the canvas.

See also: - getLineJitterEnabled - getLineJitterInstanceCount - setLineJitterRadius - getLineJitterFrequency

Return type

number

The value is specified as a proportion of the canvas height, where 1 means the full height of the canvas.

See also: - getLineJitterEnabled - getLineJitterInstanceCount - setLineJitterRadius - getLineJitterFrequency

getLineVisibility

View.getLineVisibility()

Gets the line visibility for the view.

Return type

boolean

Returns

whether lines are currently being drawn.

getMassageExtremeCameras

View.getMassageExtremeCameras()
Return type

boolean

getNavCube

View.getNavCube()
Return type

NavCube()

getPointShape

View.getPointShape()

Gets the PointShape. See PointShape

Return type

Promise <PointShape>

getPointSize

View.getPointSize()

Gets the diameter of rendered points. See PointSizeUnit

Return type

Promise <(number, PointSizeUnit)>

getProjectionMatrix

View.getProjectionMatrix()

Gets the projection matrix.

Return type

Matrix()

Returns

The current projection matrix.

getProjectionMode

View.getProjectionMode()

Gets the projection mode.

Return type

Projection

Returns

The current projection mode.

getSilhouetteColor

View.getSilhouetteColor()

Returns the color of silhouette edges.

See also: - setSilhouetteColor - setSilhouetteEnabled

Return type

Color()

See also: - setSilhouetteColor - setSilhouetteEnabled

getSilhouetteEnabled

View.getSilhouetteEnabled()

Returns whether silhouette edges are enabled.

Silhouette edges are always enabled in hidden line mode, regardless of the return value.

See setSilhouetteEnabled

Return type

boolean

Silhouette edges are always enabled in hidden line mode, regardless of the return value.

See setSilhouetteEnabled

getSilhouetteOpacity

View.getSilhouetteOpacity()

Returns the opacity of silhouette edges.

See also: - setSilhouetteOpacity - setSilhouetteEnabled

Return type

number

See also: - setSilhouetteOpacity - setSilhouetteEnabled

getSilhouetteThreshold

View.getSilhouetteThreshold()

Returns the distance threshold for silhouette edges. This value affects the minimum z-distance required between two pixels for an edge to be drawn. A smaller value will result in more edges being drawn on finer details.

The value is a proportion of the canvas size and not a world-space distance.

See also: - setSilhouetteThreshold - setSilhouetteThresholdRampWidth - setSilhouetteEnabled

Return type

number

The value is a proportion of the canvas size and not a world-space distance.

See also: - setSilhouetteThreshold - setSilhouetteThresholdRampWidth - setSilhouetteEnabled

getSilhouetteThresholdRampWidth

View.getSilhouetteThresholdRampWidth()

Returns the value set by setSilhouetteThresholdRampWidth

This value is added to the one set by setSilhouetteThreshold to create a secondary threshold. Distances greater than the secondary threshold will result in edges with full opacity, and distances between the two thresholds will result in edges with reduced opacity.

A value of 0 means that all edges are drawn at full opacity.

See also: - setSilhouetteThresholdRampWidth - setSilhouetteEnabled

Return type

number

This value is added to the one set by setSilhouetteThreshold to create a secondary threshold. Distances greater than the secondary threshold will result in edges with full opacity, and distances between the two thresholds will result in edges with reduced opacity.

A value of 0 means that all edges are drawn at full opacity.

See also: - setSilhouetteThresholdRampWidth - setSilhouetteEnabled

getSimpleReflectionAttenuation

View.getSimpleReflectionAttenuation()

Returns properties that control how objects drawn in simple reflections fade as they move further from the ground plane.

Attenuation begins at nearDistance and increases linearly such that the model is not visible in the reflection beyond farDistance.

Attenuation is disabled if farDistance is less than or equal to nearDistance.

See also: - setSimpleReflectionAttenuation - setSimpleReflectionEnabled

Return type

function

Returns

An object with the following properties:

Attenuation begins at nearDistance and increases linearly such that the model is not visible in the reflection beyond farDistance.

Attenuation is disabled if farDistance is less than or equal to nearDistance.

See also: - setSimpleReflectionAttenuation - setSimpleReflectionEnabled

getSimpleReflectionBlurInterval

View.getSimpleReflectionBlurInterval()

Returns the distance between samples taken by the blur filter used for simple reflections.

See also: - setSimpleReflectionBlurInterval - setSimpleReflectionEnabled

Return type

(number, BlurIntervalUnit)

See also: - setSimpleReflectionBlurInterval - setSimpleReflectionEnabled

getSimpleReflectionBlurSamples

View.getSimpleReflectionBlurSamples()

Returns the diameter of the blur filter used for simple reflections. A value less than or equal to 1 means that blurring is disabled.

See also: - setSimpleReflectionBlurSamples - setSimpleReflectionEnabled

Return type

number

See also: - setSimpleReflectionBlurSamples - setSimpleReflectionEnabled

getSimpleReflectionEnabled

View.getSimpleReflectionEnabled()

Returns whether simple reflections are enabled.

See setSimpleReflectionEnabled

Return type

boolean

See setSimpleReflectionEnabled

getSimpleReflectionFadeAngle

View.getSimpleReflectionFadeAngle()

Returns the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.

A value to 0 means that the fading effect is disabled.

Regardless of the value, simple reflections will not be drawn if the camera is below the ground plane.

See also: - setSimpleReflectionFadeAngle - setSimpleReflectionEnabled

Return type

number

A value to 0 means that the fading effect is disabled.

Regardless of the value, simple reflections will not be drawn if the camera is below the ground plane.

See also: - setSimpleReflectionFadeAngle - setSimpleReflectionEnabled

getSimpleReflectionOpacity

View.getSimpleReflectionOpacity()

Returns the opacity of simple reflections.

See also: - setSimpleReflectionOpacity - setSimpleReflectionEnabled

Return type

number

See also: - setSimpleReflectionOpacity - setSimpleReflectionEnabled

getSimpleShadowBlurInterval

View.getSimpleShadowBlurInterval()

Returns the distance in pixels between samples taken by the blur filter used for simple shadows.

See also: - setSimpleShadowBlurInterval - setSimpleShadowEnabled

Return type

number

See also: - setSimpleShadowBlurInterval - setSimpleShadowEnabled

getSimpleShadowBlurSamples

View.getSimpleShadowBlurSamples()

Returns the diameter of the blur filter used for simple shadows.

See also: - setSimpleShadowBlurSamples - setSimpleShadowEnabled

Return type

number

See also: - setSimpleShadowBlurSamples - setSimpleShadowEnabled

getSimpleShadowColor

View.getSimpleShadowColor()

Returns the color of simple shadows.

See also: - setSimpleShadowColor - setSimpleShadowEnabled

Return type

Color()

See also: - setSimpleShadowColor - setSimpleShadowEnabled

getSimpleShadowEnabled

View.getSimpleShadowEnabled()

Returns whether simple shadows are enabled.

See setSimpleShadowEnabled

Return type

boolean

See setSimpleShadowEnabled

getSimpleShadowInteractiveUpdateEnabled

View.getSimpleShadowInteractiveUpdateEnabled()

Returns whether simple shadows will be updated during user interaction.

See also: - setSimpleShadowInteractiveUpdateEnabled - setSimpleShadowEnabled

Return type

boolean

See also: - setSimpleShadowInteractiveUpdateEnabled - setSimpleShadowEnabled

getSimpleShadowOpacity

View.getSimpleShadowOpacity()

Returns the opacity of simple shadows.

See also: - setSimpleShadowOpacity - setSimpleShadowEnabled

Return type

number

See also: - setSimpleShadowOpacity - setSimpleShadowEnabled

getSimpleShadowResolution

View.getSimpleShadowResolution()

Returns the width and height in pixels of the texture image into which simple shadows are drawn.

See also: - getSimpleShadowResolution - setSimpleShadowEnabled

Return type

number

See also: - getSimpleShadowResolution - setSimpleShadowEnabled

getToonShadingBandCount

View.getToonShadingBandCount()

Gets the current number of discrete shading bands that will be used when toon shading is enabled.

Return type

number

getToonShadingSpecularFactor

View.getToonShadingSpecularFactor()

Gets the current toon shading specular scale factor.

Return type

number

getViewMatrix

View.getViewMatrix()

Gets the view matrix.

Return type

Matrix()

Returns

The current view matrix.

getViewOrientationCamera

View.getViewOrientationCamera(orientation[, bounding[, preserveModelUp]])

Returns a camera set to a ViewOrientation

Arguments
  • orientation (ViewOrientation) – The desired view orientation for the camera.

  • bounding (Box()) – optional Optional bounding to fit the camera about. If not supplied, the model bounding will be used.

  • preserveModelUp (boolean()) – optional

Return type

Promise <Camera()>

isolateNodes

View.isolateNodes(nodeIds[, duration[, fitNodes[, initiallyHiddenStayHidden]]])

Hides all nodes except those specified. Also fits the camera to those nodes’ bounding box.

Arguments
  • nodeIds ([NodeId]) – An array of the node IDs to be isolated.

  • duration (number()) – optional Time in milliseconds for the camera transition to the new camera view.

  • fitNodes (boolean()) – optional If true, then the view is fitted around the isolated nodes.

  • initiallyHiddenStayHidden (boolean | null()) – optional Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by setBehaviorInitiallyHidden

Return type

Promise <void>

pickAllFromPoint

View.pickAllFromPoint(point, config)

Performs a picking operation from the given position on the canvas. All candidate entities are returned. This method does not trigger a selection event. This method will reject if the point is outside the canvas area.

Arguments
  • point (Point2()) – Canvas position to pick from.

  • config (PickConfig()) – The configuration object used for this picking operation.

Return type

Promise <[NodeEntitySelectionItem()]>

Returns

An object containing the result of the picking operation.

pickAllFromRay

View.pickAllFromRay(ray, config)

Performs a selection operation from the given world-space ray. All candidate entities are returned. This method does not trigger a selection event.

Arguments
  • ray (Ray()) – The world-space ray to perform the selection with.

  • config (PickConfig()) – The configuration object used for this picking operation.

Return type

Promise <[NodeEntitySelectionItem()]>

Returns

An object containing the result of the picking operation.

pickFromPoint

View.pickFromPoint(point, config)

Performs a picking operation from the given position on the canvas. The best candidate entity is be returned. This method does not trigger a selection event. This method will reject if the point is outside the canvas area.

Arguments
  • point (Point2()) – Canvas position to pick from.

  • config (PickConfig()) – The configuration object used for this picking operation.

Return type

Promise <SelectionItem()>

Returns

An object containing the result of the picking operation.

pickFromRay

View.pickFromRay(ray, config)

Performs a selection operation from the given world-space ray. The best candidate entity is be returned. This method does not trigger a selection event.

Arguments
  • ray (Ray()) – The world-space ray to perform the selection with.

  • config (PickConfig()) – The configuration object used for this picking operation.

Return type

Promise <SelectionItem()>

Returns

An object containing the result of the picking operation.

pointToWindowPosition

View.pointToWindowPosition(pt)

Creates a normalized window position in the range of (-1, 1) for a given point in window space.

Arguments
Return type

Point2()

Returns

the normalized window position

projectPoint

View.projectPoint(source[, camera])

Projects a 3d world space point to a 3d screen space point.

Arguments
  • source (Point3()) –

  • camera (Camera()) – optional if a camera is provided, its projection and view matrix will be used.

Return type

Point3()

Returns

point projected into 3d screen space.

raycastFromPoint

View.raycastFromPoint(point)

Creates a ray based on a viewport position.

Arguments
  • point (Point2()) – The (X, Y) viewport position.

Return type

Ray() | null

Returns

The ray if it was generated, otherwise null.

removeLight

View.removeLight(key)

removes a light from the scene. See Light

See also: - addLight - clearLights - updateLight

Arguments
Return type

void

See also: - addLight - clearLights - updateLight

resetCamera

View.resetCamera([duration])

Resets the camera to the initial view of the model when first loaded.

Arguments
  • duration (number()) – optional the amount of time in milliseconds that the camera transition between the current and initial view should take.

Return type

Promise <void>

setAmbientLightColor

View.setAmbientLightColor(value)

Sets the color of the ambient light applied to the scene. This is a constant source of light that affects every point in the scene in the same way regardless of position or surface normal.

See also getAmbientLightColor

Arguments
Return type

void

See also getAmbientLightColor

setAmbientOcclusionEnabled

View.setAmbientOcclusionEnabled([enabled])

Sets whether ambient occlusion is enabled

Arguments
  • enabled (boolean()) – optional sets whether ambient occlusion will be enabled

Return type

DeprecatedPromise()

setAmbientOcclusionRadius

View.setAmbientOcclusionRadius(radius)

Sets the ambient occlusion radius. This value represents the maximum screen-proportional distance between two points such that one will cast a shadow on the other.

Arguments
  • radius (number()) – the ambient occlusion radius.

Return type

DeprecatedPromise()

setAntiAliasingMode

View.setAntiAliasingMode(antiAliasingMode)

Sets the anti-aliasing mode for the scene.

Arguments
Return type

DeprecatedPromise()

setBackfacesVisible

View.setBackfacesVisible(visible)

Sets whether backfaces should be rendered in the scene.

Arguments
  • visible (boolean()) – Boolean value indicating whether backfaces should be rendered.

Return type

DeprecatedPromise()

Returns

Promise that is resolved when this operation has completed.

setBackgroundColor

View.setBackgroundColor([top[, bottom]])

Sets the viewer background color to a gradient interpolating from the top to bottom color. For a solid color, the top and bottom color should have the same values. Background Transparency is only available with client-side rendering. To re-enable a transparent background, pass null to the parameters of this function.

When draw mode is set to {@link DrawMode.HiddenLine}, the background color is defined in {@link Communicator.Settings.HiddenLineSettings HiddenLineSettings}. See {@link Communicator.Settings.HiddenLineSettings.setBackgroundColor HiddenLineSettings.setBackgroundColor}.

Arguments
  • top (Color() | null) – optional the top color for the the background gradient.

  • bottom (Color() | null) – optional the bottom color for the the background gradient.

Return type

DeprecatedPromise()

Returns

a promise that resolves when the operation has completed.

When draw mode is set to {@link DrawMode.HiddenLine}, the background color is defined in {@link Communicator.Settings.HiddenLineSettings HiddenLineSettings}. See {@link Communicator.Settings.HiddenLineSettings.setBackgroundColor HiddenLineSettings.setBackgroundColor}.

setBloomEnabled

View.setBloomEnabled([value])

Sets whether bloom is enabled.

See getBloomEnabled

Arguments
  • value (boolean()) – optional

Return type

void

See getBloomEnabled

setBloomIntensityScale

View.setBloomIntensityScale(value)

Sets the intensity of the bloom effect. This value is multiplied by the intensities of the individual layers set by setBloomLayers

See getBloomIntensityScale

Arguments
  • value (number()) –

Return type

void

See getBloomIntensityScale

setBloomLayers

View.setBloomLayers(layers)

Sets the number of layers in the bloom effect and the layers’ attributes.

The bloom effect is achieved by applying a luminance filter to the source image, then progressively downsampling, blurring, and adding the results together. The result of each downsample/blur operation is fed into the next, which is executed at half the resolution of the previous. The number of stages and the behavior of each stage are controlled by this function.

See BloomLayerInfo getBloomLayers

Arguments
Return type

void

The bloom effect is achieved by applying a luminance filter to the source image, then progressively downsampling, blurring, and adding the results together. The result of each downsample/blur operation is fed into the next, which is executed at half the resolution of the previous. The number of stages and the behavior of each stage are controlled by this function.

See BloomLayerInfo getBloomLayers

setBloomThreshold

View.setBloomThreshold(value)

Sets the minimum luminance value a pixel must have for it to contribute to bloom. The value should be in the range [0,1].

See getBloomThreshold setBloomThresholdRampWidth

Arguments
  • value (number()) –

Return type

void

See getBloomThreshold setBloomThresholdRampWidth

setBloomThresholdRampWidth

View.setBloomThresholdRampWidth(value)

Sets how much greater than the threshold set by setBloomThreshold a pixel’s luminance value must be before it contributes fully to the bloom effect.

If the pixel’s luminance value does not exceed the threshold by at least the amount set by this function, the pixel’s contribution will be diminished based on how close its luminance value is to the threshold.

See getBloomThresholdRampWidth

Arguments
  • value (number()) –

Return type

void

If the pixel’s luminance value does not exceed the threshold by at least the amount set by this function, the pixel’s contribution will be diminished based on how close its luminance value is to the threshold.

See getBloomThresholdRampWidth

setBoundingCalculationIgnoresInvisible

View.setBoundingCalculationIgnoresInvisible(value)

Sets whether or not bounding calculations by this View object ignores invisible geometry.

Arguments
  • value (boolean()) –

Return type

void

setCamera

View.setCamera(camera[, duration])

Sets the current camera

Arguments
  • camera (Camera() | null) – the camera to set

  • duration (number()) – optional camera transition time in milliseconds

Return type

boolean

setDisplayIncompleteFrames

View.setDisplayIncompleteFrames(value)

Sets whether intermediate frames of an incremental draw will be displayed. (default: true)

If false, the image will only be displayed once completely drawn, except immediately after certain operations, such as setting the camera. To disable these exceptions, call setInteractiveDrawDelay with a value of 0.

Arguments
  • value (boolean()) –

Return type

DeprecatedPromise()

If false, the image will only be displayed once completely drawn, except immediately after certain operations, such as setting the camera. To disable these exceptions, call setInteractiveDrawDelay with a value of 0.

setDrawMode

View.setDrawMode(drawMode)

Sets the drawing mode for the scene.

Arguments
  • drawMode (DrawMode) – The drawing mode to set.

Return type

DeprecatedPromise()

setEyeDomeLightingBlurEdgeDistance

View.setEyeDomeLightingBlurEdgeDistance(value)

Controls the maximum Z-distance between samples taken by the blur filter used in eye-dome lighting for point clouds. The value is taken as a proportion of the screen size. Decreasing the value will result in sharper edges, and increasing the value will result in softer edges. (default: .03)

Arguments
  • value (number()) –

Return type

DeprecatedPromise()

setEyeDomeLightingBlurInterval

View.setEyeDomeLightingBlurInterval(value)

Sets the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds. (default: 1)

Arguments
  • value (number()) –

Return type

DeprecatedPromise()

setEyeDomeLightingBlurSamples

View.setEyeDomeLightingBlurSamples(value)

Sets the diameter of the blur filter used in eye-dome lighting for point clouds. Setting the value to 0 will disable blurring. (default: 7)

Arguments
  • value (number()) –

Return type

DeprecatedPromise()

setEyeDomeLightingEnabled

View.setEyeDomeLightingEnabled([enabled])

Enables or disables eye-dome lighting for point clouds. (default: disabled)

Arguments
  • enabled (boolean()) – optional

Return type

DeprecatedPromise()

setEyeDomeLightingOpacity

View.setEyeDomeLightingOpacity(value)

Sets the opacity of the shading rendered by eye-dome lighting for point clouds. (default: 1)

Arguments
  • value (number()) – A number in the range [0,1].

Return type

DeprecatedPromise()

setEyeDomeLightingShadingEdgeDistance

View.setEyeDomeLightingShadingEdgeDistance(value)

Controls the shading contrast in eye-dome lighting for point clouds. The value is taken as a number of pixels. Increasing the value will result in overall lighter shading, and decreasing the value will result in overall darker shading. (default: 2)

Arguments
  • value (number()) –

Return type

DeprecatedPromise()

setFaceVisibility

View.setFaceVisibility(faceVisibility)

Sets the face visibility for the view.

Arguments
  • faceVisibility (boolean()) – indicates whether to draw faces.

Return type

DeprecatedPromise()

setGoochBaseColorProminence

View.setGoochBaseColorProminence(prominence)

Sets the prominence of the object’s base color in Gooch shading.

Arguments
  • prominence (number()) – this scalar value determines the amount of the object’s base color is applied to the final shaded color.

Return type

void

setGoochBlue

View.setGoochBlue(blue)

Sets the value to use as the blue tone in Gooch shading.

Arguments
  • blue (number()) – the blue tone. This value should be in the range [0,1]

Return type

void

setGoochLuminanceShiftStrength

View.setGoochLuminanceShiftStrength(shiftStrength)

Sets the strength of the luminance shift in Gooch shading.

Arguments
  • shiftStrength (number()) – this scalar values determines the amount of luminance shift that is applied to the object’s base color

Return type

void

setGoochYellow

View.setGoochYellow(yellow)

Sets the value to use as the yellow tone in Gooch shading.

Arguments
  • yellow (number()) – the yellow tone. This value should be in the range [0,1]

Return type

void

setGroundPlane

View.setGroundPlane(plane)

Defines the invisible ground plane onto which simple shadows and reflections are projected.

See also: - getGroundPlane - setSimpleShadowEnabled - setSimpleReflectionEnabled

Arguments
Return type

void

See also: - getGroundPlane - setSimpleShadowEnabled - setSimpleReflectionEnabled

setHardEdgeColor

View.setHardEdgeColor(value)

Sets the color of hard edges.

See also: - getHardEdgeColor - setHardEdgesEnabled

Arguments
  • value (Color()) – The color to set.

Return type

void

See also: - getHardEdgeColor - setHardEdgesEnabled

setHardEdgeOpacity

View.setHardEdgeOpacity(value)

Sets the opacity of hard edges.

See also: - getHardEdgeOpacity - setHardEdgesEnabled

Arguments
  • value (number()) – The opacity to set.

Return type

void

See also: - getHardEdgeOpacity - setHardEdgesEnabled

setHardEdgeThreshold

View.setHardEdgeThreshold(degrees)

Sets the angle threshold for hard edges. Edges will be drawn between two faces whose normals diverge beyond this angle.

See also: - getHardEdgeThreshold - setHardEdgeThresholdRampWidth - setHardEdgesEnabled

Arguments
  • degrees (number()) – The threshold to set.

Return type

void

See also: - getHardEdgeThreshold - setHardEdgeThresholdRampWidth - setHardEdgesEnabled

setHardEdgeThresholdRampWidth

View.setHardEdgeThresholdRampWidth(degrees)

Controls how quickly edges fade as the angle between adjacent faces decreases.

This value is added to the one set by setHardEdgeThreshold to create a secondary threshold. Angles greater than the secondary threshold will result in edges with full opacity, and angles between the two thresholds will result in edges with reduced opacity.

Setting this value to 0 will cause all edges to be drawn at full opacity.

See also: - getHardEdgeThresholdRampWidth - setHardEdgesEnabled

Arguments
  • degrees (number()) –

Return type

void

This value is added to the one set by setHardEdgeThreshold to create a secondary threshold. Angles greater than the secondary threshold will result in edges with full opacity, and angles between the two thresholds will result in edges with reduced opacity.

Setting this value to 0 will cause all edges to be drawn at full opacity.

See also: - getHardEdgeThresholdRampWidth - setHardEdgesEnabled

setHardEdgesEnabled

View.setHardEdgesEnabled([value])

Enables or disables hard edges. Hard edges are edges between two faces whose normals diverge beyond a given angle.

Hard edges are always enabled in hidden line mode.

See also: - getHardEdgesEnabled - setHardEdgeColor - setHardEdgeOpacity - setHardEdgeThreshold - setHardEdgeThresholdRampWidth

Arguments
  • value (boolean()) – optional Whether hard edges should be enabled.

Return type

void

Hard edges are always enabled in hidden line mode.

See also: - getHardEdgesEnabled - setHardEdgeColor - setHardEdgeOpacity - setHardEdgeThreshold - setHardEdgeThresholdRampWidth

setImageBasedLightingEnabled

View.setImageBasedLightingEnabled(value)

Sets whether image-based lighting is enabled for physically-based materials.

See also: - getImageBasedLightingEnabled - setImageBasedLightingIntensity - setImageBasedLightingOrientation

Arguments
  • value (boolean()) –

Return type

void

See also: - getImageBasedLightingEnabled - setImageBasedLightingIntensity - setImageBasedLightingOrientation

setImageBasedLightingEnvironment

View.setImageBasedLightingEnvironment(data)

Sets the environment image used by image-based lighting applied to physically-based materials.

Passing null will cause the default environment image to be used.

The image should be a cube map in KTX2 format with a space-separated list of spherical harmonics coefficients stored under the “sh” metadata key.

A compatible image can be created from an equirectangular source image (such as those found at HDRI Haven) with the following process:

cmgen -x out --format=ktx --size=256 in.hdr
ktx2ktx2 -o uncompressed.ktx2 out/out_ibl.ktx
ktxsc --zcmp 20 -o out.ktx2 uncompressed.ktx2
Arguments
  • data (Uint8Array | null()) –

Return type

void

Passing null will cause the default environment image to be used.

The image should be a cube map in KTX2 format with a space-separated list of spherical harmonics coefficients stored under the “sh” metadata key.

A compatible image can be created from an equirectangular source image (such as those found at HDRI Haven) with the following process:

cmgen -x out --format=ktx --size=256 in.hdr
ktx2ktx2 -o uncompressed.ktx2 out/out_ibl.ktx
ktxsc --zcmp 20 -o out.ktx2 uncompressed.ktx2

setImageBasedLightingIntensity

View.setImageBasedLightingIntensity(value)

Sets the intensity (brightness) of image-based lighting applied to physically-based materials.

The default value is 1.

See also: - getImageBasedLightingIntensity - setImageBasedLightingEnabled - setImageBasedLightingOrientation

Arguments
  • value (number()) –

Return type

void

The default value is 1.

See also: - getImageBasedLightingIntensity - setImageBasedLightingEnabled - setImageBasedLightingOrientation

setImageBasedLightingOrientation

View.setImageBasedLightingOrientation(value)

Sets the orientation of the image-based lighting environment applied to physically-based materials.

See also: - getImageBasedLightingOrientation - setImageBasedLightingEnabled - setImageBasedLightingIntensity

Arguments
Return type

void

See also: - getImageBasedLightingOrientation - setImageBasedLightingEnabled - setImageBasedLightingIntensity

setInitialCamera

View.setInitialCamera(camera)

Sets the camera that will be used for the initial camera view.

Arguments
Return type

void

setInteractiveDrawDelay

View.setInteractiveDrawDelay(value)

Sets how long after certain operations, such as setting the camera, to wait before starting a redraw. This delay exists in order to prevent flicker during continuous interaction. The initial value is 200ms.

Arguments
  • value (number()) – The delay in milliseconds

Return type

DeprecatedPromise()

setInteractiveDrawLimitIncreaseEnabled

View.setInteractiveDrawLimitIncreaseEnabled(enable)

Sets whether or not the viewer will periodically attempt to increase the amount drawn during interaction. Setting this to false may improve periodic framerate dips caused by such adjustments.

Arguments
  • enable (boolean()) –

Return type

void

setLightingEnabled

View.setLightingEnabled([enabled])

Sets whether lighting is enabled. When disabled, material colors are drawn at full intensity.

See also InstanceModifier.DoNotLight clearLights

Arguments
  • enabled (boolean()) – optional

Return type

DeprecatedPromise()

See also InstanceModifier.DoNotLight clearLights

setLineJitterEnabled

View.setLineJitterEnabled([value])

Sets whether line jitter is enabled.

Line jitter makes lines look ‘sketchy’ by drawing them multiple times with randomized offsets applied to the vertices.

See also: - getLineJitterEnabled - setLineJitterInstanceCount - setLineJitterRadius - setLineJitterFrequency

Arguments
  • value (boolean()) – optional

Return type

void

Line jitter makes lines look ‘sketchy’ by drawing them multiple times with randomized offsets applied to the vertices.

See also: - getLineJitterEnabled - setLineJitterInstanceCount - setLineJitterRadius - setLineJitterFrequency

setLineJitterFrequency

View.setLineJitterFrequency(value)

Sets the frequency of the noise used to offset line vertices when line jitter is enabled. The default value is 5.

Decreasing this value causes lines to appear smoother, while increasing it causes lines to look more noisy.

See also: - setLineJitterEnabled - setLineJitterInstanceCount - setLineJitterRadius - getLineJitterFrequency

Arguments
  • value (number()) –

Return type

void

Decreasing this value causes lines to appear smoother, while increasing it causes lines to look more noisy.

See also: - setLineJitterEnabled - setLineJitterInstanceCount - setLineJitterRadius - getLineJitterFrequency

setLineJitterInstanceCount

View.setLineJitterInstanceCount(value)

Sets the number of times lines are drawn when line jitter is enabled. The default value is 4.

Increasing this number can make the lines look more ‘sketchy.’

See also: - setLineJitterEnabled - getLineJitterInstanceCount - setLineJitterRadius - setLineJitterFrequency

Arguments
  • value (number()) –

Return type

void

Increasing this number can make the lines look more ‘sketchy.’

See also: - setLineJitterEnabled - getLineJitterInstanceCount - setLineJitterRadius - setLineJitterFrequency

setLineJitterRadius

View.setLineJitterRadius(value)

Sets the radius of the random offset applied to line vertices when line jitter is enabled. The default value is 0.005.

The value is specified as a proportion of the canvas height, where 1 means the full height of the canvas.

See also: - setLineJitterEnabled - setLineJitterInstanceCount - getLineJitterRadius - setLineJitterFrequency

Arguments
  • value (number()) –

Return type

void

The value is specified as a proportion of the canvas height, where 1 means the full height of the canvas.

See also: - setLineJitterEnabled - setLineJitterInstanceCount - getLineJitterRadius - setLineJitterFrequency

setLineVisibility

View.setLineVisibility(lineVisibility)

Sets the line visibility for the view.

Arguments
  • lineVisibility (boolean()) – indicates whether to draw lines.

Return type

DeprecatedPromise()

setMassageExtremeCameras

View.setMassageExtremeCameras(value)

Sets whether to change cad view cameras with extreme values to functionally identical cameras with better behavior. This should be disabled if it is important that cameras have their authored values Default: true

Arguments
  • value (boolean()) – Whether to modify cameras

Return type

void

setPointShape

View.setPointShape(shape)

Controls the appearance of rendered points. (default: Square) See PointShape

Arguments
Return type

DeprecatedPromise()

setPointSize

View.setPointSize(size, unit)

Sets the diameter of rendered points. (default: 1, ScreenPixels) See PointSizeUnit

Arguments
Return type

DeprecatedPromise()

setPointVisibilityTest

View.setPointVisibilityTest(points)

Sets a list of points whose visibility will be tested every time a frame is drawn by comparing them to the frame’s depth buffer. Points that are partially obscured by transparent objects are considered visible.

The results are passed to the CallbackMap.frameDrawn callback so that UI elements may be updated in sync with rendering.

See also testPointVisibility

Arguments
  • points ([Point3()]) – The points to test. An empty array will disable the test.

Return type

void

The results are passed to the CallbackMap.frameDrawn callback so that UI elements may be updated in sync with rendering.

See also testPointVisibility

setProjectionMode

View.setProjectionMode(projectionMode)

Sets the projection mode.

Arguments
Return type

void

setSilhouetteColor

View.setSilhouetteColor(value)

Sets the color of silhouette edges.

See also: - getSilhouetteColor - setSilhouetteEnabled

Arguments
  • value (Color()) – The color to set.

Return type

void

See also: - getSilhouetteColor - setSilhouetteEnabled

setSilhouetteEnabled

View.setSilhouetteEnabled([value])

Enables or disables silhouette edges.

Silhouette edges are always enabled in hidden line mode.

See also: - getSilhouetteEnabled - setSilhouetteColor - setSilhouetteOpacity - setSilhouetteThreshold - setSilhouetteThresholdRampWidth

Arguments
  • value (boolean()) – optional Whether silhouette edges should be enabled.

Return type

void

Silhouette edges are always enabled in hidden line mode.

See also: - getSilhouetteEnabled - setSilhouetteColor - setSilhouetteOpacity - setSilhouetteThreshold - setSilhouetteThresholdRampWidth

setSilhouetteOpacity

View.setSilhouetteOpacity(value)

Sets the opacity of silhouette edges.

See also: - getSilhouetteOpacity - setSilhouetteEnabled

Arguments
  • value (number()) – The opacity to set.

Return type

void

See also: - getSilhouetteOpacity - setSilhouetteEnabled

setSilhouetteThreshold

View.setSilhouetteThreshold(value)

Sets the distance threshold for silhouette edges. This value affects the minimum z-distance required between two pixels for an edge to be drawn. A smaller value will result in more edges being drawn on finer details.

The value is a proportion of the canvas size and not a world-space distance.

See also: - getSilhouetteThreshold - setSilhouetteThresholdRampWidth - setSilhouetteEnabled

Arguments
  • value (number()) – The threshold to set.

Return type

void

The value is a proportion of the canvas size and not a world-space distance.

See also: - getSilhouetteThreshold - setSilhouetteThresholdRampWidth - setSilhouetteEnabled

setSilhouetteThresholdRampWidth

View.setSilhouetteThresholdRampWidth(value)

Controls how quickly edges fade as z-distance between pixels decreases.

This value is added to the one set by setSilhouetteThreshold to create a secondary threshold. Distances greater than the secondary threshold will result in edges with full opacity, and distances between the two thresholds will result in edges with reduced opacity.

Setting this value to 0 will cause all edges to be drawn at full opacity.

See also: - getSilhouetteThresholdRampWidth - setSilhouetteEnabled

Arguments
  • value (number()) –

Return type

void

This value is added to the one set by setSilhouetteThreshold to create a secondary threshold. Distances greater than the secondary threshold will result in edges with full opacity, and distances between the two thresholds will result in edges with reduced opacity.

Setting this value to 0 will cause all edges to be drawn at full opacity.

See also: - getSilhouetteThresholdRampWidth - setSilhouetteEnabled

setSimpleReflectionAttenuation

View.setSimpleReflectionAttenuation(nearDistance, farDistance[, unit])

Controls how objects drawn in simple reflections fade as they move further from the ground plane.

Attenuation begins at nearDistance and increases linearly such that the model is not visible in the reflection beyond farDistance.

Attenuation is disabled if farDistance is less than or equal to nearDistance.

See also: - getSimpleReflectionAttenuation - setSimpleReflectionEnabled

Arguments
  • nearDistance (number()) – The distance from the ground plane at which objects begin to fade.

  • farDistance (number()) – The distance from the ground plane at which objects are completely faded.

  • unit (SimpleReflectionAttenuationUnit) – optional The unit in which nearDistance and farDistance are specified. If unspecified, SimpleReflectionAttenuationUnit.World will be used.

Return type

void

Attenuation begins at nearDistance and increases linearly such that the model is not visible in the reflection beyond farDistance.

Attenuation is disabled if farDistance is less than or equal to nearDistance.

See also: - getSimpleReflectionAttenuation - setSimpleReflectionEnabled

setSimpleReflectionBlurInterval

View.setSimpleReflectionBlurInterval(value[, unit])

Sets the distance between samples taken by the blur filter used for simple reflections.

See also: - getSimpleReflectionBlurInterval - setSimpleReflectionEnabled

Arguments
  • value (number()) – The interval to set.

  • unit (BlurIntervalUnit) – optional The unit in which the value argument is specified.

Return type

void

See also: - getSimpleReflectionBlurInterval - setSimpleReflectionEnabled

setSimpleReflectionBlurSamples

View.setSimpleReflectionBlurSamples(value)

Sets the diameter of the blur filter used for simple reflections. Setting the value less than or equal to 1 will disable blurring.

See also: - getSimpleReflectionBlurSamples - setSimpleReflectionEnabled

Arguments
  • value (number()) –

Return type

void

See also: - getSimpleReflectionBlurSamples - setSimpleReflectionEnabled

setSimpleReflectionEnabled

View.setSimpleReflectionEnabled([value])

Enables or disables simple reflections projected onto an invisible ground plane.

See also: - getSimpleReflectionEnabled - setSimpleReflectionOpacity - setSimpleReflectionBlurSamples - setSimpleReflectionBlurInterval - setSimpleReflectionFadeAngle

Arguments
  • value (boolean()) – optional

Return type

void

See also: - getSimpleReflectionEnabled - setSimpleReflectionOpacity - setSimpleReflectionBlurSamples - setSimpleReflectionBlurInterval - setSimpleReflectionFadeAngle

setSimpleReflectionFadeAngle

View.setSimpleReflectionFadeAngle(degrees)

Sets the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.

Settings the value to 0 will disable the fading effect.

Regardless of the value, simple reflections will not be drawn if the camera is below the ground plane.

See also: - getSimpleReflectionFadeAngle - setSimpleReflectionEnabled

Arguments
  • degrees (number()) – The angle in degrees.

Return type

void

Settings the value to 0 will disable the fading effect.

Regardless of the value, simple reflections will not be drawn if the camera is below the ground plane.

See also: - getSimpleReflectionFadeAngle - setSimpleReflectionEnabled

setSimpleReflectionOpacity

View.setSimpleReflectionOpacity(value)

Sets the opacity of simple reflections.

See also: - getSimpleReflectionOpacity - setSimpleReflectionEnabled

Arguments
  • value (number()) –

Return type

void

See also: - getSimpleReflectionOpacity - setSimpleReflectionEnabled

setSimpleShadowBlurInterval

View.setSimpleShadowBlurInterval(value)

Sets the distance in pixels between samples taken by the blur filter used for simple shadows.

See also: - getSimpleShadowBlurInterval - setSimpleShadowEnabled

Arguments
  • value (number()) – The interval to set.

Return type

void

See also: - getSimpleShadowBlurInterval - setSimpleShadowEnabled

setSimpleShadowBlurSamples

View.setSimpleShadowBlurSamples(value)

Sets the diameter of the blur filter used for simple shadows. Setting the value to 0 will disable blurring.

See also: - getSimpleShadowBlurSamples - setSimpleShadowEnabled

Arguments
  • value (number()) – The number of samples.

Return type

void

See also: - getSimpleShadowBlurSamples - setSimpleShadowEnabled

setSimpleShadowColor

View.setSimpleShadowColor(color)

Sets the color of simple shadows.

See also: - getSimpleShadowColor - setSimpleShadowEnabled

Arguments
  • color (Color()) – The color to set.

Return type

void

See also: - getSimpleShadowColor - setSimpleShadowEnabled

setSimpleShadowEnabled

View.setSimpleShadowEnabled([value])

Enables or disables a full-scene shadow projected onto an invisible ground plane.

See also: - getSimpleShadowEnabled - setSimpleShadowColor - setSimpleShadowOpacity - setGroundPlane - setSimpleShadowResolution - setSimpleShadowInteractiveUpdateEnabled

Arguments
  • value (boolean()) – optional Whether simple shadows should be enabled.

Return type

void

See also: - getSimpleShadowEnabled - setSimpleShadowColor - setSimpleShadowOpacity - setGroundPlane - setSimpleShadowResolution - setSimpleShadowInteractiveUpdateEnabled

setSimpleShadowInteractiveUpdateEnabled

View.setSimpleShadowInteractiveUpdateEnabled([value])

Enables or disables updates to simple shadows during user interaction.

See also: - getSimpleShadowInteractiveUpdateEnabled - setSimpleShadowEnabled

Arguments
  • value (boolean()) – optional

Return type

void

See also: - getSimpleShadowInteractiveUpdateEnabled - setSimpleShadowEnabled

setSimpleShadowOpacity

View.setSimpleShadowOpacity(opacity)

Sets the opacity of simple shadows.

See also: - getSimpleShadowOpacity - setSimpleShadowEnabled

Arguments
  • opacity (number()) – The opacity to set.

Return type

void

See also: - getSimpleShadowOpacity - setSimpleShadowEnabled

setSimpleShadowResolution

View.setSimpleShadowResolution(pixels)

Sets the width and height in pixels of the texture image into which simple shadows are drawn.

See also: - getSimpleShadowResolution - setSimpleShadowEnabled

Arguments
  • pixels (number()) – The resolution to set.

Return type

void

See also: - getSimpleShadowResolution - setSimpleShadowEnabled

setStatisticsDisplayVisibility

View.setStatisticsDisplayVisibility(visibility)

Sets the display for the default statistic overlay.

Arguments
  • visibility (boolean()) –

Return type

Promise <void>

setToonShadingBandCount

View.setToonShadingBandCount(bandCount)

Sets the number of discrete shading bands that will be used when toon shading is enabled. Each band represents a shade between dark and light which will control the final color of the pixel based on its light intensity. The default band count is 3.

Arguments
  • bandCount (number()) –

Return type

void

setToonShadingSpecularFactor

View.setToonShadingSpecularFactor(specularFactor)

Sets a scale factor which controls the size of specular highlights when toon shading is enabled. The default value is 1.0.

Arguments
  • specularFactor (number()) –

Return type

void

setTransparencyMode

View.setTransparencyMode(mode)

Sets how transparent objects are blended.

Arguments
Return type

void

setViewOrientation

View.setViewOrientation(orientation[, duration[, bounding[, preserveModelUp]]])

Sets the view to a standard orientation.

Arguments
  • orientation (ViewOrientation) – The desired view orientation for the camera.

  • duration (number()) – optional The number of milliseconds used to transition to the new camera.

  • bounding (Box()) – optional Optional bounding to fit the camera about. If not supplied, the model bounding will be used.

  • preserveModelUp (boolean()) – optional Indicates whether the camera up will be set according to model up or current camera.

Return type

Promise <void>

setXRayColor

View.setXRayColor(element, color[, group])

Sets the color applied to nodes in x-ray mode. By default, the color is unset.

See unsetXRayColor

Arguments
  • element (ElementType) – the type of geometry to apply the color to

  • color (Color()) – the color to apply

  • group (XRayGroup) – optional the category of nodes that will be affected. If unspecified, XRayGroup.Selected will be used.

Return type

DeprecatedPromise()

See unsetXRayColor

setXRayOpacity

View.setXRayOpacity(opacity[, element])

Sets the opacity of unselected items in x-ray mode.

Arguments
  • opacity (number()) – a number between 0 and 1

  • element (ElementType) – optional the type of element to which the opacity will apply. If unspecified, the opacity will apply to all element types.

Return type

DeprecatedPromise()

setXRayTransparencyMode

View.setXRayTransparencyMode(mode)

Sets how transparent (unselected) objects are blended in x-ray mode.

Arguments
Return type

DeprecatedPromise()

startComparison

View.startComparison(nodeIdSet1, nodeIdSet2[, config])

Enables a visual comparison of two sets of nodes. The nodes specified by nodeIdSet1 are filled with one color, the nodes specified by nodeIdSet2 with another color, and overlapping areas are filled with a third color.

See endComparison

Arguments
  • nodeIdSet1 ([NodeId]) – the nodes to compare against nodeIdSet2

  • nodeIdSet2 ([NodeId]) – the nodes to compare against nodeIdSet1

  • config (ComparisonConfig()) – optional settings controlling the behavior of the comparison

Return type

void

See endComparison

testPointVisibility

View.testPointVisibility(points)

Tests whether the given points are visible by comparing them to the depth buffer of the most-recently-drawn frame. Points that are partially obscured by transparent objects are considered visible.

If the test is to be run every time a frame is drawn, setPointVisibilityTest should be used instead for proper synchronization.

Arguments
  • points ([Point3()]) – The points to test.

Return type

Promise <[number]>

Returns

A list of indices of the visible points.

If the test is to be run every time a frame is drawn, setPointVisibilityTest should be used instead for proper synchronization.

unprojectPoint

View.unprojectPoint(point, z)

Unprojects a 2d screen space point to a 3d world space point.

Arguments
  • point (Point2()) – 2d screen space

  • z (number()) – z value, default 0

Return type

Point3() | null

Returns

point world space point

unsetXRayColor

View.unsetXRayColor(element[, group])

Unsets the color applied to selected items in x-ray mode. Selected items will be displayed without overriding their colors.

See setXRayColor

Arguments
  • element (ElementType) – the type of geometry affected by the change

  • group (XRayGroup) – optional the category of nodes that will be affected. If unspecified, XRayGroup.Selected will be used.

Return type

Promise <void>

See setXRayColor

updateCamera

View.updateCamera(camera)

Updates camera properties individually. This method should be used to incrementally update camera properties individually.

Arguments
  • camera (Camera()) – the camera to set.

Return type

Camera()

Returns

updated camera object.

updateLight

View.updateLight(key, light)

Updates a light in the scene. See Light

See also: - addLight - clearLights - removeLight

Arguments
Return type

void

See also: - addLight - clearLights - removeLight