Entity descriptions

Geometric models contain one or more entities. The description begins with the number of entities in the model. The following entities are in use:

Cylinder

A cylinder (cyl) has radius, length, start point and axis direction.

cyl  r len x y z x_dx x_dy x_dz

Cone

A cone has two radii, length, start point and axis direction. The first radius is at the start point.

cone r1 r2 len x y z x_dx x_dy x_dz

Toroid

A toroid (tor) has radius of curvature, radius of tube, opening angle in radians, start point and two unit vectors that give the local x- and y-directions. The center of curvature is located at {0, R, 0} in local coordinates. The other end point is at {R*sin(beta), R*(1 - cos(beta)), 0}.

tor R r beta x y z x_dx x_dy x_dz y_dx y_dy y_dz

Box

A box has length, width, height, location and two unit vectors giving the directions for length and width axis.

box l w h x y z l_dx l_dy l_dz w_dx w_dy w_dz

Sphere

A sphere (sph) has radius and location of center point.

sph r x y z

Dish

A dish has the radius of the generating sphere, distance of cutting plane measured from the center of the sphere, center point of sphere and axis direction pointing from the center to the "pole" of the dish. Note that cut distance is negative if the cutting plane is not located between the center point and the "pole". For a hemisphere the cut distance is 0.0. For a full sphere it would be  -radius.

dish R len x y z x_dx x_dy x_dz

Eccentric cone

An eccentric cone (econe) has two radii, length, eccentricity, start point and two axis directions. The second end point will be located at:

x2 = x1 + length*x_dx + ecc*z_dx

y2 = y1 + length*x_dy + ecc*z_dy

z2 = z1 + length*x_dz + ecc*z_dz

Ends are perpendicular to the first axis direction. The second axis direction should be also perpendicular to the first axis direction.

econe r1 r2 len ecc x y z x_dx x_dy x_dz z_dx z_dy z_dz

Linear sweep

A linear sweep is modeled by extruding a 2D cross-section from point {x, y, z} into direction {z_dx, z_dy, z_dz} by distance 'len'. The x-axis in the cross-section points towards direction {x_dx, x_dy, x_dz}. The direction of the y-axis is the cross product of z and x-axes. Normals of endcut planes are given by directions n1 and n2.

The cross-section consists of a boundary curve and curves defining optional holes. 'nr_curves' gives the total number of curves in the section. Coordinates are given in x-y plane. The sweep line penetrates the cross-section at {0,0}. The definition of each curve begins with the number of segments in the curve and coordinates of the start point.

There are three types of segments: linear segments (0), circular arcs (1), and Bézier curves (2). Each segment begins with a type number which is immediately followed by segment data. The segment data consists of the following:

  • For linear segments, the coordinates of the end point.
  • For circular arcs, the coordinates of the center point and the opening angle (in radians). Positive angle indicates counterclockwise rotation around the center point. The arc begins from the end of the previous segment or from the start point of the curve if the arc is the first segment.
  • For Bézier curves (they are cubic Bézier curves), the coordinates of the two control points between the end points and, as a third point, the coordinates of the end point.

sweep len x y z z_dx z_dy z_dz x_dx x_dy x_dz n1_dx n1_dy n1_dz

      n2_dx n2_dy n2_dz

      nr_curves

nr_segments s_x s_y

0 x1 y1 0 x2 y2 1 c_x3 c_y3 angle3 ...

Face set

A face set (fs) has a header followed by a list of points followed by a list of face descriptions. Header contains the number of points and faces. In the list of points each point has its x y and z coordinates separated with a space. Each face has a face description. This begins with the number of vertexes in the face. For each vertex there is a point index and type of edge starting from that point. Point indices start from 0.

fs    nr_points nr_faces

        x0 y0 z0

        x1 y1 z1

        ...

       nr_verteces v0 t0 v1 t1 ...

         ...

Edge types are:

  • V for visible, real edge,

  • S for edge joins faces originating from a smooth surface. Edge itself is visible only when at silhouette.

  • I for invisible edge, probably created during triangulation.

If faces are actually holes in the most recently defined boundary face following signaling takes place via the edge type of the first edge.

For holes edge types are

  • i for visible, real edge

  • v for edge joins faces originating from a smooth surface. Edge itself is visible only when at silhouette.

  • s for invisible edge, probably created during triangulation.

Polyline

pl  nr_points closed

    x0 y0 z0

    x1 y1 z1

    ...

    xn yn zn

    w0

    w1

    ...

Description:

  • nr_points, number of vertices in a polyline.

  • closed, flag for closed polylines. If this is set to 0, polyline is open and 1, if it is closed. This means that the first and the last vertex are the same point.

Coordinates:

After header, vertices are listed so that polyline's first vertex is listed first, second vertex is listed next etc. Every x, y and z-coordinate is separated with a space .

Width:

After vertices are listed width data of every line between vertex points. First width value is the value of the line between vertices 0 (x0, y0, z0) and 1 (x1, y1, z1). Second value is the width of the line between vertices 1 to 2 etc.