Shape

model Shape "Visualizing an elementary object with variable size; all data have to be set as modifiers (see info layer)"
    extends ModelicaServices.Animation.Shape;
    extends Modelica.Utilities.Internal.PartialModelicaServices.Animation.PartialShape;

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Rectangle(
                    extent = {
                        {-100, -100}, 
                        {80, 60}},
                    lineColor = {0, 0, 255},
                    fillColor = {255, 255, 255},
                    fillPattern = FillPattern.Solid), 
                Polygon(
                    points = {
                        {-100, 60}, 
                        {-80, 100}, 
                        {100, 100}, 
                        {80, 60}, 
                        {-100, 60}},
                    lineColor = {0, 0, 255},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Polygon(
                    points = {
                        {100, 100}, 
                        {100, -60}, 
                        {80, -100}, 
                        {80, 60}, 
                        {100, 100}},
                    lineColor = {0, 0, 255},
                    fillColor = {160, 160, 164},
                    fillPattern = FillPattern.Solid), 
                Text(
                    extent = {
                        {-100, -54}, 
                        {80, 8}},
                    textString = "%shapeType"), 
                Text(
                    extent = {
                        {-150, 150}, 
                        {150, 110}},
                    lineColor = {0, 0, 255},
                    textString = "%name")}),
        Documentation(info = "<html>\n<p>\nModel <strong>Shape</strong> defines a visual shape that is\nshown at the location of its reference coordinate system, called\n'object frame' below. All describing variables such\nas size and color can vary dynamically (with the only exception\nof parameter shapeType). The default equations in the\ndeclarations should be modified by providing appropriate modifier\nequations. Model <strong>Shape</strong> is usually used as a basic building block to\nimplement simpler to use graphical components.\n</p>\n<p>\nThe following shapes are supported via\nparameter <strong>shapeType</strong> (e.g., shapeType=\"box\"):<br>&nbsp;\n</p>\n\n<p>\n<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/Shape.png\" alt=\"model Visualizers.FixedShape\">\n</p>\n\n<p>&nbsp;<br>\nThe dark blue arrows in the figure above are directed along\nvariable <strong>lengthDirection</strong>. The light blue arrows are directed\nalong variable <strong>widthDirection</strong>. The <strong>coordinate systems</strong>\nin the figure represent frame_a of the Shape component.\n</p>\n\n<p>\nAdditionally, <strong>external shapes</strong> can be specified as (not all options might be supported by all tools):\n</p>\n\n<ul>\n<li> <strong>\"1\", \"2\", ...</strong><br>\n     define external shapes specified in DXF format in files \"1.dxf\", \"2.dxf\", ...\n     The DXF-files must be found either in the current directory or in the directory where\n     the Shape instance is stored that references the DXF file.\n     This (very limited) option should not be used for new models. Example:<br>\n    shapeType=\"1\".<br></li>\n\n<li> \"<strong>modelica:</strong>//&lt;Modelica-name&gt;/&lt;relative-path-file-name&gt;\"<br>\n     characterizes the file that is stored under the location of the\n     &lt;Modelica-name&gt; library path with the given relative file name.\n     Example:<br> shapeType = \"modelica://Modelica/Resources/Data/Shapes/Engine/piston.dxf\".<br></li>\n\n<li> \"<strong>file:</strong>//&lt;absolute-file-name&gt;\"<br>\n     characterizes an absolute file name in the file system. Example:<br>\n     shapeType=\"file://C:/users/myname/shapes/piston.dxf\".</li>\n</ul>\n\n<p>\nThe supported file formats are tool dependent. Most tools support at least DXF-files\nbut may support other format as well (such as stl, obj, 3ds).\nSince visualization files contain color and other data, the corresponding\ninformation in the model is usually ignored.\nFor information about DXF files, see <a href=\"https://en.wikipedia.org/wiki/AutoCAD_DXF\">Wikipedia</a>.\nAs 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.\nSome tools support only 3dface (for geometry) and layer (for advanced coloring).\n</p>\n\n<p>\nThe sizes of any of the above components are specified by the\n<strong>length</strong>, <strong>width</strong> and <strong>height</strong> variables.\nVia variable <strong>extra</strong> additional data can be defined:\n</p>\n<table border=1 cellspacing=0 cellpadding=2>\n<tr><th><strong>shapeType</strong></th><th>Meaning of parameter <strong>extra</strong></th></tr>\n<tr>\n  <td>\"cylinder\"</td>\n  <td>if extra&nbsp;&gt;&nbsp;0, a black line is included in the\n      cylinder to show the rotation of it.</td>\n</tr>\n<tr>\n  <td>\"cone\"</td>\n  <td>extra = diameter-left-side / diameter-right-side, i.e.,<br>\n      extra = 1: cylinder<br>\n      extra = 0: \"real\" cone.</td>\n</tr>\n<tr>\n  <td>\"pipe\"</td>\n  <td>extra = outer-diameter / inner-diameter, i.e,<br>\n      extra = 1: cylinder that is completely hollow<br>\n      extra = 0: cylinder without a hole.</td>\n</tr>\n<tr>\n  <td>\"gearwheel\"</td>\n  <td>extra is the number of teeth of the (external) gear.\nIf extra &lt; 0, an internal gear is visualized with |extra| teeth.\nThe axis of the gearwheel is along \"lengthDirection\", and usually:\nwidth = height = 2*radiusOfGearWheel.</td>\n</tr>\n<tr>\n  <td>\"spring\"</td>\n  <td>extra is the number of windings of the spring.\n      Additionally, \"height\" is <strong>not</strong> the \"height\" but\n      2*coil-width.</td>\n</tr>\n<tr>\n  <td>external shape</td>\n  <td>extra = 0: Visualization from file is not scaled.<br>\n                   extra = 1: Visualization from file is scaled with \"length\", \"width\" and \"height\"\n                              of the shape</td>\n</tr>\n</table>\n<p>\nParameter <strong>color</strong> is a vector with 3 elements,\n{r,&nbsp;g,&nbsp;b}, and specifies the color of the shape.\n{r,&nbsp;g,&nbsp;b} are the \"red\", \"green\" and \"blue\" color parts.\nNote, r, g, b are given as Integer[3] in the ranges 0&nbsp;..&nbsp;255,\nrespectively. The predefined type\n<a href=\"modelica://Modelica.Mechanics.MultiBody.Types.Color\">MultiBody.Types.Color</a> contains a menu\ndefinition of the colors used in the MultiBody library together with a color editor.\n</p>\n\n<p>\nThe variables under heading <strong>Parameters</strong> below\nare declared as (time varying) <strong>input</strong> variables.\nIf the default equation is not appropriate, a corresponding\nmodifier equation has to be provided in the\nmodel where a <strong>Shape</strong> instance is used, e.g., in the form\n</p>\n\n<blockquote><pre>\nVisualizers.Advanced.Shape shape(length = sin(time));\n</pre></blockquote>\n</html>"));
end Shape;