Main Content

simscape.multibody.Cylinder Class

R2026b

Namespace: simscape.multibody
Superclasses: simscape.multibody.Geometry

Create cylindrical geometry

Since R2022a

Description

Use an object of the simscape.multibody.Cylinder class to represent cylindrical geometry. To specify the dimensions of the geometry, use the Radius and Length properties. The reference frame of the cylinder is located at the centroid of the cylinder, and the axis of the cylinder is aligned with the z-axis of the reference frame.

Example of cylindrical geometry

Class Attributes

Sealed
true
ConstructOnLoad
true
RestrictsSubclassing
true

For information on class attributes, see Class Attributes.

Creation

Description

cylinder = simscape.multibody.Cylinder creates a cylindrical geometry with default values.

cylinder = simscape.multibody.Cylinder(radius,length) creates a cylindrical geometry with the specified radius and length.

cylinder = simscape.multibody.Cylinder(radius,length,surfaceGraphic) creates a cylindrical geometry with the specified radius, length, and surface visualization properties.

example

Properties

expand all

Radius of the cylindrical geometry, specified as a simscape.Value object that represents a scalar with a unit of length.

Cylinder with an arrow representing the radius

Example: simscape.Value(10, "mm")

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Length of the cylindrical geometry, specified as a simscape.Value object that represents a scalar with a unit of length. The length of the cylinder is aligned with the z-axis of the reference frame.

Cylinder with line indicating the length

Example: simscape.Value(30,"mm")

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Surface visualization properties of the geometry, specified as a simscape.multibody.SurfaceGraphic object.

Attributes:

GetAccess
public
SetAccess
public

Examples

collapse all

This example shows how to create a cylindrical geometry with custom surface visualization properties.

Create a SurfaceGraphic object with a blue color and opacity of 0.8.

sg = simscape.multibody.SurfaceGraphic(simscape.multibody.SimpleVisualProperties([0 0 1], 0.8));

Create a cylindrical geometry with a radius of 0.05 m and a length of 0.2 m, and the surface graphic.

cyl = simscape.multibody.Cylinder(simscape.Value(0.05,"m"), simscape.Value(0.2,"m"), sg)
cyl =
  Cylinder with properties:

            Radius: 0.0500 (m)
            Length: 0.2000 (m)
    SurfaceGraphic: [1x1 simscape.multibody.SurfaceGraphic]

Version History

Introduced in R2022a