# CuttingPlane

class `cee.ug.``CuttingPlane`()

  Specification of a cutting plane (both parameters and attributes) in a `RemoteModel`.

  Use this object to control the position, settings and visual attributes of a cutting plane. The position of the cutting plane is defined with `point` and `normal`. You can map a scalar result onto the cutting plane with `mapScalarResultId`, and show vectors sampled in a regular grid with `mapVectorResultId`. The spacing of this regular grid is defined with `vectorGridSpacing`.

  You can specify whether to clip the model in the cutting plane’s plane with `clipping`, show the intersected element mesh with `showElementMesh` and set its `opacity`.

  Please note that cutting planes are more that just geometric clipping planes. They intersect the volume elements and produce a surface onto which results can be mapped.

  To create a cutting plane, use `RemoteModel.addCuttingPlane`.

  Example: Create two cutting planes:

      var modelDir = myModel.modelDirectory;

      // Find basis for position and map scalar result
      var bb = myModel.getBoundingBox();
      var halfExtent = bb.getExtent().x/2;
      var mapScalarId = -1;

      if (modelDir.scalarResultArray.length > 0) {
          mapScalarId = modelDir.scalarResultArray[0].id;
      }

      // Create plane 1
      var plane1 = myModel.addCuttingPlane();
      plane1.point = cee.Vec3.add(bb.getCenter(), new cee.Vec3(0.5*halfExtent, 0, 0));
      plane1.normal = new cee.Vec3(1,0,0);
      plane1.mapScalarResultId = mapScalarId;

      // Create plane 2
      var plane2 = myModel.addCuttingPlane();
      plane2.point = bb.getCenter();
      plane2.point = cee.Vec3.sub(bb.getCenter(), new cee.Vec3(0.5*halfExtent, 0, 0));
      plane2.normal = new cee.Vec3(1,0,0);
      plane2.mapScalarResultId = mapScalarId;
      plane2.showElementMesh = true;

      // Set model to outline to show the cutting planes
      myModel.setDrawStyleAllParts(cee.ug.DrawStyle.OUTLINE);

  This code sample produces the following image in the 3D Viewer:

Accessors

- `clipping`
- `computeFromVisibleParts`
- `crinkleCutSurface`
- `eyeLift`
- `filterScalarRangeMaximum`
- `filterScalarRangeMinimum`
- `filterScalarResultId`
- `highlight`
- `id`
- `isPrecomputed`
- `lighting`
- `mapContourLinesResultId`
- `mapScalarResultId`
- `mapVectorResultId`
- `normal`
- `opacity`
- `point`
- `projectVectorsOnPlane`
- `showElementMesh`
- `showSurface`
- `surfaceColor`
- `useSourcePartColor`
- `vectorGridSpacing`
- `visible`

Methods

- `getAsProperties`
- `setFromProperties`
- `setScalarFilteringVisibleRange`

## Accessors

`CuttingPlane.``clipping`()

  Whether the model should be clipped. If true, the model will be clipped at the cutting plane position

  Return type: | boolean

`CuttingPlane.``clipping`(clipping)

  Arguments: | clipping (`boolean`) – None
  Return type: | void

`CuttingPlane.``computeFromVisibleParts`()

  If set to true, the cutting plane will be computed from only the visible parts. Any part that is not visible will not contribute to the cutting plane.

  Return type: | boolean

`CuttingPlane.``computeFromVisibleParts`(visiblePartsOnly)

  Arguments: | visiblePartsOnly (`boolean`) – None
  Return type: | void

`CuttingPlane.``crinkleCutSurface`()

  Specify if the cutting plane should show a crinkle cut surface.

  If enabled, the cutting plane surface will be the combined surface of all elements intersected by the cutting plane. So the cutting plane will show the tesselation of all intersected elements.

  This is useful for inspecting and visualizing the mesh of a volume element model.

  The default is false.

  Return type: | boolean

`CuttingPlane.``crinkleCutSurface`(show)

  Arguments: | show (`boolean`) – None
  Return type: | void

`CuttingPlane.``eyeLift`()

  The eye lift mode to use for this cutting plane.

  Eye lift can be used when facing z fighting issues (triangles rendered in the same plane). By applying eye lift to one part, it will be moved slightly towards the eye, resolving the z fighting issues. The current version offers 3 eye lift factors to choose from.

  Return type: | EyeLift

`CuttingPlane.``eyeLift`(mode)

  Arguments: | mode (`EyeLift`) – None
  Return type: | void

`CuttingPlane.``filterScalarRangeMaximum`()

  The maximum range of the scalar result used for filtering visibility of the cutting plane

  To set a filtering range, use the `setScalarFilteringVisibleRange` function.

  Return type: | number

`CuttingPlane.``filterScalarRangeMinimum`()

  The minimum range of the scalar result used for filtering visibility of the cutting plane

  To set a filtering range, use the `setScalarFilteringVisibleRange` function.

  Return type: | number

`CuttingPlane.``filterScalarResultId`()

  The id of the scalar result used filter on the cutting plane. This id must refer to one of the scalar results in `ModelDirectory.scalarResultArray`.

  Set to -1 to turn off scalar filtering on the cutting plane.

  Return type: | number

`CuttingPlane.``highlight`()

  Whether the cutting plane should be highlighted.

  Return type: | boolean

`CuttingPlane.``highlight`(highlight)

  Arguments: | highlight (`boolean`) – None
  Return type: | void

`CuttingPlane.``id`()

  The id of the cutting plane. This is assigned by the system when you call `RemoteModel.addCuttingPlane` and is used to identify the cutting plane.

  Return type: | number

`CuttingPlane.``isPrecomputed`()

  Is true if the cutting plane is precomputed and cannot be changed

  Return type: | boolean

`CuttingPlane.``lighting`()

  Toggle lighting of the cutting plane on/off.

  Return type: | boolean

`CuttingPlane.``lighting`(lighting)

  Arguments: | lighting (`boolean`) – None
  Return type: | void

`CuttingPlane.``mapScalarResultId`()

  The id of the scalar result to show on the cutting plane. This id must refer to one of the scalar results in `ModelDirectory.scalarResultArray`. You can change the settings for the scalar in the `ScalarSettings` object.

  Set to -1 to show no scalars on the cutting plane.

  Return type: | number

`CuttingPlane.``mapScalarResultId`(resultId)

  Arguments: | resultId (`number`) – None
  Return type: | void

`CuttingPlane.``mapVectorResultId`()

  The id of the vector result to show on the cutting plane. This id must refer to one of the vector results in `ModelDirectory.vectorResultArray`. The vectors are shown in a regular grid. The spacing of this grid can be set with `vectorGridSpacing`. The settings for the vector arrows can be changed with the `VectorSettings` object.

  Set to -1 to show no vectors on the cutting plane.

  Return type: | number

`CuttingPlane.``mapVectorResultId`(resultId)

  Arguments: | resultId (`number`) – None
  Return type: | void

`CuttingPlane.``normal`()

  The normal of the cutting plane. Defines its orientation.

  Return type: | Vec3Like

`CuttingPlane.``normal`(normal)

  Arguments: | normal (`Vec3Like`) – None
  Return type: | void

`CuttingPlane.``opacity`()

  Opacity of the cutting plane. 0.0 means fully transparent (invisible), 1.0 means fully opaque.

  Return type: | number

`CuttingPlane.``opacity`(opacity)

  Arguments: | opacity (`number`) – None
  Return type: | void

`CuttingPlane.``point`()

  A point in the plane. Together with the normal property this defines the plane that the cutting plane is in.

  Return type: | Vec3Like

`CuttingPlane.``point`(point)

  Arguments: | point (`Vec3Like`) – None
  Return type: | void

