Rendering Body Shapes

About Body Shapes

You can choose how the visualization window renders the bodies; see Choosing the Body Shape. There are two available rendering shapes:

Choosing the Body Shape

You choose the body rendering in the SimMechanics™ toolbar of the SimMechanics visualization window. You can render the bodies of your machine with either convex hulls, or ellipsoids, or both. See Introducing the SimMechanics™ Visualization Window in this chapter for visualization control details.

Equivalent Ellipsoids

The inertia tensor I of a rigid body is real and symmetric, so it has three real eigenvalues (I1, I2, I3) and three orthogonal eigenvectors. These eigenvectors are the principal axes of the body. In the coordinate system defined by those axes, the inertia tensor is diagonal. The trace of the inertia tensor, Tr(I) = I1+ I2 + I3, is the same in any coordinate system with its origin at the body's center of gravity (CG).

Every rigid body has a unique equivalent ellipsoid, a homogeneous solid ellipsoid of the same inertia tensor. The ellipsoid surface is given by

The three parameters (ax, ay, az) are the generalized radii of the ellipsoid. For axis i = 1,2,3,

Triangle Inequalities

The principal moments (I1, I2, I3) must satisfy the triangle inequalities:

Violation of the triangle inequality for Ii leads to an unphysical imaginary generalized radius ai.

Ellipsoids with Special Symmetry

In general, all three Ii, i = 1,2,3, are unequal. Such a body is an asymmetric top. If two of the three Ii are equal (double degeneracy), the body is a symmetric top. The third axis is the axis of symmetry. If all three Ii are equal (triple degeneracy), the body is a spherical top and dynamically equivalent to a homogeneous sphere.

Reduced-Dimension Ellipsoids

In special cases, the equivalent ellipsoid reduces to a planar, linear, or point figure.

Let (i,j,k) label the three axes (1,2,3) = (x,y,z) in any order.

Example: Simple Pendulum Rod

Consider the simple pendulum rod in Visualizing a Simple Mechanical Model in the Visualizing and Animating Machines chapter. You can open the model by entering mech_spen at the command line.

The rod length L = 1 m, and its radius r = 1 cm. The inertia tensor is

Because the rod has an axis of symmetry, the x-axis in this case, two of its three principal moments are equal: Iyy = Izz, and two of its three generalized radii are equal: ay = az. The rod is a symmetric top and, since r is much smaller than L, its equivalent ellipsoid is almost a line of zero volume and area.

The generalized radii of the equivalent ellipsoid are ax = = 0.646 m and ay = az = = 1.12 cm. This is the rod so rendered:

Convex Hulls

Every Body has at least one Body coordinate system (CS) at the CG. A Body also has one or more extra Body CSs for the attached Joints, as well as possible Actuators and Sensors. Each Body CS has an origin point, and the collection of all these points, in general, defines a volume in space. The minimum outward-bending surface enclosing such a volume is the convex hull of the Body CSs, and this is the alternative SimMechanics body rendering.

To enclose a nonzero volume, the set must have at least four non-coplanar Body CSs. Three non-collinear Body CSs are rendered instead by a triangle, and two non-coincident origins by a line. One is displayed just as a point. (The minimum one Body CS would be just the CG CS.) Four or more coplanar origins are rendered by a triangle, three or more collinear origins are rendered by a line, and two or more coincident origins are rendered by a point.

Example: Four-Cylinder Engine Crank

Refer to the four-cylinder engine model of the Demos library by entering mech_fceng at the command line.

Double-click the Engine Block subsystem and note the Crank block representing the engine crank. This Body block has six Body CSs. Visualize the engine as convex hulls with the SimMechanics visualization window. The large block in your visualization is this engine crank, and it encloses a nonzero volume.

Four Cylinder Engine Example: Engine Crank Convex Hull (Yellow)

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS