2D Concepts

Learning targets

  • Get to to know the geometrical primitives.
  • Build a geometry using different geometrical objects
  • Ports of a geometrical object and translation (here)
  • Rotate a geometrical object

Note

2D geometries for JCMsuite are defined in the Cartesian x-y-plane.

Complex layouts for JCMgeo are built from simple geometrical objects, so called geometrical primitives. A 2D geometry assembled from circles, ellipses, polygons and parallelograms looks like this:

Layout2D {
  Object {
    Circle {
      ...
    }
    Ellipse {
      ...
    }
    Parallelogram {
      ...
    }
    Trapezoid {
      ...
    }
    Polygon {
      ...
    }
    ...
  }
}

The resulting geometry and mesh might correspond to the following figure:

_images/snapshot_0021.png

Each geometrical primitive comes with specific parameters like a name, a domain identifier, positioning parameters and other parameters to fix the shape. For a complete description of all parameters, please consult the JCMsuite Parameter Reference.

Ports

For positioning we used the parameter GlobalPosition, e.g. for the circle we fixed the circumcenter position by:

Circle {
  ...
  GlobalPosition = [-1 -0.25]
}

As a general concept each geometrical object is considered to be constructed in a local coordinate system first. For the circle example the circumcenter coincides with the origin in this local coordinate system. For positioning purposes (global or relative) a geometrical object comes with a number of predefined ports. For the circle these are the ports North, East, South, West and Center,

_images/circle_ports.svg

whereas the parallelogram comes with nine ports. As shown in the figure a port is equipped with a local coordinate system which we will use later for gluing objects together.

To address a port we use the parameter Port, e.g.

Circle {
  ...
  Port = Center
  GlobalPosition = [-1 -0.25]
}

Omitting this parameter will lead to the usage of the object’s default port which is just Center for the circle case. With the GlobalPosition the object is translated, so that position of the specified port matches the given position GlobalPosition in the global coordinate system. Hence the definition

Parallelogram {
  ...
  Port = Point2
  GlobalPosition = [0.0 0.0]
}

will translate a parallelogram, so that the port Point2 lies at position [0.0, 0.0].

Rotation

To rotate an object around its port we use the parameter RotationAngle. For example, for the ellipse we used the following definition:

Ellipse {
  ...
  RadiusX = 0.3
  RadiusY = 0.2
  GlobalPosition = [0.3 -0.75]
  RotationAngle = 45
}

In the local coordinate system the major semi-axes of the ellipse are in the x- and y-direction with center [0, 0]. The center is displaced to [0.3, -0.75] followed by a rotation around the port as it appears in the global coordinate space.