Just a quick question, is it possible to take the data you got from using svgLoader on an imported svg and put it back into an svg element?
I want to be able to edit the colors and size of the svg before converting it into a png. The png will be used as the texture, instead of breaking the svg down into many small meshes, which makes my app lag.
Because according to this stackoverflow post, if the svg is just a pathname of an external file, it is not able to be edited. The svgs I am using are not embedded.
THREE.SVGLoader unpacks an SVG into three.js objects compatible with THREE.Mesh and THREE.BufferGeometry. THREE.SVGRenderer draws a three.js object or scene as an SVG.
If your end goal is to edit an SVG and then convert it to a texture … then I don’t think either is the right tool for that. Edit the SVG directly or use libraries like D3.js, and then draw the SVG to canvas. Editing the SVG via a THREE.BufferGeometry object will be much harder.
Note that SVGLoader is not a full implementation of SVG and has many limitations - gradients and text to name a couple.
If you know ahead of time that all the SVG files load and render correctly that’s probably worth checking too before investing more time in SVGLoader for your needs.
They do render correctly, but just in case if a user wanted to import their own svgs into the app and their svgs had text or gradients, I would probably not use SVGLoader then.
@anidivr@donmccurdy It turns out I have no idea what I am doing in terms of actually fetching the svg and querying it and thought I could try and figure it out by myself, but I need some more help.
Good news! I’ve discovered by using Three.js’s THREE.FileLoader, I get just the html bits while not having it convert to an object consisting of all the paths. Before I have tried using fetch to get it, but it was taking too long and the symbols for the tiles were not readily available.