SVG triangulation.
-
SVG triangulation.
Dear Lazyweb,
I need this SVG as a DXF, DWG or SKP with all of the polylines converted to triangular meshes. Can someone show me how, or just do it for me?
The conversion must preserve group names so that I can tell which ones are which.
Bonus level: can you find a similar source map that *also* has US states? Must be equirectangular.
https://jwz.org/b/yk25 -
SVG triangulation.
Dear Lazyweb,
I need this SVG as a DXF, DWG or SKP with all of the polylines converted to triangular meshes. Can someone show me how, or just do it for me?
The conversion must preserve group names so that I can tell which ones are which.
Bonus level: can you find a similar source map that *also* has US states? Must be equirectangular.
https://jwz.org/b/yk25Not even 30 minutes and I already had to block some "ChatGPT says" dipshit.
-
Not even 30 minutes and I already had to block some "ChatGPT says" dipshit.
@jwz Someone saw "Lazyweb" and came up with the laziest possible way of "helping".
-
SVG triangulation.
Dear Lazyweb,
I need this SVG as a DXF, DWG or SKP with all of the polylines converted to triangular meshes. Can someone show me how, or just do it for me?
The conversion must preserve group names so that I can tell which ones are which.
Bonus level: can you find a similar source map that *also* has US states? Must be equirectangular.
https://jwz.org/b/yk25@jwz *rubbing eyes* what you are wanting is something many game engines, including at least two I have written over the years, simply include as a matter of course. however, that would be most likely to be inextricably bound with the game engine's loader code, not a standalone tool which would output (literally anything) afterward.
The last time I did this, I took these two libraries, by the same person, and chained them end to end.
https://github.com/memononen/nanosvg
https://github.com/memononen/libtess2.git -
Not even 30 minutes and I already had to block some "ChatGPT says" dipshit.
@jwz In an argument the other day, someone pulled out, "Well Grok says..." and if I wanted to know what a CSAM generator said... yeah, I can't even think of a joke answer for that.
Wait, shouldn't everyone making and using the CSAM generator just be in jail, and the CSAM generator shut down, and I never have to hear about the damn thing ever again?
-
@jwz *rubbing eyes* what you are wanting is something many game engines, including at least two I have written over the years, simply include as a matter of course. however, that would be most likely to be inextricably bound with the game engine's loader code, not a standalone tool which would output (literally anything) afterward.
The last time I did this, I took these two libraries, by the same person, and chained them end to end.
https://github.com/memononen/nanosvg
https://github.com/memononen/libtess2.git@jwz The code in which I did this is not open source, however, I would be happy to splat a sample function that does the "feed A into B" with these two libs into a gist somewhere (though I might not be able to do this until tomorrow). Given your level of proficiency with C code, I believe you could slap together a single-use C program that feeds A into B and then spits out as [whatever] faster than you could find a tool capable of doing this very specific thing.
-
@jwz The code in which I did this is not open source, however, I would be happy to splat a sample function that does the "feed A into B" with these two libs into a gist somewhere (though I might not be able to do this until tomorrow). Given your level of proficiency with C code, I believe you could slap together a single-use C program that feeds A into B and then spits out as [whatever] faster than you could find a tool capable of doing this very specific thing.
@jwz Would it be helpful for me to do that?
Notes:
- Additionally, memononen may have put sample code somewhere, but I don't know/remember where.
- I don't remember if nanosvg preserves the group names, but it's a simple library so adding that feature would be not much harder than just using nanosvg.
- In general, the thing about SVG is it's just XML, it's so easy to parse, all that makes it hard is (like HTML and GLTF) individual files using "surprising" features your parser doesn't support
-
@jwz Would it be helpful for me to do that?
Notes:
- Additionally, memononen may have put sample code somewhere, but I don't know/remember where.
- I don't remember if nanosvg preserves the group names, but it's a simple library so adding that feature would be not much harder than just using nanosvg.
- In general, the thing about SVG is it's just XML, it's so easy to parse, all that makes it hard is (like HTML and GLTF) individual files using "surprising" features your parser doesn't support
@mcc Thanks, these libs look promising, if I don't find something easier.
Parsing SVG isn't that big a deal but I really wasn't looking forward to writing a triangulator.
-
@mcc Thanks, these libs look promising, if I don't find something easier.
Parsing SVG isn't that big a deal but I really wasn't looking forward to writing a triangulator.
@jwz Do you remember GLU? It had a perfectly good tesselator, and it turns out to be easy enough to separate from the open source GLU code into being standalone. I've done it once, and the libtess2 above is that too but cleaner than my old attempt. In general it's surprising how much good primitive game/graphics tech you can get by raiding either GLU or the old CPU renderers in Mesa.
Oh, btw, I guess the nanosvg I was using was this minor fork for better units support:
-
undefined oblomov@sociale.network shared this topic