plot::ClippingBox

Clipping of 3D objects

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

plot::ClippingBox(xmin .. xmax, ymin .. ymax, zmin .. zmax, <a = amin .. amax>, options)

Description

A plot::ClippingBox defines a cubic box with edges parallel to the coordinate axes. When a clipping box is inserted in a 3D scene, only the parts of the graphical objects in the scene are visible that lie inside the coordinate range defined by the clipping box.

Inserting a plot::ClippingBox into a 3D scene has a similar effect as specifying a viewing box for the scene by the attribute ViewingBox.

However, the specified viewing box fills the entire drawing region of the plot, whereas a plot::ClippingBox preserves the space in the drawing region that the invisible parts would fill if no clipping box was used.

Moreover, in contrast to plot::ClippingBox, the visibility range defined by the ViewingBox cannot be animated.

In fact, the main purpose of plot::ClippingBox is to provide an animated version of the ViewingBox.

Size and location of the ViewingBox remain unaffected by the presence of a clipping box. Also coordinate axes are not clipped.

Only one single plot::ClippingBox should be used inside a 3D scene.

Attributes

AttributePurposeDefault Value
Framesthe number of frames in an animation50
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0
VisiblevisibilityTRUE
XMaxfinal value of parameter “x” 
XMininitial value of parameter “x” 
XRangerange of parameter “x” 
YMaxfinal value of parameter “y” 
YMininitial value of parameter “y” 
YRangerange of parameter “y” 
ZMaxfinal value of parameter “z” 
ZMininitial value of parameter “z” 
ZRangerange of parameter “z” 

Examples

Example 1

We plot a full sphere yet rendering only a part of it visible. This is done by passing a suitable animated plot::ClippingBox to the plot command. Note that the viewing box remains unaffected:

plot(plot::Sphere(1, [0, 0, 0]), 
     plot::ClippingBox(-1 + a .. 1 - a, 
                       -1 + a .. 1 - a,
                       -1 .. 1, a = 0..1))

Example 2

We plot a Klein bottle. By chopping off the upper parts, one can have a look inside:

KleinBottle := plot::Tube([6*cos(u)*(sin(u)-1), 0, 14*sin(u)],
                           4 - 2*cos(u), u = -PI..PI):
C := plot::ClippingBox(-15..15, -10..10, -20.. a, 
                       a = 15 .. -20):
plot(KleinBottle, C, Axes = None)

delete KleinBottle, C:

Parameters

xmin, xmax

The borders of the visible range of the x coordinate: numerical real values or arithmetical expressions of the animation parameter a.

xmin, xmax are equivalent to the attributes XMin, XMax.

ymin, ymax

The borders of the visible range of the y coordinate: numerical real values or arithmetical expressions of the animation parameter a.

ymin, ymax are equivalent to the attributes YMin, YMax.

zmin, zmax

The borders of the visible range of the z coordinate: numerical real values or arithmetical expressions of the animation parameter a.

zmin, zmax are equivalent to the attributes ZMin, ZMax.

a

Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.

See Also

MuPAD Functions

MuPAD Graphical Primitives