[SOLVED 6.4.17] API pathToPolygons returns coordinates in different formats
222 1
andreasbernhofer 3 months ago
Hey, I just found out that `pathToPolygons` is available via the API and I'd like to use it for [https://github.com/xsrf/easyeda-svg-import/issues/9](https://github.com/xsrf/easyeda-svg-import/issues/9) ``` api('editorCall', { cmd: 'pathToPolygons', args: ['M 0 0 C 1 1 2 1 3 0']}) ``` However, it returns the first and last coordinate as Array of two strings, while the rest are Objects with x/y coordinates. I came across this earlier but didn't know what caused it. Is there a reason for this? Is it a bug? It obviously works, but... I can use `pointArr.map( p => (p.x == null) ? { x: p[0] , y: p[1]} : p )` to correct it but I'd like to know why I have to do this or if I may run into issues when I correct the first coordinate to x/y... It worked for me so far. ![2021-01-08 12_18_45-EasyEDA(Standard) - A Simple and Powerful Electronic Circuit Design Tool.png](//image.easyeda.com/pullimage/09euhAMGFqmzmFmCx1b0cVdBbF9QcLTD1HSIjNYB.png) Edit: Moved Topic to "Bug reports" because I think that's not the expected behavior. Someone may still correct me ;)
Comments
eric 3 months ago
Yes, it's a bug. It will be fixed in next version.
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.