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
andnormal
You can map a scalar result onto the cutting plane withmapScalarResultId
and show vectors sampled in a regular grid withmapVectorResultId
The spacing of this regular grid is defined withvectorGridSpacing
You can specify whether to clip the model in the cutting plane’s plane with
clipping
show the intersected element mesh withshowElementMesh
and set itsopacity
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
Methods
Accessors
- cee.ug.CuttingPlane.clipping
Whether the model should be clipped. If true, the model will be clipped at the cutting plane position
- cee.ug.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.
- cee.ug.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.
- cee.ug.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.
- cee.ug.CuttingPlane.highlight
Whether the cutting plane should be highlighted.
- cee.ug.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.
- cee.ug.CuttingPlane.isPrecomputed
Is true if the cutting plane is precomputed and cannot be changed
- cee.ug.CuttingPlane.lighting
Toggle lighting of the cutting plane on/off.
- cee.ug.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 theScalarSettings
object.Set to -1 to show no scalars on the cutting plane.
- cee.ug.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 withvectorGridSpacing
The settings for the vector arrows can be changed with theVectorSettings
object.Set to -1 to show no vectors on the cutting plane.
- cee.ug.CuttingPlane.normal
The normal of the cutting plane. Defines its orientation.
- cee.ug.CuttingPlane.opacity
Opacity of the cutting plane. 0.0 means fully transparent (invisible), 1.0 means fully opaque.
- cee.ug.CuttingPlane.point
A point in the plane. Together with the normal property this defines the plane that the cutting plane is in.
- cee.ug.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.
- cee.ug.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.
- cee.ug.CuttingPlane.showSurface
Whether the surface of the cutting plane should be visible.
The default is true.
- cee.ug.CuttingPlane.surfaceColor
The color of the cutting plane surface if not showing a result and useSourcePartColor is false
- cee.ug.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
- cee.ug.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
- cee.ug.CuttingPlane.visible
Visibility of the cutting plane. Use this to show or hide a cutting plane in the 3D Viewer.
Methods
getAsProperties
- cee.ug.CuttingPlane.getAsProperties()
Gets the settings for this cutting plane as a Plain Old JavaScript Object (POJO).
- Return type
cee.ug.CuttingPlaneProperties
setFromProperties
- cee.ug.CuttingPlane.setFromProperties(props)
Applies the settings in the given properties object to this cutting plane
- Arguments
props (
Partial[cee.ug.CuttingPlaneProperties]
) –
- Return type
void