-
Notifications
You must be signed in to change notification settings - Fork 230
Closed
Description
Hi Matthias,
I found while doing DCplxTrans
to ICplxTrans
conversion the disp
loose alot of accuracy, basically the value kind of being rounded to integer first before being convert to dbu unit.
Unlike DTrans to Trans, disp
was first divided by dbu then being convert to int, we only loose the accuracy due to the grid size, after DCplxTrans --> ICplxTrans conversion 12.34567 um becomes 12.00 um
Currently I always extract the disp
part and convert the value separately to a new ICplxTrans
, I was wondering whether there's a suggested way to make this type of conversion?
import pya
dbu = 0.001
t1 = pya.DCplxTrans(1.0, 45.0, False , 12.345678, 20.000000)
t2 = pya.DTrans(12.345678, 20.000000)
print (f"T1 to dbu type: {dcplxtrans.to_itrans(dbu)}")
print (f"T2 to dbu type: {dtrans.to_itype(dbu)}")
>>> T1 to dbu type: r45 *1 12000,20000
>>> T2 to dbu type: r0 12346,20000