modelVector
Extends from ModelicaServices.Animation.Vector (Animation of a moveable vector-quantity (the length is not fixed in meters)), Modelica.Utilities.Internal.PartialModelicaServices.Animation.PartialVector (Interface for 3D animation of a vector quantity (force, torque etc)).
Information
Model Vector defines an arrow that dynamically visualizes a physical vector of selected quantity at the defined location (see variables below). Thus, the arrow length does not represent a physical length (except, of course, for quantity = RelativePosition), but a different 3-dimensional quantity (such as force, torque, speed, …), defined by MultiBody.Types.VectorQuantity. That allows the vectors of similar quantities to be scaled appropriately during post-processing. This is useful even for RelativePosition, and in that case to disable or exaggerate the relative positions.
The dialog variables R, r, coordinates, color,
specularCoefficient, quantity, headAtOrigin, and twoHeadedArrow
are declared as (time varying) input variables.
If the default equation is not appropriate, a corresponding
modifier equation has to be provided in the
model where a Vector instance is used, e.g., in the form
Visualizers.Advanced.Vector vectorForce(coordinates = {sin(time),cos(time),0});
Variable color is an Integer 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 in the range 0 … 255.
The predefined type
MultiBody.Types.Color
contains a menu definition of the colors used in the MultiBody
library together with a color editor.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Types.VectorQuantity | quantity (from PartialVector) | Types.VectorQuantity.Force | Quantity of the coordinates |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Frames.Orientation | R (from PartialVector) | Frames.nullRotation() | Orientation object to rotate the world frame into the vector frame |
| SI.Position[3] | r (from PartialVector) | {0, 0, 0} | Position vector from origin of world frame to origin of vector frame, resolved in world frame |
| Real[3] | coordinates (from PartialVector) | {0, 0, 0} | Coordinates of the vector resolved in vector frame |
| Types.Color | color (from PartialVector) | Types.Defaults.ArrowColor | Color of vector |
| Types.SpecularCoefficient | specularCoefficient (from PartialVector) | 0.7 | Material property describing the reflecting of ambient light (= 0 means, that light is completely absorbed) |
| Boolean | headAtOrigin (from PartialVector) | false | = true, if the vector is pointing towards the origin of vector frame |
| Boolean | twoHeadedArrow (from PartialVector) | false | = true, if the arrow has two heads after each other (pointing in the same direction) |