ARC PCell

edited October 2014 in Ruby Scripting
Hi everyone,

Thanks to the excellent support examples, I was able to place a text PCell. (http://klayout.de/forum/comments.php?DiscussionID=230&page=1#Item_4)

However, I couldn't palce an ARC PCell using a similar code. Here it is:

begin

ly1 = RBA::Layout.new
top = ly1.add_cell("TOP")

# find the lib1
lib1 = RBA::Library.library_by_name("Basic")
lib1 || raise("Unknown lib1 'Basic'")

# find the pcell
pcell_decl1 = lib1.layout.pcell_declaration("CIRCLE")
pcell_decl1 || raise("Unknown PCell 'CIRCLE'")

# set the param1eters
param1 = { "layer" => RBA::LayerInfo::new(2, 0), "radius" =>
50.00, "npoints" => 100}

# build a param1 array using the param1 hash as a source
pv1 = pcell_decl1.get_parameters.collect do |p|
param1[p.name] || p.default
end

# create a PCell variant cell
pcell_var1 = ly1.add_pcell_variant(lib1, pcell_decl1.id, pv1)

# instantiate that cell
t1 = RBA::Trans::new(RBA::Trans::r90, 0, 0)
pcell_inst1 = ly1.cell(top).insert(RBA::CellInstArray::new(pcell_var1, t1))

# write the output
outputFile = "C:\\Users\\Masks\\circle.gds"
ly1.write(outputFile)

end

I guess this could be caused by using wrong parameter values! Maybe!!

Your help is very much appreciated

Comments

  • edited November -1

    Hi,

    this sample is trying to create a CIRCLE PCell, not an ARC.

    To place an ARC PCell, replace the cell name by ARC:

    pcell_decl1 = lib1.layout.pcell_declaration("ARC")
    pcell_decl1 || raise("Unknown PCell 'ARC'")
    

    The parameters are:

    • "layer"
    • "radius1" - inner Radius (µm)
    • "radius2" - outer Radius (µm)
    • "a1" - start angle (degree)
    • "a2" - stop angle (degree)
    • "npoints" - number of interpolation points per full circle

    Matthias

Sign In or Register to comment.