how to run demo in V2/web?

  • I raise an issue #462 about creating multiple instances of JSCAD per page and be informed that V2 has the ability to do it. So I clone the V2 repository, start a server on ./web and open the demo.html, but I find no viewers or designs on it(maybe already work?) or what it should look like if it is working properly.


    I also find that the demo.js creates two instances of JSCAD using makeJscad(), which is exactly what I want. But I insert some lines of demo.js into demo.html, there are also no viewers or designs. Are there any docs about how to use makeJscad() properly?

  • @tektio V2 JSCAD is very different then V1 JSCAD.

    The old examples are no longer usable with V2 JSCAD.

    Probably the best way to enabled two viewers would be through the use of the VUE components, but you'll have to write some HTML / JavaScript.

  • Hello!
    I am trying to achieve the same - create multiple instances of jscad.
    The commented lines in demo.js seem to work at first, but if you interact only the first instance gets effected. So something ist not properly decoupled.
    Is there any quick advice to get on track?

  • Hi @LinGuanfu !
    Visually that seeems correct: if you click on help/question mark do you have a menu with a list of examples ?
    also looking at the console output it seems the two instances are created correctly.
    Please try opening a design in both panels (or drag & droping a jscad file/folder).
    The css is not finished and could use some tweaking (or might not be a perfect fit for all use cases, but should be easy to change 🙂

Log in to reply