Contenido principal

simscape.multibody.Sphere Class

R2026b

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

Create spherical geometry

Since R2022a

Description

Use an object of the simscape.multibody.Sphere class to represent spherical geometry. The reference frame of the sphere is located at the centroid of the sphere. To specify the dimensions of the geometry, use the Radius property.

Example of spherical geometry

Class Attributes

Sealed
true
ConstructOnLoad
true
RestrictsSubclassing
true

For information on class attributes, see Class Attributes.

Creation

Description

sphere = simscape.multibody.sphere creates a spherical geometry with default values.

sphere = simscape.multibody.Sphere(radius) creates a spherical geometry with the specified radius.

sphere = simscape.multibody.Sphere(radius,surfaceGraphic) creates a spherical geometry with the specified radius and surface visualization properties.

example

Properties

expand all

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

Radius of sphere

Example: simscape.Value(85,"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 spherical geometry with custom surface visualization properties.

Create a SurfaceGraphic object with a green color and opacity of 0.7.

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

Create a spherical geometry with a radius of 0.1 m and the surface graphic.

sphere = simscape.multibody.Sphere(simscape.Value(0.1,"m"), sg)
sphere =
  Sphere with properties:

            Radius: 0.1000 (m)
    SurfaceGraphic: [1x1 simscape.multibody.SurfaceGraphic]

Version History

Introduced in R2022a