CuttingSection

class Communicator.CuttingSection()

Object representing an individual cutting section, more information can be found here. A cutting section groups up to 6 cutting planes together and behaves independently of other cutting sections.


Methods

activate

CuttingSection.activate()

Activates a cutting section for use. A cutting section must have at least one plane to be activated.

Return type

Promise <void>

Returns

a promise if the cutting section was activated.

addPlane

CuttingSection.addPlane(plane[, referenceGeometry])

Adds a plane to the cutting section.

Arguments
  • plane (Plane()) – The plane to be used for cutting.

  • referenceGeometry ([Point3()] | null) – optional An optional list of four points representing a quad to be used as reference geometry for the cutting plane. Pass null to use no reference geometry for this cutting plane.

Return type

Promise <boolean>

applyPlaneOpacity

CuttingSection.applyPlaneOpacity(index[, opacity])

Apply the opacity factor to the plane.

Arguments
  • index (number()) – The index of the cutting plane.

  • opacity (number()) – optional The value used to change the opacity if needed

Return type

void

clear

CuttingSection.clear()

Removes all planes from this cutting section. This will also deactivate the cutting section.

Return type

Promise <void>

deactivate

CuttingSection.deactivate()

Removes a cutting section from use.

Return type

Promise <void>

forJson

CuttingSection.forJson()
Deprecated

Use toJson instead.

Return type

Object

fromJson

CuttingSection.fromJson(json)
Arguments
  • json (Object()) –

Return type

Promise <void>

getCount

CuttingSection.getCount()

Gets the number of planes in this cutting secton.

Return type

number

Returns

the number of planes in this cutting section

getNodeId

CuttingSection.getNodeId(index)

Gets the NodeId for the reference geometry for the cutting plane at the given index. In the case of an invalid index or a cutting plane with no reference geometry, null will be returned.

Arguments
  • index (number()) – the index of the cutting plane.

Return type

NodeId | null

Returns

NodeId of the reference geometry for the cutting plane at the given index or null.

getPlane

CuttingSection.getPlane(index)

Gets the plane for the item at the given index. In the case of an invalid index, null will be returned.

Arguments
  • index (number()) – The index of the cutting plane.

Return type

Plane() | null

Returns

Plane that is used for cutting at the given index or null.

getPlaneIndexByNodeId

CuttingSection.getPlaneIndexByNodeId(id)

Gets the index of a plane for the corresponding node id. In the case of an invalid id, null will be returned.

Arguments
  • id (NodeId) – The NodeId for the plane reference geometry.

Return type

number | null

Returns

The index of a plane associated with the provided NodeId or null if no plane is found.

getPlaneOpacity

CuttingSection.getPlaneOpacity(index)

Gets the opacity for the plane at the given index.

Arguments
  • index (number()) – The index of the cutting plane.

Return type

number | undefined

getReferenceGeometry

CuttingSection.getReferenceGeometry(index)

Gets the reference geometry for the item at the given index. In the case of an invalid index, null will be returned

Arguments
  • index (number()) – The index of the cutting plane.

Return type

[Point3()] | null

Returns

A list of four points representing a quad to be used as reference geometry for the cutting plane, or null if there is no reference geometry.

isActive

CuttingSection.isActive()

Gets whether a cutting section is active

Return type

boolean

Returns

boolean value indicating whether this cutting section is active

removePlane

CuttingSection.removePlane(index)

Removes the cutting plane at the specified index.

Arguments
  • index (number()) – The index of the cutting plane to remove.

Return type

Promise <void>

resetPlanesOpacity

CuttingSection.resetPlanesOpacity()

Reapply the opacity of the cutting planes to the engine This function must be explicitly called after _resetOpacity has been emitted by the engine

Return type

void

setColor

CuttingSection.setColor(color)

Sets the color for all planes in the cutting section

Arguments
Return type

DeprecatedPromise()

Returns

Promise that resolves when the operation has completed.

setItemTransparency

CuttingSection.setItemTransparency(index, transparency)
Deprecated

use setPlaneOpacity instead.

Arguments
  • index (number()) –

  • transparency (number()) –

Return type

DeprecatedPromise()

setOpacity

CuttingSection.setOpacity(opacity)

Sets the opacity for all planes in the cutting section

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

Return type

void

setPlane

CuttingSection.setPlane(index, plane[, referenceGeometry])

Sets a plane currently in the cutting section at a given index.

Arguments
  • index (number()) – The index of the cutting plane to replace.

  • plane (Plane()) – The plane to be used for cutting.

  • referenceGeometry ([Point3()] | null) – optional a list of four points representing a quad to be used as reference geometry for the cutting plane. Pass null to use no reference geometry for this cutting plane.

Return type

Promise <void>

setPlaneOpacity

CuttingSection.setPlaneOpacity(index, opacity)

Sets the opacity for the plane at the given index.

Equivalent to section.applyPlaneOpacity(index, opacity)

Arguments
  • index (number()) – The index of the cutting plane.

  • opacity (number()) – A number between 0 and 1.

Return type

void

Equivalent to section.applyPlaneOpacity(index, opacity)

setPlaneTransparency

CuttingSection.setPlaneTransparency(index, transparency)
Deprecated

use setPlaneOpacity instead.

Arguments
  • index (number()) –

  • transparency (number()) –

Return type

DeprecatedPromise()

setTransparency

CuttingSection.setTransparency(transparency)
Deprecated

use setOpacity instead.

Arguments
  • transparency (number()) –

Return type

DeprecatedPromise()

toJson

CuttingSection.toJson()

Creates an object ready for JSON serialization.

Return type

Object

Returns

The prepared object.

updatePlane

CuttingSection.updatePlane(index, plane[, geometryMatrix[, finalizePosition[, resetTranslation]]])

Updates the position of a cutting plane and stand-in geometry if present.

Arguments
  • index (number()) – The index of the cutting plane.

  • plane (Plane()) – The plane to use for cutting.

  • geometryMatrix (Matrix()) – optional A matrix that is multiplied by the previous position matrix to update the geometry position.

  • finalizePosition (boolean()) – optional If true, sets the result of the geometry matrix multiplication as the new position matrix.

  • resetTranslation (boolean()) – optional If true, uses the provided geometry matrix for the geometry position.

Return type

Promise <void>