Skip to Main Content Skip to Search
Product Documentation

Customizing Visualized Body Geometries

Choosing 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.

Switching Between Standard Body Geometries

The SimMechanics initial default body geometry for visualized bodies is the convex hull.

Changing the Default Geometry for All Bodies in a Model

You can change the initial default of convex hulls to equivalent ellipsoids for all visualized bodies in a model.

  1. Open the Configuration Parameters dialog, then go to the SimMechanics node.

  2. In the Visualization area, select Equivalent ellipsoid from mass properties from the Default body geometries pull-down menu.

  3. Click Apply or OK.

Changing the Default Geometry for All Bodies in a Machine

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.

  1. Open that machine's Machine Environment block dialog and click its Visualization tab.

  2. 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.

  3. Click Apply or OK.

Changing the Geometry of an Individual Body

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.

  1. Open the Body block dialog and click its Visualization tab.

  2. In the Body geometry pull-down menu, choose either Convex hull from body CS locations or Equivalent ellipsoid from mass properties.

  3. Click Apply or OK.

About STL Body Graphics Files

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.

Obtaining STL Body Graphics Files for Custom Body Geometries

You can obtain STL body geometry files from a number of sources.

Switching Between Standard and Custom Body Geometries

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.

Requirements for External Body Geometry Files

The external body geometry file must be in STL format.

Specifying an External Body Geometry File

  1. Open the Body block dialog and click its Visualization tab.

  2. In the Body geometry pull-down menu, choose External graphics file.

    The External graphics file field and Attached to Body CS pull-menu appear.

  3. Enter the graphics file name and any necessary path in the field.

  4. 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.

  5. Click Apply or OK.

Body Dialog: Visualization Tab and External Body Geometry Reference

Attached Body Coordinate System as Geometric Reference for the Body Geometry File

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.

  


Related Products & Applications

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