`CuttingPlane.``projectVectorsOnPlane`()

  If true, the regular grid vectors are projected onto the cutting plane, making all the vectors parallel to the cutting plane surface.

  The default is false.

  Return type: | boolean

`CuttingPlane.``projectVectorsOnPlane`(project)

  Arguments: | project (`boolean`) – None
  Return type: | void

`CuttingPlane.``showElementMesh`()

  Whether the intersected element mesh should be rendered. If true, the mesh resulting from the intersection of the cutting plane with the element model will be overlaid on the cutting plane.

  Return type: | boolean

`CuttingPlane.``showElementMesh`(show)

  Arguments: | show (`boolean`) – None
  Return type: | void

`CuttingPlane.``showSurface`()

  Whether the surface of the cutting plane should be visible.

  The default is true.

  Return type: | boolean

`CuttingPlane.``showSurface`(show)

  Arguments: | show (`boolean`) – None
  Return type: | void

`CuttingPlane.``surfaceColor`()

  The color of the cutting plane surface if not showing a result and useSourcePartColor is false

  Return type: | Color3Like

`CuttingPlane.``surfaceColor`(clr)

  Arguments: | clr (`Color3Like`) – None
  Return type: | void

`CuttingPlane.``useSourcePartColor`()

  If set to true, the cutting plane will be colored by the source part, so this plane will end up with different colors based on the color of the parts the cutting plane intersects

  Return type: | boolean

`CuttingPlane.``useSourcePartColor`(use)

  Arguments: | use (`boolean`) – None
  Return type: | void

`CuttingPlane.``vectorGridSpacing`()

  The spacing of the vectors shown on the cutting plane. The vector arrows are resampled into a regular grid before being rendered on the cutting plane. This property defines the spacing between each vector arrow on the cutting plane. The value is relative to the current extent of the model.

  The default is 0.02

  Return type: | number

`CuttingPlane.``vectorGridSpacing`(spacing)

  Arguments: | spacing (`number`) – None
  Return type: | void

`CuttingPlane.``visible`()

  Visibility of the cutting plane. Use this to show or hide a cutting plane in the 3D Viewer.

  Return type: | boolean

`CuttingPlane.``visible`(visible)

  Arguments: | visible (`boolean`) – None
  Return type: | void

## Methods

### getAsProperties

`CuttingPlane.``getAsProperties`()

  Gets the settings for this cutting plane as a Plain Old JavaScript Object (POJO).

  Return type: | CuttingPlaneProperties

### setFromProperties

`CuttingPlane.``setFromProperties`(props)

  Arguments: | props (`Partial`) – None

  Applies the settings in the given properties object to this cutting plane

  Return type: | void

### setScalarFilteringVisibleRange

`CuttingPlane.``setScalarFilteringVisibleRange`(resultId, min, max)

  Arguments: | resultId (`number`) – The id for the result to which this filter should be applied. min (`number`) – The minimum scalar value for filtering. Areas with scalar values below this threshold will be set invisible. max (`number`) – The maximum scalar value for filtering. Areas with scalar values above this threshold will be set invisible.

  Sets the scalar filtering visibility range for cutting plane

  Specify a filter for a cutting plane by defining a specific result id (resultId) and a scalar range from minimum to maximum. The filter allows you to control the visibility of areas on the cutting plane based on scalar values, making areas outside the specified range invisible.

  A common use case for this functionality is to restrict the visibility of a cutting plane to a specific isovolume. By configuring the cutting plane filter with the same result id and scalar range as the isovolume, you can ensure that the cutting plane surface is only visible within the isovolume.

  For a visual representation and example scenarios regarding isovolumes and cutting planes with and without scalar filtering, please refer to the images below.

  Return type: | void

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Envision for Web or choose a sample question below to start a conversation:

What is HOOPS Envision for Web?
What are the latest release notes for HOOPS Envision for Web?
How do I start evaluating HOOPS Envision for Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...