Main Content

createBody

Class: Aero.Animation
Namespace: Aero

Create body and its associated patches in animation

Syntax

idx = createBody(h,bodyDataSrc)
idx = createBody(h,bodyDataSrc,geometrysource)

Description

idx = createBody(h,bodyDataSrc) creates a new body using the body data source file bodyDataSrc, makes patches for the body, and adds the body to the animation object h. This command assumes a default geometry source type set to Auto. It returns idx as the body index. The new body created is an Aero.Body object.

idx = createBody(h,bodyDataSrc,geometrysource) creates a new body, makes patches for the body, and adds the body to the animation object h. geometrysource is the geometry source type for the body.

Input Arguments

expand all

Aerospace animation object, specified as an Aero.Animation object.

Body data source file, specified as a character vector, string scalar, or structure containing fields of name, faces, vertices, and cdata as MATLAB variables.

Geometry source type for body, specified as one of these values.

ValueDescription

'Auto'

Recognize .mat extensions as MAT-files, .ac extensions as AC3D files, and structures containing fields of name, faces, vertices, and cdata as MATLAB variables.

'Variable'

Recognize structures containing fields of name, faces, vertices, and cdata as MATLAB variables.

'MatFile'

Recognize .mat extensions as MAT-files.

'Ac3d'

Recognize .ac extensions as AC3D files.

'Custom'

Recognize custom extensions.

Output Arguments

expand all

Body index, returned as a scalar.

Examples

expand all

Create a body for the animation object, h. Use the AC3D format data source pa24-250_orange.ac for the body.

h = Aero.Animation;
idx1 = createBody(h,'pa24-250_orange.ac','Ac3d');

Version History

Introduced in R2007a