gfwilliams / svgtoeagle

Online SVG to Eagle CAD converter
MIT License
85 stars 26 forks source link

Add base functionality for incrementing the layer based on fill colors #25

Closed ToastyStoemp closed 1 year ago

ToastyStoemp commented 1 year ago

Hey thought it'd be useful to add a feature to change layer based on the fill color. Let me know how you want me to implement this for the Library also.

gfwilliams commented 1 year ago

This looks really neat - thanks! You mean about the export to Library? I guess it should work in basically the same way...

Perhaps it's better to have a changeLayer function that outputs the correct code for changing layer depending on if we export to a library or not? Then it can be called at the start or again when the layer changes? Might made code cleaner

ToastyStoemp commented 1 year ago

Done

ToastyStoemp commented 1 year ago

I suppose one more nice change would also be using the same grouping of colors for the preview, rather than a unique color for each polygon

gfwilliams commented 1 year ago

Yes, I suppose that could be good - maybe do it only if the LAYER_COLOR option is enabled though? But I'm more than happy to merge this one now - thanks for your help!