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
Methods
activate
- Communicator.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
- Communicator.CuttingSection.addPlane(plane, referenceGeometry)
Adds a plane to the cutting section.
- Arguments
plane (
Communicator.Plane()
) – The plane to be used for cutting.referenceGeometry (
{ }()
) – 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
- Communicator.CuttingSection.applyPlaneOpacity(index, opacity)
Apply the opacity factor to the plane.
- Arguments
index (
number()
) – The index of the cutting plane.opacity (
{ }()
) – The value used to change the opacity if needed
- Return type
void
clear
- Communicator.CuttingSection.clear()
Removes all planes from this cutting section. This will also deactivate the cutting section.
- Return type
Promise[void]
deactivate
- Communicator.CuttingSection.deactivate()
Removes a cutting section from use.
- Return type
Promise[void]
forJson
- Communicator.CuttingSection.forJson()
Note
forJson is deprecated: Use
toJson
instead.- Return type
Object
fromJson
- Communicator.CuttingSection.fromJson(json)
- Arguments
json (
Object()
) –
- Return type
Promise[void]
getCount
- Communicator.CuttingSection.getCount()
Gets the number of planes in this cutting secton.
- Return type
number
- Returns
the number of planes in this cutting section
getNodeId
- Communicator.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
{ }
- Returns
NodeId
of the reference geometry for the cutting plane at the given index or null.
getPlane
- Communicator.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
{ }
- Returns
Plane that is used for cutting at the given index or null.
getPlaneIndexByNodeId
- Communicator.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 (
Communicator.NodeId()
) – TheNodeId
for the plane reference geometry.
- Return type
{ }
- Returns
The index of a plane associated with the provided
NodeId
or null if no plane is found.
getPlaneOpacity
- Communicator.CuttingSection.getPlaneOpacity(index)
Gets the opacity for the plane at the given index.
- Arguments
index (
number()
) – The index of the cutting plane.
- Return type
{ }
getReferenceGeometry
- Communicator.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
{ }
- 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
- Communicator.CuttingSection.isActive()
Gets whether a cutting section is active
- Return type
boolean
- Returns
boolean value indicating whether this cutting section is active
removePlane
- Communicator.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
- Communicator.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
- Communicator.CuttingSection.setColor(color)
Sets the color for all planes in the cutting section
- Arguments
color (
Communicator.Color()
) – Color to set
- Return type
Communicator.DeprecatedPromise
- Returns
Promise that resolves when the operation has completed.
setItemTransparency
- Communicator.CuttingSection.setItemTransparency(index, transparency)
Note
setItemTransparency is deprecated: use
setPlaneOpacity
instead.- Arguments
index (
number()
) –transparency (
number()
) –
- Return type
Communicator.DeprecatedPromise
setOpacity
- Communicator.CuttingSection.setOpacity(opacity)
Sets the opacity for all planes in the cutting section
- Arguments
opacity (
number()
) – opacity to set
- Return type
void
setPlane
- Communicator.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 (
Communicator.Plane()
) – The plane to be used for cutting.referenceGeometry (
{ }()
) – 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
- Communicator.CuttingSection.setPlaneOpacity(index, opacity)
Sets the opacity for the plane at the given index.
- 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
- Communicator.CuttingSection.setPlaneTransparency(index, transparency)
Note
setPlaneTransparency is deprecated: use
setPlaneOpacity
instead.- Arguments
index (
number()
) –transparency (
number()
) –
- Return type
Communicator.DeprecatedPromise
setTransparency
- Communicator.CuttingSection.setTransparency(transparency)
Note
setTransparency is deprecated: use
setOpacity
instead.- Arguments
transparency (
number()
) –
- Return type
Communicator.DeprecatedPromise
toJson
- Communicator.CuttingSection.toJson()
Creates an object ready for JSON serialization.
- Return type
Object
- Returns
The prepared object.
updatePlane
- Communicator.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 (
Communicator.Plane()
) – The plane to use for cutting.geometryMatrix (
Communicator.Matrix()
) – A matrix that is multiplied by the previous position matrix to update the geometry position.finalizePosition (
{ }()
) – If true, sets the result of the geometry matrix multiplication as the new position matrix.resetTranslation (
{ }()
) – If true, uses the provided geometry matrix for the geometry position.
- Return type
Promise[void]