rohitvarkey / ThreeJS.jl

Julia interface to WebGL using Three-js custom elements and Patchwork.jl
https://rohitvarkey.github.io/ThreeJS.jl
Other
56 stars 15 forks source link

Javascript TypeError on FireFox #13

Closed sjkelly closed 8 years ago

sjkelly commented 9 years ago

I am still getting accustom to Javascript debugging, so please excuse the sparse report. This is with the script in #12. I see the following error:

TypeError: Polymer.dom(...).parentNode.addVertex is not a function

From what I can tell this is since it is being called to THREE.Color. I also notice a few more, which from what I can tell might be caused by the DOM object being sorted.

screenshot from 2015-10-06 20 53 18

I believe this is why rendering a mesh is a hit-or-miss. Into the Escher/Patchwork/ThreeJS rabbit hole :).

rohitvarkey commented 9 years ago

Hmm. I kept getting the same in IJulia too. I use Chrome mostly and didn't test this in Firefox!

The reason is that Polymer doesn't do its job really well here. This occurs because the parent element (three-js-geometry) isn't totally ready when I try to add the vertices and the faces to it. Adding a delay to the async operation did fix it for me.

Can you try and see if https://github.com/rohitvarkey/ThreeJS.jl/commit/b327a0e6ef3d0b9267af9da9fbc746c67d710298 fixes it for you?

sjkelly commented 9 years ago

b327a0e doesn't fix on Firefox unfortunately, but Chromium works fine. Your diagnosis is very helpful, I will keep looking into it.

rohitvarkey commented 8 years ago

@sjkelly Can you check this on the current master? I've changed the internals so hopefully this doesn't happen anymore.

sjkelly commented 8 years ago

Great! This is no longer an issue on Firefox or Chromium.