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:

None

Accessors

cee.ug.CuttingPlane.clipping()
get clipping(): boolean

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

Returns: boolean

set clipping(clipping: boolean): void

Parameters

clipping: boolean

Returns: void

cee.ug.CuttingPlane.computeFromVisibleParts()
get 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.

Returns: boolean

set computeFromVisibleParts(visiblePartsOnly: boolean): void

Parameters

visiblePartsOnly: boolean

Returns: void

cee.ug.CuttingPlane.crinkleCutSurface()
get 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.

Returns: boolean

set crinkleCutSurface(show: boolean): void

Parameters

show: boolean

Returns: void

cee.ug.CuttingPlane.eyeLift()
get eyeLift(): 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.

Returns: EyeLift

set eyeLift(mode: EyeLift): void

Parameters

mode: EyeLift

Returns: void

cee.ug.CuttingPlane.filterScalarRangeMaximum()
get filterScalarRangeMaximum(): number

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

To set a filtering range, use the setScalarFilteringVisibleRange function.

Returns: number

cee.ug.CuttingPlane.filterScalarRangeMinimum()
get filterScalarRangeMinimum(): number

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

To set a filtering range, use the setScalarFilteringVisibleRange function.

Returns: number

cee.ug.CuttingPlane.filterScalarResultId()
get filterScalarResultId(): number

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.

Returns: number

cee.ug.CuttingPlane.highlight()
get highlight(): boolean

Whether the cutting plane should be highlighted.

Returns: boolean

set highlight(highlight: boolean): void

Parameters

highlight: boolean

Returns: void

cee.ug.CuttingPlane.id()
get 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.

Returns: number

cee.ug.CuttingPlane.isPrecomputed()
get isPrecomputed(): boolean

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

Returns: boolean

cee.ug.CuttingPlane.lighting()
get lighting(): boolean

Toggle lighting of the cutting plane on/off.

Returns: boolean

set lighting(lighting: boolean): void

Parameters

lighting: boolean

Returns: void

cee.ug.CuttingPlane.mapContourLinesResultId()
get mapContourLinesResultId(): number

The id of the contour lines result to show on the cutting plane. This id must refer to one of the scalar results in ModelDirectory.scalarLinesResultArray.

Set to -1 to show no contour lines on the cutting plane.

Returns: number

set mapContourLinesResultId(resultId: number): void

Parameters

resultId: number

Returns: void

cee.ug.CuttingPlane.mapScalarResultId()
get 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.

Returns: number

set mapScalarResultId(resultId: number): void

Parameters

resultId: number

Returns: void

cee.ug.CuttingPlane.mapVectorResultId()
get 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.

Returns: number

set mapVectorResultId(resultId: number): void

Parameters

resultId: number

Returns: void

cee.ug.CuttingPlane.normal()
get normal(): Vec3Like

The normal of the cutting plane. Defines its orientation.

Returns: Vec3Like

set normal(normal: Vec3Like): void

Parameters

normal: Vec3Like

Returns: void

cee.ug.CuttingPlane.opacity()
get opacity(): number

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

Returns: number

set opacity(opacity: number): void

Parameters

opacity: number

Returns: void

cee.ug.CuttingPlane.point()
get point(): Vec3Like

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

Returns: Vec3Like

set point(point: Vec3Like): void

Parameters

point: Vec3Like

Returns: void

cee.ug.CuttingPlane.projectVectorsOnPlane()
get 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.

Returns: boolean

set projectVectorsOnPlane(project: boolean): void

Parameters

project: boolean

Returns: void

cee.ug.CuttingPlane.showElementMesh()
get 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.

Returns: boolean

set showElementMesh(show: boolean): void

Parameters

show: boolean

Returns: void

cee.ug.CuttingPlane.showSurface()
get showSurface(): boolean

Whether the surface of the cutting plane should be visible.

The default is true.

Returns: boolean

set showSurface(show: boolean): void

Parameters

show: boolean

Returns: void

cee.ug.CuttingPlane.surfaceColor()
get surfaceColor(): Color3Like

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

Returns: Color3Like

set surfaceColor(clr: Color3Like): void

Parameters

Returns: void

cee.ug.CuttingPlane.useSourcePartColor()
get 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

Returns: boolean

set useSourcePartColor(use: boolean): void

Parameters

use: boolean

Returns: void

cee.ug.CuttingPlane.vectorGridSpacing()
get 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

Returns: number

set vectorGridSpacing(spacing: number): void

Parameters

spacing: number

Returns: void

cee.ug.CuttingPlane.visible()
get visible(): boolean

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

Returns: boolean

set visible(visible: boolean): void

Parameters

visible: boolean

Returns: void

Methods

cee.ug.CuttingPlane.getAsProperties()
getAsProperties(): CuttingPlaneProperties

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

Returns: CuttingPlaneProperties

cee.ug.CuttingPlane.setFromProperties()
setFromProperties(props: Partial): void

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

Parameters

props: Partial

Returns: void

cee.ug.CuttingPlane.setScalarFilteringVisibleRange()
setScalarFilteringVisibleRange(resultId: number, min: number, max: number): void

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.

None None

Parameters

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.

Returns: void