It looks like you're new here. If you want to get involved, click one of these buttons!
Very new to Klayout scripting. I have a question about defining the units.
For example, I would like to draw a box with a length of 100um and a width of 100um. I came across a python example for a different shape where the code is :
l_1x1_outline = layout.layer(1, 0) # 1x1 Outline
l_metal = layout.layer(11, 0) # Metal
line_width = 5 * 1000 # 5 um
pitch = 100 * 1000 # 100 um ----->this is the box I am trying to make
outline = UNIT.shapes(l_1x1_outline).insert( pya.Box(0, 0, pitch, pitch) )
leg1 = UNIT.shapes(l_metal).insert( pya.Box(0, 0, line_width, pitch) )
leg2 = UNIT.shapes(l_metal).insert( pya.Box(0, pitch-line_width, pitch, pitch) )
When comparing with Klayout GUI with database units as 0.001um (1nm) - I input 100 by 100 manually (without multiplying by 1000), the resulting box's dimension is the same as given in the script "pitch = 100*1000 # 100 um".
Does the GUI automatically take 1000 into account? Just want to make sure that I am inputting the right values in um units.
When I run the above script by changing "pitch = 100 # 100 um", my box in the layout is 0.1 in size (much smaller than what I want).