-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVGLoader - Incorrect/mangled path rendering #20608
Comments
Can you attach the svg file here? |
Apologies, I had left the SVG inlined in the JS fiddle. File has been attached below. |
My mistake - This doesn't appear to be caused by Paths exported from XD. I was unaware SVGO 'optimizes' paths by default which changes the delimiter inside the path. For now I can just disable path optimization in SVGO. I've attached below a zip with 2 SVG's, the clean export from XD which Three loads fine, and the mangled one. The only difference appears to be here Clean export (Loads Fine):
|
edit: it is! browsers read this just fine |
You can use https://yqnn.github.io/svg-path-editor/ to compare the d commands. |
We've hit that one too. Wondering you have any plans to visit this bug at the moment ? SVG:
|
Unfortunately, even the improved |
That would be amazing. About to start looking if we can change our SVG export scripts to get it working from there. |
Wow that was fast, thank you for fixing this one ! |
Currently going through our SVG's this is so nice / much improved thank you again. @Mugen87 Think I have another path which is not working / with the current dev version:
Found another one which is getting mangled on dev (as of today). Should be showing this: |
and these ones too:
|
Our package.json was pointing at: |
Hi. There seems to be an interesting edge case around the usage of the library, such that the SVGs above are displayed incorrectly when using the |
The idea is that you don't use |
That's great thank you. I see now that the issue was that @types don't seem to reflect the update. |
Describe the bug
Hello, it appears that with SVG's which have been exported from Adobe XD, SVGLoader fails to convert the paths reliably.
This might be the same issue as #18560
Alternatively, is there a tool/script which can convert/re-export the SVG paths into a format Three can parse?
Live example
Here is how the SVG renders as a browser element
Screenshots
Here is how the SVG appears when imported into the ThreeJS editor (https://threejs.org/editor/)
Platform:
The text was updated successfully, but these errors were encountered: