How the data sort in Klayout?

Hi sir,
if I using the coda as this one.

die=input(71,0)
die.data.each do |xx|
puts  xx
end

Klayout DRC will output what the data of layer 71 , 0.
but do you have sort the data before ouptut?

Comments

  • Hi sir ,
    I means that , maybe Klayout will sort the cooridnate of data , (I guess it)
    the first row of data will been the one most top / right of all .
    and the last row of data will been the one most bottom / left of all .
    is it correct?

  • Hi @jiunnweiyeh,

    No, there is no sorting order. The order of shapes is more or less random.

    You can get some kind of sorting if you employ the "<" and "!=" operators of the Polygon object:

    die.data.each.sort { |a,b| a != b ? (a < b ? -1 : 1) : 0 }.each do |p|
       ...
    done
    

    Matthias

Sign In or Register to comment.