Main Content

addVisual

Add visual geometry data to rigid body

Description

addVisual(body,type,parameters) adds the visuals of a geometry of the specified type type and geometric parameters parameters to the specified rigid body body.

addVisual(___,tform) specifies a homogeneous transformation for the geometry visual relative to the body frame in addition to any combination of input arguments from previous syntaxes.

Input Arguments

collapse all

RigidBody object, specified as a handle. Create a rigid body object using rigidBody.

Geometry type for geometry, specified as a string scalar. The specified type determines the format of the parameters input.

  • "box"[x y z]

  • "cylinder"[radius length]

  • "capsule"[radius length]

  • "sphere"radius

  • "mesh"n-by-3 matrix of vertices or an STL or DAE file name as a string

Data Types: char | string

Geometry parameters, specified as a numeric vector, numeric matrix, or string scalar. The type input determines the format of this value.

  • "box"[x y z]

  • "cylinder"[radius length]

  • "capsule"[radius length]

  • "sphere"radius

  • "mesh"n-by-3 matrix of vertices or an STL or DAE file name as a string

Data Types: single | double | char | string

Mesh transformation relative to the body coordinate frame, specified as a 4-by-4 homogeneous transformation.

Version History

Introduced in R2017b

expand all