Closed dan-fritchman closed 2 years ago
Glad you're enjoying the library! Unfortunately, until this issue is resolved, there's not a super elegant way. Though as a workaround for the moment, you can use the two.load
method which will stuff your SVG String into an offscreen div. Use it like so:
const group = two.load(svgString);
// It doesn't automatically add your group to the scene, so don't forget to do that!
two.add(group);
Outstanding, thanks very much!
Great project, thanks much for your work on it.
And extra thanks for the support I've seen you provide on other issues and forums.
My question:
I have a string with SVG content.
What would I need to do with it, to make a valid argument to
two.interpret
?https://codepen.io/dan-fritchman/pen/RwMzbgL
In the CodePen that produces nothing; in my larger application it generates:
That CodePen, and my application's usage, both started from the "Interpret SVGs" example:
https://codepen.io/jonobr1/pen/KKvYXzp
Which stores the content in HTML, and loads it via
document.querySelectorAll
.Thanks again!