| Contents | Index |
| On this page… |
|---|
Choosing Custom Body Geometries Switching Between Standard Body Geometries Obtaining STL Body Graphics Files for Custom Body Geometries |
Using body mass and geometry information from the Body block alone, the SimMechanics visualization window allows you two choices of standard body geometry, the convex hull and the equivalent ellipsoid.
You also have the choice of a nonstandard body geometry specified by an external graphics file.
The SimMechanics initial default body geometry for visualized bodies is the convex hull.
You can change the initial default of convex hulls to equivalent ellipsoids for all visualized bodies in a model.
Open the Configuration Parameters dialog, then go to the SimMechanics node.
In the Visualization area, select Equivalent ellipsoid from mass properties from the Default body geometries pull-down menu.
Click Apply or OK.
Note You can override the model-wide default body geometry, both for a whole machine and for individual bodies. |
The initial default is for a machine to inherit its model-wide body geometry. You can override the initial default by specifying a different machine-wide default geometry for all the bodies in one machine in your model.
Open that machine's Machine Environment block dialog and click its Visualization tab.
In the Default body geometries pull-down menu, choose a new machine-wide default, either Convex hull from body CS locations or Equivalent ellipsoid from mass properties.
Click Apply or OK.
Note You can override the machine-wide default body geometry for any individual body within the machine. |
The initial default is for a Body to inherit its machine-wide body geometry. You can override the initial default by specifying a different geometry for an individual visualized body.
Open the Body block dialog and click its Visualization tab.
In the Body geometry pull-down menu, choose either Convex hull from body CS locations or Equivalent ellipsoid from mass properties.
Click Apply or OK.
SimMechanics visualization supports the specification of body geometry (size and shape) with stereolithographic (STL) files in either ASCII or binary format. Each body with a custom geometry requires one STL file to provide this geometry.
Stereolithography specifies the three-dimensional surface geometry of a body by linked triangles whose edges and vertices are oriented by the right-hand rule. The orientation defines an "outside" and an "inside" of the surface. The edges and vertices of the elementary triangles join to form a continuous surface. A closed surface of such linked triangles approximates a body's smooth curved surface.

Stereolithographic triangles have some similarity to convex hulls. But convex hulls are directly and solely determined by the origins of the Body coordinate systems. Convex hulls are not necessarily made up of triangles. An STL file can specify an arbitrary number of elementary oriented triangles with vertices at arbitrary points in space. These vertices have no necessary connection to the Body coordinate systems.
You can obtain STL body geometry files from a number of sources.
You can write a new STL file as a text file, following the STL standard.
You can generate an STL file from many mechanical design applications, such as computer-aided design (CAD) platforms.
The SimMechanics Link utility exports an STL file for each part in a CAD assembly. The CAD platform must be linked to the SimMechanics Link utility.
You can reuse existing STL files, possibly with your own modifications. You can obtain such STL files from SimMechanics demos, other applications, and CAD-oriented Web sites.
Note Refer to the SimMechanics Link documentation for more information about exported STL files. |
You can switch from the standard body geometries to a custom body geometry by changing the Body block to reference an external body geometry file. This custom body geometry specification overrides the model- and machine-wide defaults, but only for this body.
The external body geometry file must be in STL format.
Caution In order for custom visualization to work, this STL file must be either:
Otherwise, visualization reverts to the default body geometry. |
Open the Body block dialog and click its Visualization tab.
In the Body geometry pull-down menu, choose External graphics file.
The External graphics file field and Attached to Body CS pull-menu appear.
Enter the graphics file name and any necessary path in the field.
From the pull-down menu, choose which Body CS to attach the graphics to. (The Body CSs are listed in the Body's Position tab.) This Body CS serves as the reference for the origin, coordinate axes, and units of the body geometry.
Click Apply or OK.
Body Dialog: Visualization Tab and External Body Geometry Reference

The external graphics file has no intrinsic geometric origin, orientation, or units. The attached Body CS provides an origin, axis directions (orientation), and units of length to interpret the geometric information specified by the external graphics file.
Tip If you need a body geometry origin, orientation, or system of units that is not represented in your current list of Body coordinate systems, create a new Body CS in the Position tab with the geometric features you want. You can make this Body CS invisible on the Body block if you wish. |
![]() | Customizing Visualized Body Colors | Visualizing with a Virtual Reality Client | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |