Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

Basic Shapes

The CDL has a short list of various shapes one can use to input a robot's geometry. Let's first walk through each of the operations, with a description of their arguments. Then we'll discuss the parameters which are common to all of them.

Shapes

Let's start with the one shape we've already seen.

Block(x,y,z)

When given three arguments, a block of said dimensions will be oriented and centered at the current reference frame. Note that you must first translate if you wish the block to be positioned with a corner at (0,0,0) in the current reference frame.

If given a fourth argument, it is assumed to be a radius by which to extrude the block, smoothing the sharp edges. The difference can be seen in the following images.

tutorial04.jpg

Block(1,1,1)

tutorial05.jpg

Block(1,1,1, 0.25)

Sphere(rad)

A sphere has only one required argument, its radius. The sphere is placed at the current reference frame.

tutorial06.jpg

Sphere(1.0)

Cylinder(h,rad)

A cylinder needs two arguments, its height and its radius. The cylinder is centered at (0,0,0), and its height is along the z axis. An optional third argument can supply an additional extruding radius, similar to how the edges of a block can be smoothed.

tutorial07.jpg

Cylinder(1.0,1.0)

Convex Hulls

Unlike the above operations, which are single function calls, a convex hull is different, since it can include any number of vertices. A convex hull is defined by two different operations, ConvexHull and Vertex(x,y,z). The former has an optional argument, the extruding radius for the whole hull, and the latter requires three arguments, a position. Vertex operations must be placed with the frame of reference of a ConvexHull. Not doing so is a syntax error.

tutorial08.jpg

ConvexHull without extruding radius

ConvexHull {
  Vertex(1,0,0);
  Vertex(0,1,0);
  Vertex(-1,0,0);
  Vertex(0,-1,0);
  Vertex(0,0,1);
}

tutorial09.jpg

ConvexHull with extruding radius

ConvexHull(0.25) {
  Vertex(1,0,0);
  Vertex(0,1,0);
  Vertex(-1,0,0);
  Vertex(0,-1,0);
  Vertex(0,0,1);
}

Common Parameters

Now that we are working with shapes, we have a few additional parameters we can pass to the operations.


SimLib Reference Documentation