Options
All
  • Public
  • Public/Protected
  • All
Menu

Class 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 an 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:

alt text

Hierarchy

  • CuttingPlane

Index

Accessors

clipping

clipping: boolean

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

computeFromVisibleParts

computeFromVisibleParts: boolean

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.

crinkleCutSurface

crinkleCutSurface: boolean

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.

highlight

highlight: boolean

Whether the cutting plane should be highlighted.

Readonly id

id: number

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.

Readonly isPrecomputed

isPrecomputed: boolean

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

mapScalarResultId

mapScalarResultId: number

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.

mapVectorResultId

mapVectorResultId: number

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.

normal

normal: Vec3Like

The normal of the cutting plane. Defines its orientation.

opacity

opacity: number

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

point

point: Vec3Like

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

projectVectorsOnPlane

projectVectorsOnPlane: boolean

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.

showElementMesh

showElementMesh: boolean

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.

showSurface

showSurface: boolean

Whether the surface of the cutting plane should be visible.

The default is true.

surfaceColor

surfaceColor: Color3Like

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

useSourcePartColor

useSourcePartColor: boolean

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

vectorGridSpacing

vectorGridSpacing: number

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

visible

visible: boolean

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

Methods

getAsProperties

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

    Returns CuttingPlaneProperties

setFromProperties

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

    Parameters

    Returns void

Generated using TypeDoc