/OpenJSCAD.org

2d/3d code based parametric CAD in Javascript

Primary LanguageJavaScriptOtherNOASSERTION

OpenJSCAD

OpenJsCad is a set of modular, browser and command line tools for creating parametric 2D & 3D designs with JavaScript code.

OpenJSCAD

There are many ways to use OpenJSCAD:

An online version, self hosteable web based ui, as CLI (command-line interface) for server-side computations with Node.js, as well as an experimental desktop app or individual Node.js modules!!

This repository is a monorepo (container of multiple node.js packages & tools) maintaned with Lerna

Build Status stability-stable lerna

Backers on Open Collective Sponsors on Open Collective

NOTE : as of September 1 2018, we will NOT be accepting new PRS against the V1 / master branch: we realistically are not able to keep adding new features/fixes to the 'old' version and work on the very different V2. thank you for your comprehension ! (already open PRS at that date are exempt)

Table of Contents

Usage

There are different 'flavors' of OpenJscad that you can use based on your needs

Immediate Use (no installation)

Go to OpenJSCAD.org (Tested browsers include Chrome, Firefox, Opera, Safari)

Use within a Web Site (pre built files, from github)

please see here for details

Use as Command Line Interface (CLI)

please see here for details

Use of the different modular components directly

From version 1.0.0 onwards, almost all the individual parts of this project are available directly as scoped NPM modules , and can be used independently from this repo. The full list of these is available here a here https://www.npmjs.com/org/jscad

One example of what can be achieved with this can be found here This means you can :

  • easily create your own renderer for the CSG/Cag data structures
  • create custom UIs
  • use the different parts in Node.js or the Browser
  • cherry pick what formats you want to use for input/output without needing the dependencies of all packages
  • lots more !

This will be expanded upon in the future, and is the backbone of the newer, modular Jscad

Adding new features in CSG.js or other modules:

Since OpenJSCAD is made up of multiple dependent modules (csg.js, openscad-openjscad-translator etc), the easiest method is to use npm link to have a 'live' updating development version of OpenJSCAD:

  • create a base directory
  • clone this repository git clone https://github.com/jscad/OpenJSCAD.org.git
  • go into OpenJSCAD.org folder cd OpenJSCAD.org
  • install dependencies npm install
  • if desired, make the openjscad command refer to the code in this folder: npm link
  • if desired, start dev server: npm run start-dev

Then, for example for CSG.js:

  • go back to base directory cd ..
  • clone CSG.js git clone https://github.com/jscad/csg.js.git
  • go into OpenJSCAD.org folder again cd OpenJSCAD.org
  • now type npm link ../csg.js to make @jscad/csg refer to local ../csg.js.

You can now make changes to the CSG.js code and see it impact your locally running copy of OpenJSCAD live.

Development

Please see the code and details in each package & their READMEs You can link up all the code for simple development using the following command

npm run bootstrap

This command

  • links up all the packages
  • installs all of their dependencies

we also provide a few shortcuts for some of the specific subpackage to start development

npm run web // boostrap, go to the web UI package and start the dev server
npm run cli // bootstrap, go to the cli package

Documentation

Contribute

OpenJSCAD.org is part of the JSCAD Organization, and is maintained by a group of volunteers. We welcome and encourage anyone to pitch in but please take a moment to read the following guidelines.

Thank you to all the people who have already contributed to this project:

  • If you want to submit a bug report please make sure to follow the Reporting Issues guide. Bug reports are accepted as Issues via GitHub.

  • If you want to submit a change or a patch, please see the Contributing guidelines. New contributions are accepted as Pull Requests via GithHub.

  • We only accept bug reports and pull requests on GitHub.

  • If you have a question about how to use the OpenJSCAD.org, then please start a conversation at the OpenJSCAD.org User Group. You might find the answer in the OpenJSCAD.org User Guide.

  • If you have a change or new feature in mind, please start a conversation with the Core Developers and start contributing changes.

Small Note: If editing this README, please conform to the standard-readme specification.

Community

See for more details

Acknowledgements

OpenJSCAD and its sub components are built upon great open source work, contribution & modules

  • csg.js core & improvements by Evan Wallace, Eduard Bespalov, Joost Nieuwenhuijse, Alexandre Girard

For input/output

Tooling:

and many more!

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

The MIT License (MIT) (unless specified otherwise)

Screenshots

Simple JSCAD example (logo.jscad) try it:

More sophisticated JSCAD example, with functions dedicated to object generation and with interactive parameters (gear.jscad) try it :

Import of STL models (frog-OwenCollins.stl) try it:

Drag & drop a local file:

Drag & drop multiple files (Chrome & Firefox) or a folder (Chrome):

See Also

  • OpenJsCAD, starting point of OpenJSCAD.org
  • OpenSCAD.net, another place of inspiration, where the OpenSCAD translator was adapted from
  • CoffeeSCad, JavaScript simplified (no more {}) (defunct)
  • stl2pov to convert .stl to .pov, and then render via PovRay.org
  • P3D STL/AMF/OBJ viewer

That's all for now,

Rene K. Mueller, Jeff Gay, Mark Moissette & JSCAD Organization