.d

From Odwiki

Jump to: navigation, search

The .d geometry format

The .d format is a very simple format storing move/draw commands. It only generates polygons and has very little support for attributes. The .d format consists of three types of lines, determined by the first character in the line

  • # denotes a comment
  • m specifies a move command (lifts the pen and moves the cursor)
  • d draws a line from the previous position to the given position

The move and draw commands are followed by three floating point numbers (representing the point in space).

.geo example ffile

This is a .geo file representing an open arc and a closed square

   PGEOMETRY V5
   NPoints 8 NPrims 2
   NPointGroups 0 NPrimGroups 0
   NPointAttrib 0 NVertexAttrib 0 NPrimAttrib 0 NAttrib 0
   -0.6 0 0 1 
   -1.1 0.866025448 0 1 
   -2.1 0.866025329 0 1 
   -2.6 0 0 1 
   -0.1 -1 0 1 
   1.9 -1 0 1 
   -0.1 1 0 1 
   1.9 1 0 1 
   Poly 4 : 0 1 2 3
   Poly 4 < 4 5 7 6
   beginExtra
   endExtra

.d example ffile

This is the corresponding .d file

   m -0.6 0 0
   d -1.1 0.866025 0
   d -2.1 0.866025 0
   d -2.6 0 0
   m -0.1 -1 0
   d 1.9 -1 0
   d 1.9 1 0
   d -0.1 1 0
   d -0.1 -1 0
© 2009 od[force].net | advertise