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

Communicator.CuttingManager.activateCuttingSections()

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

Return type

Promise[void]

clearAllCuttingSections

Communicator.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

Communicator.CuttingManager.createReferenceGeometryFromAxis(axis, modelBounding)

generates reference geometry for a cutting plane.

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

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

Return type

[Communicator.Point3]

createReferenceGeometryFromFaceNormal

Communicator.CuttingManager.createReferenceGeometryFromFaceNormal(normal, position, modelBounding)

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

Arguments
Return type

[Communicator.Point3]

deactivateAllCuttingSections

Communicator.CuttingManager.deactivateAllCuttingSections()

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

Return type

Promise[void]

deactivateCuttingSections

Communicator.CuttingManager.deactivateCuttingSections(clearSections)

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

Note

deactivateCuttingSections is deprecated: Use deactivateAllCuttingSections or clearAllCuttingSections instead.

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

Return type

Promise[void]

delayCapping

Communicator.CuttingManager.delayCapping()

Delays capping processing by a fixed time interval.

Return type

void

enableCappingIdleCallback

Communicator.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

Communicator.CuttingManager.forJson()

Note

forJson is deprecated: Use toJson instead.

Return type

Object

fromJson

Communicator.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

Communicator.CuttingManager.getActiveCuttingSectionCount()
Return type

number

Returns

the number of active cutting sections.

getCappingFaceColor

Communicator.CuttingManager.getCappingFaceColor()

Gets the color used for capping geometry faces.

Return type

{  }

Returns

color used for capping geometry faces.

getCappingGeometryVisibility

Communicator.CuttingManager.getCappingGeometryVisibility()

Gets whether capping geometry will show

Return type

boolean

Returns

boolean value indicating whether capping geometry will show

getCappingLineColor

Communicator.CuttingManager.getCappingLineColor()

Gets the color used for capping geometry lines.

Return type

{  }

Returns

color used for capping geometry lines.

getCuttingSection

Communicator.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

{  }

Returns

the cutting section for the given index.

getCuttingSectionCapacity

Communicator.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

Communicator.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

Communicator.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 ({  }()) – a node ID for cutting plane stand-in geometry.

Return type

{  }

Returns

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

getStandinGeometryPickable

Communicator.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

Communicator.CuttingManager.hasActiveCuttingSection()
Return type

boolean

Returns

true if there is an active cutting section.

refreshPlaneGeometry

Communicator.CuttingManager.refreshPlaneGeometry()

Updates all cutting plane geometry.

Return type

Promise[void]

setCappingDelay

Communicator.CuttingManager.setCappingDelay(delayInMilliseconds)

Sets the delay used by delayCapping() in milliseconds.

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

Return type

void

setCappingFaceColor

Communicator.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 to use for capping geometry faces.

Return type

Communicator.DeprecatedPromise

setCappingGeometryVisibility

Communicator.CuttingManager.setCappingGeometryVisibility(cappingGeometryVisibility)

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

Arguments
  • cappingGeometryVisibility (boolean()) –

Return type

Communicator.DeprecatedPromise

setCappingLineColor

Communicator.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 to use for capping geometry lines.

Return type

Communicator.DeprecatedPromise

setCuttingPlaneColor

Communicator.CuttingManager.setCuttingPlaneColor(color)

Sets the color for all cutting plane reference geometry.

Arguments
Return type

Communicator.DeprecatedPromise

setStandinGeometryPickable

Communicator.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

Communicator.DeprecatedPromise

toJson

Communicator.CuttingManager.toJson()

Creates an object ready for JSON serialization.

Return type

Object

Returns

The prepared object.

waitForCappingIdle

Communicator.CuttingManager.waitForCappingIdle()
Return type

Promise[void]