JSCAD User Group
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

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

    Scheduled Pinned Locked Moved General Discussions
    7 Posts 5 Posters 2.8k Views 2 Watching
    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.
    • ucimoU Offline
      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?

      z3devZ hrgdavorH danmarshallD 3 Replies Last reply Reply Quote 0
      • z3devZ Offline
        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.

        ucimoU 1 Reply Last reply Reply Quote 1
        • hrgdavorH Offline
          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
          • danmarshallD Offline
            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.

            ucimoU DavidLyon66D 2 Replies Last reply Reply Quote 1
            • ucimoU Offline
              ucimo @z3dev
              last edited by

              @z3dev thank you, nice extension

              1 Reply Last reply Reply Quote 0
              • ucimoU Offline
                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
                • DavidLyon66D Offline
                  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

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • First post
                    Last post
                  Powered by NodeBB | Contributors