IMPORTANT: You must first create animation frames using AnimationAPI.createAnimationFrames
with a specific name. Then you can reference those frames by providing that same name in this property.
The animation property accepts a name (which must match the name used when creating the animation frames)
and animation options that control how those frames are played. Animation only works when using
ClipPlaneAPI.changeClipPlane, not when initially creating a clip plane.
Setting this property to null stops any active animation.
Example:
// Get the webvis contextconstcontext = webvis.getContext();// First, create animation frames with a specific namecontext.createAnimationFrames("clip_plane_motion", [ { time:0, translation: [0, 0, 0], rotation: [0, 0, 0] }, { time:0.5, translation: [10, 0, 0], rotation: [0, Math.PI/4, 0] }, { time:1, translation: [0, 0, 0], rotation: [0, Math.PI/2, 0] }]);// Create a clip plane (animation won't be applied here)constclipPlaneId = context.createClipPlane({normal: [0, 0, 1],position: [0, 0, 0]});// Apply animation to the existing clip plane, referencing the previously created framescontext.changeClipPlane(clipPlaneId, {animation: {name:"clip_plane_motion", // Must match the name used in createAnimationFramesduration:2000,iterationCount:3 }});// Stop animationcontext.changeClipPlane(clipPlaneId, {animation:null});
List of node IDs which should be exclusively clipped by this clip plane.
When specified, only these nodes will be affected by the clip plane, all others
will be ignored. This property is mutually exclusive with excludedNodes.
Example:
// Get the webvis contextconstcontext = webvis.getContext();// Only clip nodes 123 and 456context.createClipPlane({normal: [0, 1, 0],clippedNodes: [123, 456]});
Default
[]
Optionalenabled
enabled?:boolean
Controls whether the clip plane is enabled or disabled.
When set to false, the clip plane exists but has no effect on the scene.
This allows temporarily disabling clipping without removing the clip plane.
Default
true
OptionalexcludedNodes
excludedNodes?:number[]
List of node IDs which should be excluded from clipping.
When specified, these nodes will not be affected by the clip plane, while all others
will be clipped. This property is mutually exclusive with clippedNodes.
Example:
// Get the webvis contextconstcontext = webvis.getContext();// Clip everything except nodes 123 and 456context.createClipPlane({normal: [0, 1, 0],excludedNodes: [123, 456]});
Default
[]
Optionalinvisible
invisible?:boolean
Controls whether the visual representation of the clip plane is hidden.
When set to true, the clip plane will still perform clipping, but its
visual indicator (the plane outline) will not be displayed.
Default
false
Optionalname
name?:string
The display name of the clip plane.
This name can be used for identification in user interfaces or debugging.
This vector defines the orientation of the clip plane, pointing in the
direction where geometry will be clipped away. The vector will be normalized
internally.
This vector is perpendicular to the normal and defines the orientation of the
plane's visual representation. If not provided, it will be automatically calculated
to be perpendicular to the normal.
Default
[1, 0, 0]
Optionalthickness
thickness?:number
The thickness of the clip plane's non-clipping volume.
When set to a value greater than zero, this creates a volume around the clip plane
where geometry is not clipped. For example, if thickness is set to 1.0, then geometry
within 1.0 units perpendicular distance on both sides of the plane will remain visible,
regardless of which side of the plane it's on. This is useful for creating cross-section
views that highlight geometry near the cut plane.
Configuration properties for clip planes.
These properties control the position, orientation, appearance, and behavior of clip planes. They can be used when creating or modifying clip planes.
See