s-holst / GDS2WebGL

Translates GDSII into HTML/JS that can be viewed in WebGL-capable web browsers.
MIT License
46 stars 7 forks source link

gds can not parse to Webgl succeessfully #5

Open eeeeeeeason opened 2 years ago

eeeeeeeason commented 2 years ago

thanks alot!!! i follow the docs and run command as follow, the gds is built by GDSPY https://github.com/heitzmann/gdspy

python .\gds2webgl.py -i .\spinQ_2qubit_initial_version.gds -o file.html
python .\gds2webgl.py -i .\spinQ_2qubit_initial_version.gds -o data.js  

but gds parse a cell into html, which cell 's points_str is 'AQ==' and triangles_str is 'AA=='
saddly ,nothing is in canvas.

it is different from the demo , i guess something lost after parsing

How can I make it work? Please help me, or please give my some advise.

MYSOURCE: link: https://static-cdn.spinq.cn/static/spinQ_2qubit_initial_version.gds

file.html and data.js https://static-cdn.spinq.cn/parsedhtml/data.js https://static-cdn.spinq.cn/parsedhtml/file.html

GDSPY OUTPUT JPG image

HTML OUTPUT FROM GDS2WEBGL image

eeeeeeeason commented 2 years ago

after changging the layer index i find it can draw something . but still imprecise need your help! thanks alot! image

s-holst commented 2 years ago

Hi! that looks indeed very interesting. The reason it breaks is probably that the pre-processing is optimized for rectilinear polygons. I did not anticipate more complex structures like these. It would be interesting to have support for more GDS primitives. However, I'm busy the next weeks. I may be able to look into this next month.

eeeeeeeason commented 2 years ago

hi, could you give me some suggestion to implement this function? or i think this problem is kind of triangle error, image mistake every time i draw some angle . could you explain how to understand this,so that i can do something. pentagon in gds viewer image pentagon in gds2webgl image

code could not understand image image