Closed nicholasnobile closed 2 years ago
The following code seemed to solve my issue. But this needs to be reimplemented into the master and a new revision released.
b.write((np.round((np.array((ref['spacing'][0] * ref['columns'], 0)) + np.array(ref['origin'])) * grid_steps_per_unit)).astype( '>i4').tobytes()) # XY INTEGER_8 edge_x b.write((np.round((np.array((0, ref['spacing'][1] * ref['rows'])) + np.array(ref['origin'])) * grid_steps_per_unit)).astype( '>i4').tobytes()) # XY INTEGER_8 edge_y
Thanks! I've added the change to the master branch :)
And a new version containing the fix is on pypi :)
Thank you so much!
https://github.com/HelgeGehring/gdshelpers/blob/96cfe541c18360dc8a8902fa723b7b5edfabbe72/gdshelpers/export/gdsii_export.py#L82-L84
So I am trying to implement 2 cells within a cell as an array. I am using the standard micron as the unit, but I am trying to have increased precision to 0.1nm [10000 grid steps per micron]. When I make the spacing equal micron steps apart, it works. When they are not, there is a spacing issue. I am pretty sure the problem is here in the code referenced above as internally the spacing kept in the gdspy_cell->references->spacing is correct. The code shown seems to round before the points are scaled by the grid_steps_per_unit rather than after, which I think is causing my problem.