CuttingManager

class Communicator.CuttingManager()

Main interface into the cutting functionality of the viewer. The object manages a number of individual CuttingSections which can be activated individually.


Methods

activateCuttingSections

CuttingManager.activateCuttingSections()

Activates all cutting sections, and restores any planes contained to the scene.

Return type

Promise <void>

clearAllCuttingSections

CuttingManager.clearAllCuttingSections()

Clears all cutting sections. This causes all cutting sections to be deactivated and all their cutting planes removed.

Return type

Promise <void>

createReferenceGeometryFromAxis

CuttingManager.createReferenceGeometryFromAxis(axis, modelBounding)

generates reference geometry for a cutting plane.

Arguments
  • axis (Axis) – axis for reference geometry.

  • modelBounding (Box()) – modelBounding for geometry size.

Return type

[Point3()]

createReferenceGeometryFromFaceNormal

CuttingManager.createReferenceGeometryFromFaceNormal(normal, position, modelBounding)

Uses a selection normal and position to create reference geometry for a cutting plane.

Arguments
  • normal (Point3()) – face normal.

  • position (Point3()) – face position.

  • modelBounding (Box()) – model bounding for geometry size.

Return type

[Point3()]

deactivateAllCuttingSections

CuttingManager.deactivateAllCuttingSections()

Deactivates all cutting sections. Cutting planes are not removed from section and can be restored using activateCuttingSections

Return type

Promise <void>

deactivateCuttingSections

CuttingManager.deactivateCuttingSections([clearSections])

Removes all cutting planes and cutting plane geometry from the scene.

Deprecated

Use deactivateAllCuttingSections or clearAllCuttingSections instead.

Arguments
  • clearSections (boolean()) – optional if true, removes all cutting planes contained in cutting sections.

Return type

Promise <void>

delayCapping

CuttingManager.delayCapping()

Delays capping processing by a fixed time interval.

Return type

void

enableCappingIdleCallback

CuttingManager.enableCappingIdleCallback(enable)

Enables or disables activation of “cappingIdle” callback event.

Arguments
  • enable (boolean()) – Enables or disables activation of “cappingIdle” callback event.

Return type

Promise <boolean>

Returns

A promise returning whether or not capping generation was idle when this call resolves.

forJson

CuttingManager.forJson()
Deprecated

Use toJson instead.

Return type

Object

fromJson

CuttingManager.fromJson(json)

Removes any cutting planes in the scene, and restores cutting planes from a json object.

Arguments
  • json (any()) –

Return type

Promise <void>

getActiveCuttingSectionCount

CuttingManager.getActiveCuttingSectionCount()
Return type

number

Returns

the number of active cutting sections.

getCappingFaceColor

CuttingManager.getCappingFaceColor()

Gets the color used for capping geometry faces.

Return type

Color() | null

Returns

color used for capping geometry faces.

getCappingGeometryVisibility

CuttingManager.getCappingGeometryVisibility()

Gets whether capping geometry will show

Return type

boolean

Returns

boolean value indicating whether capping geometry will show

getCappingLineColor

CuttingManager.getCappingLineColor()

Gets the color used for capping geometry lines.

Return type

Color() | null

Returns

color used for capping geometry lines.

getCuttingSection

CuttingManager.getCuttingSection(index)

Gets a cutting section by index. Cutting sections are created automatically by the system and may be queried at any point during or after the sceneReady callback has been triggered.

Arguments
  • index (number()) –

Return type

CuttingSection() | null

Returns

the cutting section for the given index.

getCuttingSectionCapacity

CuttingManager.getCuttingSectionCapacity()

Gets the total number of planes supported by each cutting section. Cutting planes contained in the same cutting section will work together (an object is only cut if all cutting planes in a section would cut it). Cutting planes in separate cutting sections do not work together when cutting (an object is cut if any one of the cutting sections would cut it).

Return type

number

Returns

the number of planes each cutting section may contain.

getCuttingSectionCount

CuttingManager.getCuttingSectionCount()

Gets the total number of cutting sections supported by the system.

Return type

number

Returns

the number of cutting sections supported by the system.

getCuttingSectionFromNodeId

CuttingManager.getCuttingSectionFromNodeId(nodeId)

Gets the cutting section containing the cutting plane with the given node ID. If the supplied node ID is not contained by any cutting section null will be returned.

Arguments
  • nodeId (NodeId | null) – a node ID for cutting plane stand-in geometry.

Return type

CuttingSection() | null

Returns

the CuttingSection that contains the plane with the given node id or null if none contain it.

getNodesWithCapping

CuttingManager.getNodesWithCapping()

Gets all nodes that have capping drawn for them.

Return type

Promise <[NodeId]>

Returns

an array of node IDs that have capping drawn for them

getStandinGeometryPickable

CuttingManager.getStandinGeometryPickable()

Gets whether stand-in geometry for cutting sections is pickable.

Return type

boolean

Returns

boolean value indicating whether stand-in geometry for cutting sections is pickable.

hasActiveCuttingSection

CuttingManager.hasActiveCuttingSection()
Return type

boolean

Returns

true if there is an active cutting section.

refreshPlaneGeometry

CuttingManager.refreshPlaneGeometry()

Updates all cutting plane geometry.

Return type

Promise <void>

setCappingDelay

CuttingManager.setCappingDelay(delayInMilliseconds)

Sets the delay used by delayCapping() in milliseconds.

Arguments
  • delayInMilliseconds (number()) – The delay amount.

Return type

void

setCappingFaceColor

CuttingManager.setCappingFaceColor(color)

Sets the color to be used for capping geometry faces. If null is passed in as the color object, no capping face will be shown.

Arguments
  • color (Color() | null) – color to use for capping geometry faces.

Return type

DeprecatedPromise()

setCappingGeometryVisibility

CuttingManager.setCappingGeometryVisibility(cappingGeometryVisibility)

Sets whether capping geometry will show. The default value is true.

Arguments
  • cappingGeometryVisibility (boolean()) –

Return type

DeprecatedPromise()

setCappingLineColor

CuttingManager.setCappingLineColor(color)

Sets the color to be used for capping geometry lines. If null is passed in as the color object, no capping line will be shown.

Arguments
  • color (Color() | null) – color to use for capping geometry lines.

Return type

DeprecatedPromise()

setCuttingPlaneColor

CuttingManager.setCuttingPlaneColor(color)

Sets the color for all cutting plane reference geometry.

Arguments
Return type

DeprecatedPromise()

setStandinGeometryPickable

CuttingManager.setStandinGeometryPickable(pickable)

Sets whether stand-in geometry for cutting sections should be pickable. If this option is set to false, picking rays will pass though stand-in geometry for cutting planes. The default value is not pickable.

Arguments
  • pickable (boolean()) – boolean value indicating whether stand-in geometry should be pickable in the scene.

Return type

DeprecatedPromise()

toJson

CuttingManager.toJson()

Creates an object ready for JSON serialization.

Return type

Object

Returns

The prepared object.

waitForCappingIdle

CuttingManager.waitForCappingIdle()
Return type

Promise <void>