xsrf / easyeda-svg-import

Simple SVG Importer for EasyEDA PCB that doesn't convert everything to Comic Sans 😄
85 stars 8 forks source link

Use 'createShape' API instead of editing project source #8

Closed xsrf closed 3 years ago

xsrf commented 3 years ago

Maybe use createShape API instead of editing project source?

api('createShape',{
    shapeType:'TRACK',
    "jsonCache": {
        gId: "gge"+Math.floor(Math.random() * 9e6),
        layerid: "10",
        pointArr: points
    }
});

jsonCache format is not documented either but should be the same as in the json source...

xsrf commented 3 years ago

Done in v1.4, see https://github.com/xsrf/easyeda-svg-import/commit/12da9fb948ef8d045e93e765e051c157b7deb57c and https://easyeda.com/forum/topic/API-createShape-is-missing-shapeType-SVGNODE-54c16d1cf68f47fb95a8f353b954b733