← Back to community index
# contributor·Active

Techmannih - We should use fast-xml-parser to p...

We should use fast xml parser to parse the imported SVG image so we can extract its shapes, transforms, and fill rules, convert them into paths/polygons, and then generate internal BRep pcb silkscreen graphic geometry.

Started by techmannihJun 12, 202614 messages

Discussion

Last active 29 days ago · plain text
techmannihoriginal post
We should use fast-xml-parser to parse the imported SVG image so we can extract its shapes, transforms, and fill rules, convert them into paths/polygons, and then generate internal BRep pcb_silkscreen_graphic geometry.
techmannih
does the sound right?
KEV0
I concur
Seve
I think itd be easier/more universal to use an image analysis and convert to a bitmap internally for silkscreen graphics
Seve
Unfortunately requires loading an svg to png converter- but we have one iirc <@809856037376491570>
Seve
Like tscircuit/image-utils (?)
KEV0
Does tsciruit already support bitmap by default?
Seve
We dont have any support for loading graphics afaik
Seve
Not directly in our core lib
Seve
So this is our first brush with image filters but we render svgs to pngs for lots of stuff outside the core lib
KEV0
Ah I see. I had to make a workaround for my previous PCB build. I wanted to add some icons to the board as part of the aesthetic but since there was no image support the agent tried to rebuild the SVG from scratch to fit what was possible and it did a terrible job. Until I went into Inkscape, recreated the icon as paths. It did not have any issues from there recreating it.
Seve
Yep, goal is to add image support and direct image import
Seve
Should make that wayy easier
techmannih
<@757706909351411845> <@809856037376491570> Can we directly add image import in the core repo? Something like: SVG/Image Import → internally convert to bitmap/PNG → generate silkscreen graphics

Want to add to the conversation?

Reply in Discord so your notes stay connected to the source.
Continue in Discord ↗