xsrf / easyeda-svg-import

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

Convert curves to line segments before importing as track #4

Closed xsrf closed 3 years ago

xsrf commented 3 years ago

Tracks (and thus board outlines) only support line segments, no curves. Converting curves to lines with a given resolution would be convenient before import. These may be useful: https://developer.mozilla.org/en-US/docs/Web/API/SVGGeometryElement/getPointAtLength https://developer.mozilla.org/en-US/docs/Web/API/SVGGeometryElement/getTotalLength

xsrf commented 3 years ago

Maybe use paperjs: http://paperjs.org/tutorials/paths/smoothing-simplifying-flattening/#flattening-paths

xsrf commented 3 years ago

Done with 0ca1fc07096bce5737e63394a15447a207c3b054