the fair gds editor DotWidthMacro
Please Sign in

Dot Width

Some laser writers use zero width paths with a single point as a dot. These dots may scarcely be visible, in particular if these dots are located on a grid. To make dots better visible this macro will set a width to it.

Download: pathDotWidth.layout

   1 #!/usr/bin/layout
   2 #name=path dot
   3 #help=set the width of pathes with a single point or two identical points
   4 
   5 int  main() {
   6   // get first cell
   7   cellList *cells=layout->drawing->firstCell;
   8 
   9   // loop over all cells
  10   while (cells!=NULL){  
  11     if (cells->thisCell!=NULL){
  12        // get first Element of this cell
  13        elementList *l=cells->thisCell->firstElement;
  14       
  15        // loop over all elements
  16        while (l!=NULL) {
  17            if (l->thisElement!=NULL) {
  18                 
  19                 // if element is a path with a width less than 0
  20                 if ( l->thisElement->isPath() ){
  21                   pointArray pa=l->thisElement->getPoints();
  22                   bool change=false;
  23                   if (pa.size()==2){
  24                         if (pa.point(0)==pa.point(1)){change=true;}
  25                         }
  26                   if (pa.size()==1){change=true;}
  27                   if (change) {
  28                                 // setWidth 
  29                                 l->thisElement->setWidth(1000);
  30                                 l->thisElement->setCap(1);
  31 
  32                                 // reset width to zero
  33                                 //l->thisElement->setWidth(0);
  34                                 //l->thisElement->setCap(0);
  35                                 }
  36                   }
  37                }
  38            l=l->nextElement;
  39        }
  40 
  41     //round all selected elements
  42     cells->thisCell->roundSelect(10); 
  43     cells->thisCell->deselectAll();
  44     }
  45     cells=cells->nextCell;
  46   }
  47 }
  48  

See also


CategoryMacro


DotWidthMacro (last edited 2010-12-26 19:48:17 by dslb-092-075-140-183)