Main Content

show

Show collision geometry

Description

ax = show(geom) returns the axes under which the collision geometry is plotted.

[ax,patchobj] = show(geom) returns the patchobj graphic object that represents the collision geometry in the plot.

example

show(geom) shows the collision geometry in the current figure at its current pose. The tessellation is generated automatically.

show(geom,'Parent',AX) specifies the axes AX in which to plot the collision geometry.

Examples

collapse all

Create a cylinder collision geometry. The cylinder has a length of 3 meters and a radius of 1 meter.

cyl = collisionCylinder(1,3);

Show the cylinder.

show(cyl)

Figure contains an axes object. The axes object contains an object of type patch.

Show the cylinder in a new figure, and return the patch object that represents the cylinder. Change the cylinder color to cyan by changing the RGB value of the FaceColor field in the patch object. Hide the edges by setting EdgeColor to 'none'.

figure
[~,patchObj] = show(cyl);
patchObj.FaceColor = [0 1 1];
patchObj.EdgeColor = 'none';

Figure contains an axes object. The axes object contains an object of type patch.

Input Arguments

collapse all

Collision geometry to show.

Axes in which to plot the collision geometry, specified as an Axes object.

Output Arguments

collapse all

Axes under which the collision geometry geom is shown, returned as an Axes object. For more information, see Axes Properties.

Graphic object that represents the collision geometry, returned as a Patch object. For more information, see Patch Properties.

Introduced in R2019b