Communicator.CuttingSection

 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

  • activate(): Promise<void>
  • Activates a cutting section for use. A cutting section must have at least one plane to be activated.

    Returns Promise<void>

    a promise if the cutting section was activated.

addPlane

  • addPlane(plane: Plane, referenceGeometry?: Point3[] | null): Promise<boolean>
  • Adds a plane to the cutting section.

    Parameters

    • plane: Plane

      The plane to be used for cutting.

    • Optional referenceGeometry: Point3[] | null

      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.

    Returns Promise<boolean>

clear

  • clear(): Promise<void>
  • Removes all planes from this cutting section. This will also deactivate the cutting section.

    Returns Promise<void>

deactivate

  • deactivate(): Promise<void>
  • Removes a cutting section from use.

    Returns Promise<void>

forJson    [deprecated]

  • forJson(): Object
  • deprecated

    Use toJson instead.

    Returns Object

fromJson

  • fromJson(json: Object): Promise<void>
  • Parameters

    • json: Object

    Returns Promise<void>

getCount

  • getCount(): number
  • Gets the number of planes in this cutting secton.

    Returns number

    the number of planes in this cutting section

getNodeId

  • getNodeId(index: number): NodeId | null
  • 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.

    Parameters

    • index: number

      the index of the cutting plane.

    Returns NodeId | null

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

getPlane

  • getPlane(index: number): Plane | null
  • Gets the plane for the item at the given index. In the case of an invalid index, null will be returned.

    Parameters

    • index: number

      The index of the cutting plane.

    Returns Plane | null

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

getPlaneIndexByNodeId

  • getPlaneIndexByNodeId(id: NodeId): number | null
  • Gets the index of a plane for the corresponding node id. In the case of an invalid id, null will be returned.

    Parameters

    Returns number | null

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

getReferenceGeometry

  • getReferenceGeometry(index: number): Point3[] | null
  • Gets the reference geometry for the item at the given index. In the case of an invalid index, null will be returned

    Parameters

    • index: number

      The index of the cutting plane.

    Returns Point3[] | null

    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

  • isActive(): boolean
  • Gets whether a cutting section is active

    Returns boolean

    boolean value indicating whether this cutting section is active

removePlane

  • removePlane(index: number): Promise<void>
  • Removes the cutting plane at the specified index.

    Parameters

    • index: number

      The index of the cutting plane to remove.

    Returns Promise<void>

setColor

  • Sets the color for all planes in the cutting section

    Parameters

    • color: Color

      Color to set

    Returns DeprecatedPromise

    Promise that resolves when the operation has completed.

setItemTransparency    [deprecated]

setOpacity

  • setOpacity(opacity: number): void
  • Sets the opacity for all planes in the cutting section

    Parameters

    • opacity: number

      opacity to set

    Returns void

setPlane

  • setPlane(index: number, plane: Plane, referenceGeometry?: Point3[] | null): Promise<void>
  • Sets a plane currently in the cutting section at a given index.

    Parameters

    • index: number

      The index of the cutting plane to replace.

    • plane: Plane

      The plane to be used for cutting.

    • Optional referenceGeometry: Point3[] | null

      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.

    Returns Promise<void>

setPlaneOpacity

  • setPlaneOpacity(index: number, opacity: number): void
  • Sets the opacity for the plane at the given index.

    Parameters

    • index: number

      The index of the cutting plane.

    • opacity: number

      A number between 0 and 1.

    Returns void

setPlaneTransparency    [deprecated]

setTransparency    [deprecated]

toJson

  • toJson(): Object
  • Creates an object ready for JSON serialization.

    Returns Object

    The prepared object.

updatePlane

  • updatePlane(index: number, plane: Plane, geometryMatrix?: Matrix, finalizePosition?: boolean, resetTranslation?: boolean): Promise<void>
  • Updates the position of a cutting plane and stand-in geometry if present.

    Parameters

    • index: number

      The index of the cutting plane.

    • plane: Plane

      The plane to use for cutting.

    • Optional geometryMatrix: Matrix

      A matrix that is multiplied by the previous position matrix to update the geometry position.

    • Optional finalizePosition: boolean

      If true, sets the result of the geometry matrix multiplication as the new position matrix.

    • Optional resetTranslation: boolean

      If true, uses the provided geometry matrix for the geometry position.

    Returns Promise<void>