jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.63k stars 512 forks source link

VSCode integration #809

Open HKalbasi opened 3 years ago

HKalbasi commented 3 years ago

OpenSCAD has an extension for vscode which it's main function is adding two buttons, one for export to stl and one to preview the file. Is there something similar for JSCAD?

z3dev commented 3 years ago

OpenSCAD has an extension for vscode which it's main function is adding two buttons, one for export to stl and one to preview the file. Is there something similar for JSCAD?

JSCAD doesn’t have a preview function. Just drag and drop any design to the website, which compiles the design and renders the results. And of course, the same results can be exported as STL, DXF, etc.

danmarshall commented 3 years ago

Also, check out jscad-now, I use it with VSCode and I like the browser's debugger better than if it were in a VSCode extension window. https://github.com/danmarshall/jscad-now

z3dev commented 2 years ago

This would be a very nice feature to have as part of JSCAD (or community). If anyone has some skill at writing VSCODE extensions then this could be very easy to get started.

See the following for inspiration.

V1

https://github.com/ayan4m1/vscode-scad

https://github.com/ryx/vscode-jscad

V2

https://github.com/crysislinux/vscode-openjscad

z3dev commented 2 years ago

@crysislinux would you be interested in taking this on?

crysislinux commented 2 years ago

@z3dev I haven't touched 3d modeling for some time. I guess I am not able to maintain https://github.com/crysislinux/vscode-openjscad for a long time, I can transfer the project if someone is interested. the code may be a bit hard to understand. Here I will describe the core ideas of the project:

  1. I learned the code of the v2 website, and created two js classes to simplify the job. OpenJscadBuilder to build the data structure and OpenJscadViewer to render the data structure. They were built into a single js file called openjscad-web-sdk.js, the source is not on Github (not because I don't want to open source it), I can provide the source.
  2. then everything else is vscode related, watch files -> rebuild data -> render data.