It looks like you're new here. If you want to get involved, click one of these buttons!
Hi there!
Hi! I'm a beginner with klayout and im still learning how to program with DRCs.
I've been running into some interesting issues when I'm trying to iterate through each individual shapes using DRC
like the example below, say for layer 10 you got some sort of circle and it isnt very big, but I find the out put of the result would somewhat alter the cordinate of the input shape. It would round it to the nearest integer. I wonder is there a way to make the result to be normal and not rounded?
I do notice that in region it autometically convert the Dpolygon in layers into just a polygon, and I think when you convert a dpolygon into polygon it would round the cordinate, I wonder is there a way to make it not do that, or is there something similar that I could use can avoid this type of issue
L10 = input(10).raw
someRandomRegion = RBA::Region::new()
checkingResultLayer = polygon_layer
L10.each{|someRandomShape| someRandomRegion.insert(RBA::DPolygon::new(someRandomShape))}
someRandomRegion.each{|someRandomShape| checkingResultLayer.insert(RBA::DPolygon::new(someRandomShape))}
checkingResultLayer.output(103, 0)
So with what is it above I decided to try something else, instead of putting the shape into an empty region, I decided to put them into layers and do my operation, but I was encountered with another error
Sorry this piece of code is very very rough, and really diffcult to read, it was mixed with nested functions and gloable varibles, I'm doing all sort of things that that I'm not suppose to do(by the time I wrote this code I didn't know that the capital letter in ruby means constant, so thats why it was global, it also sort of stayed that way since the nested function and stuff)
The code is a bit easy to read if you read the parts that has been comment out, it doesn't have all the nested function and stuff, the reason I did the nested function is because the I thought the error i encountered has something to do with the loop,.
Here is the idea of how this piece code suppose to work and what I'm trying to do
def getSomeHoles(lay10, lay60)
#creating some variables
#
$aALayer = polygon_layer
$releaseHoleLayer = polygon_layer
$resultLayer = polygon_layer
def innerFuc(polygon)
$newPolyLayer = polygon_layer
$newPolyLayer.insert(polygon)
def innerInFuc(eachHole)
bigHole = eachHole.sized(100.um)
$newPolyLayer = $newPolyLayer - bigHole
end
$releaseHoleLayer.inside($newPolyLayer).each{|holes| innerInFuc(holes)}
$newPolyLayer.each{|resultPiece| resultLayer.insert(resultPiece)}
end
lay10.each{|bigAA| $aALayer.insert(bigAA)}
lay60.each{|holes| $releaseHoleLayer.insert(holes)}
$aALayer.each{|asds| innerFuc(asds)} #********* Error*********
#aALayer.each do |bigPolygon|
#newPolyLayer = polygon_layer
#newPolyLayer.insert(bigPolygon)
#releaseHoleLayer.inside(newPolyLayer).each do |singleReleaseHole|
#bigHole = singleReleaseHole.sized(100.um)
#newPolyLayer = newPolyLayer - bigHole
#end
#newPolyLayer.each{|resultPiece| resultLayer.insert(resultPiece)}
#end
return $resultLayer
end
When you try to run this code, it would throw an error at the part where it says #********* Error*********
it would say that $aALayer is not a DRC layer and there fore it doesn't have the .each
thing, but when I print it out, it does say
$aAlayer
is a DRC layer and I don't know what went wrong. however if I use .each{|stuff| exampleLayer.insert(stuff)}
it would not complain
so, I wonder is it possible to do what I want on DRC or do I have to bring it to the python scripting in order to achieve my goal.
Thank you very much!
Andy Wang
Comments
Hi Andy,
I don't get the details, but there are a few things to say:
Matthias
Hi Matthias
Thank you very much! the dbu one would help me out a lot, also the error I got says
Arguement needs to be a DRC layer(class run time error)
That happens when I try to insert stuff into layers
thank you ver much!
Andy