three.js: SVGLoader: Missing SVG specs break correct shape rendering.

I mean, I understand SVGLoader is work in progress, but can you really get anywhere without this? my svg looks exploded 😃

example:

<g transform="translate(226 226)">
      <polygon fill="#F4F7FF" points="...

in SVGLoader there is only this:

case 'g':
	style = parseStyle( node, style );
	break;

while funcs like parseTransformNode are clearly there already

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

I’ve got two SVGs with defs from Creative Commons and I think they are sufficient to test this. The Latex example (second file in my previous post) must have some other problems so I’ve removed it.

@makc Now this SVG is loaded right: imagen

Thank you, I will look into it.

Hi @yomboprime,

So, implementing references to nodes in defs and the view window attributtes is needed. I can do the view window part, but I will need help with the node references one.

I still don’t get in what way you want to solve this, but I might be able to help you to get the node reference.

In SVGLoader.js > parse > parseNode, you can get the reference to the node which is called from the use tag like below.

switch ( node.nodeName ) {
  case 'use':
    const usedNode = node.viewportElement.getElementById(node.href.baseVal.substring(1));

I think it is great if we can use any svg files!! I hope this helps.