JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How do I code directly in VSCode and preview the result on my web page?

    General Discussions
    5
    7
    1107
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ucimo
      ucimo last edited by

      Hello everyone!

      I'm a total CAD newbie, but as a front-end developer I'm hoping I can pick this up - hence my question!

      I'd like to use some libraries offered by JS ecosystem, so I don't think writing code in the browser itself is ideal. I'd like to use VSCode tooling, extensions, intelisense or even TypeScript while I'm designing something. How can I achieve this? Are there any tutorials I can follow?

      z3dev hrgdavor danmarshall 3 Replies Last reply Reply Quote 0
      • DavidLyon66
        DavidLyon66 @danmarshall last edited by

        @danmarshall Looks great.

        I can't get it to work.

        It just reports "Error: Cannot find module 'jscad/modelling' when I run "node jscad-now" from my home directory on linux ubuntu.

        Any ideas (yes I'm a developer but not a regular Nodejs user) ?

        1 Reply Last reply Reply Quote 0
        • ucimo
          ucimo @danmarshall last edited by

          @danmarshall I think this is exactly what I was hoping to find! I'll look into it. Thank you!

          1 Reply Last reply Reply Quote 0
          • ucimo
            ucimo @z3dev last edited by

            @z3dev thank you, nice extension

            1 Reply Last reply Reply Quote 0
            • danmarshall
              danmarshall @ucimo last edited by

              @ucimo you might want to take a look at jscad-now https://github.com/danmarshall/jscad-now

              alt text

              I'd like to upgrade this to use Vite (or another bundler) so that we can use TypeScript.

              ucimo DavidLyon66 2 Replies Last reply Reply Quote 1
              • hrgdavor
                hrgdavor @ucimo last edited by

                @ucimo there are two plugins for vscode to preview jscad designs on the market.

                Also you can edit your script in vscode and drag drop the file to https://openjscad.xyz after enabling auto-reload there. It will not work for typescript out of the box, but you can setup esbuild to bundle into js file and drag drop that file in openjscad for preview.

                There is also https://jscad.app that is not yet official, it is a protoype for new jscad preview/edit . It supports typescript (transpiles it on the fly) and has some perf improvements too. If you feel chatty you can join the jscad discord channel also.

                1 Reply Last reply Reply Quote 1
                • z3dev
                  z3dev @ucimo last edited by

                  @ucimo Welcome!

                  There are several users using JSCAD with TypeScript. Hopefully, someone will provide a few tips.

                  There's also an extension for VSCode to review designs. I haven't seen any updates but @crysislinux has been actively in this user group before.

                  ucimo 1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  Powered by NodeBB | Contributors