-
-
Notifications
You must be signed in to change notification settings - Fork 126
coordinate precision #43
Comments
I used another GDS reader and can confirm that the data is stored in the integer. It seems gdspy multiplies whatever values stored in GDS file with the so called DBUperUU, which is 0.001 in my case I would like to confirm if my understand is correct or not. Thanks |
@enuinc That's correct, Gdspy presents data in user units, not the integers written in the GDSII file. If you need to change the units when you import a GDSII file (because you are using different user units in different files, for example), it's easier to use the You might also be interested in this specification. |
@heitzmann Thanks for the reply. I have two additional questions
Thanks |
Is there a specific use case you're thinking of? |
I have a code that take the GDS coordinate and convert them to physical unit when needed. it will be quite a bit work to change various places in the code to take the physical unit directly. right now, it is fine as I can just assume I always work for nm unit and make a hard-coded conversion. Thanks |
@enuinc In da2e56b, |
Hi,
I have another question about the polygon coordinate precision extracted from GDS.
I am using the following code to get all polygons from a GDS file.
import gdspy
gdsii = gdspy.GdsLibrary()
gdsii.read_gds('out-file.gds')
main_cell = gdsii.top_level()[0]
pol_dict = main_cell.get_polygons(by_spec=True)
polygons = pol_dict[(41, 0)]
When I print out the values in polygons, I saw the following
[array([[2.16, 1.82],
[2.16, 0.98],
[1.82, 0.98],
[1.82, 0.54],
[2.26, 0.54],
[2.26, 0.76],
[2.34, 0.76],
[2.34, 1.82]]),
....
It seems I have to multiply 1000 to get the integer coordinates. Is this as expected?
I don't mind to multiply 1000 but I thought all numbers in GDS file is integer
Also, if I want to draw some polygons to output them to a GDS file, should I divide my coordinates by 1000?
Thanks
enuinc
The text was updated successfully, but these errors were encountered: