WOLFRAM SYSTEM MODELER

FixedShape

Visualizing an elementary shape with dynamically varying shape attributes (has one frame connector)

Wolfram Language

In[1]:=
SystemModel["Modelica.Mechanics.MultiBody.Visualizers.FixedShape"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Model FixedShape defines a visual shape that is shown at the location of its frame_a. All describing data such as size and color can vary dynamically by providing appropriate expressions in the input fields of the parameter menu. The only exception is parameter shapeType that cannot be changed during simulation. The following shapes are currently supported via parameter shapeType (e.g., shapeType="box"):
 

model Visualizers.FixedShape

The dark blue arrows in the figure above are directed along variable lengthDirection. The light blue arrows are directed along variable widthDirection. The coordinate systems in the figure represent frame_a of the FixedShape component.

Additionally, external shapes can be specified as (not all options might be supported by all tools):

  • "1", "2", …
    define external shapes specified in DXF format in files "1.dxf", "2.dxf", … The DXF-files must be found either in the current directory or in the directory where the Shape instance is stored that references the DXF file. This (very limited) option should not be used for new models. Example:
    shapeType="1".
  • "modelica://<Modelica-name>/<relative-path-file-name>"
    characterizes the file that is stored under the location of the <Modelica-name> library path with the given relative file name. Example:
    shapeType = "modelica://Modelica/Resources/Data/Shapes/Engine/piston.dxf".
  • "file://<absolute-file-name>"
    characterizes an absolute file name in the file system. Example:
    shapeType="file://C:/users/myname/shapes/piston.dxf".

The supported file formats are tool dependent. Most tools support at least DXF-files but may support other format as well (such as stl, obj, 3ds). Since visualization files contain color and other data, the corresponding information in the model is usually ignored. For information about DXF files, see Wikipedia. As a default it is assumed that the DXF coordinates are in the "frame_a"-system and in meters, and that the 3dfaces are two-sided. Some tools support only 3dface (for geometry) and layer (for advanced coloring).

The sizes of any of the above components are specified by the length, width and height variables. Via variable extra additional data can be defined:

shapeTypeMeaning of parameter extra
"cylinder" if extra > 0, a black line is included in the cylinder to show the rotation of it.
"cone" extra = diameter-left-side / diameter-right-side, i.e.,
extra = 1: cylinder
extra = 0: "real" cone.
"pipe" extra = outer-diameter / inner-diameter, i.e,
extra = 1: cylinder that is completely hollow
extra = 0: cylinder without a hole.
"gearwheel" extra is the number of teeth of the (external) gear. If extra < 0, an internal gear is visualized with |extra| teeth. The axis of the gearwheel is along "lengthDirection", and usually: width = height = 2*radiusOfGearWheel.
"spring" extra is the number of windings of the spring. Additionally, "height" is not the "height" but 2*coil-width.
external shape extra = 0: Visualization from file is not scaled.
extra = 1: Visualization from file is scaled with "length", "width" and "height" of the shape

Parameter color is a vector with 3 elements, {r, g, b}, and specifies the color of the shape. {r, g, b} are the "red", "green" and "blue" color parts. Note, r, g and b are given as Integer[3] in the ranges 0 … 255, respectively. The predefined type MultiBody.Types.Color contains a menu definition of the colors used in the MultiBody library together with a color editor.

Parameters (2)

animation

Value: true

Type: Boolean

Description: = true, if animation shall be enabled

shapeType

Value: "box"

Type: ShapeType

Description: Type of shape

Inputs (9)

r_shape

Default Value: {0, 0, 0}

Type: Position[3] (m)

Description: Vector from frame_a to shape origin, resolved in frame_a

lengthDirection

Default Value: {1, 0, 0}

Type: Axis

Description: Vector in length direction of shape, resolved in frame_a

widthDirection

Default Value: {0, 1, 0}

Type: Axis

Description: Vector in width direction of shape, resolved in frame_a

length

Type: Distance (m)

Description: Length of shape

width

Type: Distance (m)

Description: Width of shape

height

Type: Distance (m)

Description: Height of shape

color

Default Value: {0, 128, 255}

Type: Color

Description: Color of shape

extra

Default Value: 0.0

Type: ShapeExtra

Description: Additional data for cylinder, cone, pipe, gearwheel and spring

specularCoefficient

Default Value: world.defaultSpecularCoefficient

Type: SpecularCoefficient

Description: Reflection of ambient light (= 0: light is completely absorbed)

Connectors (1)

frame_a

Type: Frame_a

Description: Coordinate system in which visualization data is resolved

Components (2)

world

Type: World

Description: World coordinate system + gravity field + default animation definition

vis

Type: Shape

Description: Visualizing an elementary object with variable size; all data have to be set as modifiers (see info layer)

Used in Examples (2)

RollingWheelSetDriving

Modelica.Mechanics.MultiBody.Examples.Elementary

Rolling wheel set that is driven by torques driving the wheels

RollingWheelSetPulling

Modelica.Mechanics.MultiBody.Examples.Elementary

Rolling wheel set that is pulled by a force

Used in Components (3)

Cylinder_analytic_CAD

Modelica.Mechanics.MultiBody.Examples.Loops.Utilities

One cylinder with analytic handling of kinematic loop and CAD visualization

RollingWheel

Modelica.Mechanics.MultiBody.Parts

Ideal rolling wheel on flat surface z=0 (5 positional, 3 velocity degrees of freedom)

RollingWheelSet

Modelica.Mechanics.MultiBody.Parts

Ideal rolling wheel set consisting of two ideal rolling wheels connected together by an axis