Ml5 and ShapeDiver javascript libraries in conflict

https://romysayah.github.io/sdt2/

Hello!
I need help with this file, I would like to screenshot the ShapeDiver model to then translate it through my machine learning model (ml5) - the problem is, everytime I include the script of ml5, the ShapeDiver window and sliders stop working, it says that it can’t recognize the ParametricViewer (and probably all other ShapeDiver libraries). Are these 2 libraries in conflict, and what I can I do to solve this?
Thanks,
Romy

Before getting to the problem, I see a couple of issues to fix:

  1. You are including the viewer version 2.1.0. Please switch to the latest version (2.20.2).
  2. You are including the reflector script, which is only used with iframes. You can remove it from your code.

Now to the main problem: it seems that when you include the ml5 library, some errors prevent the loading of the page to complete. Since you include the ShapeDiver viewer with the defer keyword, the viewer is only loaded at the end, which seems to never happen in your case.
Below, I have included a version of the html page with the latest viewer, no defer keyword and including the ml5 library. On the ShapeDiver side, everything seems to work. But you might have other issues to look at regarding the ml5 libary.

romysayah.html (2.1 KB)