Giter VIP home page Giter VIP logo

gds_viewer's People

Contributors

michaelcache avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

gds_viewer's Issues

Draw Question

Hello dear author, I encountered an issue while opening the GDS file. It seems that the coordinates of the module definition were also drawn in. I would like to know where the code for this part is located and would like to make further modifications.
gds_viewer

gds展示错误的问题,会把没有计算偏移量的模块也多画出来

(1)我打开了一个1.gds文件,下图是用Klayou打开时正确的样式:
image

(2)我用 gds_viewer打开该1.gds文件,效果如下:会把没有计算偏移量的模块也多画出来
image

(3)我模仿您的 gds_viewer 自己创立了一个新的qt工程项目,按您的方法展示时是同样结果,不知道怎么解决。我展示的代码逻辑与您一样。但我研究了一段时间没能解决这个问题,所以请教您看能不能帮忙解决。十分感谢!(附件是我的1.gds文件)
1.gds.zip

image

我的展示代码如下:
` // 读取GDS文件
Library lib = gdstk::read_gds(filePath.toLocal8Bit().data(), 0, 1e-2, NULL, &error_code);

for (size_t i = 0; i < lib.cell_array.count; i++) {

    Cell* cell = lib.cell_array[i];

    gdstk::Array<gdstk::Polygon*> polygons = {0};

    // 获取所有的多边形
    cell->get_polygons(true, true, -1, false, 0, polygons);

    for (size_t j = 0; j < polygons.count ; j++)
    {
        gdstk::Polygon* currentPolygon = polygons[j];

        // get layer
        uint32_t layer = gdstk::get_layer(currentPolygon->tag);

        Vector2dVector p;
        for (size_t i = 0; i < currentPolygon->point_array.count; i++)
        {
            p.push_back(
                 (Vector2d(currentPolygon->point_array[i].x, currentPolygon->point_array[i].y)));
        }

        // instance EDAGraphicsPologyItem
        EDAGraphicsPolygonItem *polygonItem  = new EDAGraphicsPolygonItem(layer);
        polygonItem->setZValue(layer);
        // 将图形项polygonItem的数据关联到GDS_LAYER_TAG键上,键值为layer。这样可以在需要的时候通过GDS_LAYER_TAG键来获取或修改该图形项的数据
        polygonItem->setData(GDS_LAYER_TAG, layer);

        // 层列表添加数据
        layerData.insert(layer);

        QPolygonF polygon;

        // 输入点坐标遍历
        for (size_t i = 0; i < p.size(); i++)
        {
            polygon << QPointF(p[i].GetX() * 100, p[i].GetY() * 100);
        }

        polygonItem->setPolygon(polygon);

        // 多边形列表添加图元
        polygonItemList.append(polygonItem);
    }

    polygons.clear();
}`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.