Closed davidwebca closed 3 years ago
Hmmm, just loading that SVG code you shared above into Chrome renders this:
Are you sure that's the right code to test against?
Yeah sorry! I didn't include the parent group that has fill="none"
in this piece of code. But here's more clarity: a full codepen with the examples. First illustration is raw dom, second is Two.load and third is Two.interpret from the raw dom.
https://codepen.io/davidwebca/pen/poNvdZQ
Edit: the scientific notation extrapolation is visible in its difference with the first element which is raw dom v.s. the two that are loaded through two.js, but this is also about #504 which shows that fill="none"
is not cascading down into sub-groups when loaded externally (assuming fill colours on sub elements when there's actually a parent group with fill="none"
at the top of the tree)
Thanks for adding this. I was just able to reconstruct this locally. Hoping to have more answers for you soon.
This commit fixes Two.load
and Two.interpret
not applying the same styles. Keep you posted on the scientific notation issues.
Amazing, thank you!
This commit solves it and now loads and interprets your SVG provided correctly: https://github.com/jonobr1/two.js/commit/57d412f5c9270b536fa0fc805f53b4bd66d487ee
Alright, here it goes! I just added some new SVG elements to my scene while I was working right now and I got the scientific extrapolation problem + the cascading styles problem I mentioned on #504 (fill="none" is applied on the parent group of this group).
The scientific extrapolation problem might be only due to being a negative decimal number?
Once you cleanup the black fill mess, you can see that some portions of the knife, the fork and the rebate label are off and/or not even visible because some points aren't converted correctly. When I go and apply their full decimal value, it gets back into place correctly.
Ex.: the first path of the fork contains "-4.26325641e-14" and if I expand it to "-0.0000000000000426325641" it all works (using my converter here https://codepen.io/davidwebca/pen/YzpPPeL)
Here's what it should look like.
Here's what I get (sorry for the bad framing, but you get the gist).
Here's the SVG code of that "plate" portion.