Around February 2019 I bootstrapped a scripted CAD environment named “ScriptCAD”, and resembles closely to OpenSCAD.org and OpenJSCAD.org (which I co-developed for a couple of years) with a new take, developed from scratch:
ScriptCAD.org: ScriptCAD Logo 2019/11
Scripting capability using JavaScript
Separate internal representation from display representation
Triangulation or Implicit representation
only triangulate at late stage at display or export
ScriptCAD.org Internal Stages
Intuitive Graphical User Interface (GUI)
Simple export various formats
Select top-level solids
Source <-> TreeView <-> 3D Model selection
Select Source <-> TreeView Item <-> 3D Model
The transparent Source vs Object Tree vs 3D Space has been in the back of my mind for a long time as I keep the connection of each stage intact and transparent.
Ease of use
hiding JS module complexity and notions
Browser use (either use built-in editor or drag-n-drop source with autoreload)
Command Line Interface (CLI) use
Screenshots & Examples
Faces
Faces + Edges
Edges
3D Text with Hershey Font
2D Examples
Parametric Designs
2D OCR A + B Font
LissaJou 1
House (Circular Squares)
House (Circular Square) Closeup
7 strips (20x150mm) testing CMY color transitions
Importing Gcode
Importing Gcode with M163/M164/M165 multi-color Gcode
Dual Color Gcode (T0/T1)
Dual Color “XYZ” Cube sliced with Slic3r PE, and applying Z transition of 3 color range
Basic Shapes
Basic Shapes in OpenSCAD
2D Examples
2D Examples: SVG in Inkscape
2D Examples in OpenSCAD
SpiritCAD.org Online as Preview
As of November 2019, ScriptCAD.org is reachable as an early preview (alpha stage), most examples work, some do not yet or display wrong output.
Note: there is only limited documentation yet (2019/11), and the API is subject of changes.
I still tune it to my use-cases and therefore API and overall design of the API might change, even drastically; once the API becomes more stable I will release the source code as well.
Some of use-cases (as seen in the gallery above):
coding low-level Gcode and use ScriptCAD to preview (render) Gcode including colors, scriptcad (CLI) outputs .gcode to actually print
testing single layer color mixed 3D Printing: forms, color mixing
ScriptCAD uses ThreeCSG/csg.js at its core to perform CSG operations, which can be very slow – hence, designing complex pieces can be slow as every change recomputes all again (I like to avoid this in future developments) yet as of 0.3.2 basic caching is implemented so only deltas are recomputed.
Back in 2003 I adapted OpenJsCad framework and extended it and documented it properly so it can be used in an easy way and then handed OpenJSCAD.org over to JS devs, who transformed it into the several NPM packages so it becomes usable for 3rd party packages easier.
I realized I wanted to have CAD with strong script capability with the focus on easy use and leave all the NPM package and JavaScript module conformity aside but refocus on easy and powerful 3D scene language, and so I started 2019/01 again, this time from scratch:
Modeling in JavaScript
Hierarchical Scene (computeScene())
Compute Form
computeSolid()
computeSolidPolygon(): creates polyhedral approximation of solids
computeSolidImplicit(): create code for implicit rendering
Rendering (renderScene())
polygon: throw triangles into WebGL space (e.g. with threejs)
implicit: render using GL shader
Export
polygonal:
Browser: .stl, .amf, .obj, .3mf, .3mj
CLI: .stl, .amf, .obj, .3mf, .3mj, .png
Goals
true scripting capability like JavaScript (OpenSCAD’s .scad is a reduced language)
keep it simple (no NPM module export or alike complexity)
CSG capability (union, intersection, difference)
name parts and enumerate parts/id
parametrical designs (expose certain variables)
extrude 2D polygons to another (not just hull)
morph from one solid to another
simple fillets and chamfers (reduce sharp edges for real world parts)
extensive and detailed documentation
100% API backward compatibility (no depreciation)
Few notes how to achieve those:
using three.js and ThreeCSG: reliable and well maintained package somewhat, ThreeCSG seems outdated/abandoned; alternatively using csg.js and/or OpenJSCAD packages as fallback, but hiding all the module handling
separate creating scene and rendering scene altogether:
polygons or rendering triangles are a stage, but not the core of the CAD, but true solids like a (perfect) sphere
use WebGL as one backend among others
use implict representations alternatives
fillets and chamfers: even those look simple, those are hard(er) to do in polygonal/triangulated stage, but simple to do with implicit representation
2019/11/25: 0.2.5: ScriptCAD.org launched as preview and a limited ScriptCAD Reference
2019/11/05: 0.2.3: various features implemented, e.g. exclusive(), 3MJ import and export support added.
2019/03/04: 0.1.5: more drawing models, selectable windows, more examples:
Brief overview of features of 0.1.5:
2019/01/18: select Source -> TreeView -> 3D Scene or any stage and respective part is highlighted
Applications
Early test with multi-color export with AMF and Slic3r
Testing exclusive() operation and 3D print result
I used ScriptCAD to generate paths with certain colors, and visualize it within ScriptCAD Web-GUI, and on the command-line the same code generated actual Gcode for one of my 3D printers, Ashtar K#2 equipped with Diamond Hotend 3-in-1 (mixing colors) – it allowed me to control every detail, something an ordinate slicer would not have provided:
LissaJou 1 visualize a path, exported as Gcode
LissaJou 1 3D printed from Gcode (without slicer)
Generating & visualize 7 strips (20x150mm) testing CMY color transitions as Gcode
7 strips (20x150mm) testing CMY color transitions
7 strips (20x150mm) testing CMY color transitions
7 strips (20x150mm) testing CMY color transitions
7 strips (20x150mm) testing CMY color transitions
House (Circular Squares)
House (Circular Square) Closeup
House (Circule Square) 3D Printing with Diamond Head 3-in-1 mixing
Overlapping ZigZag, procedural textile experiment
Overlapping ZigZag, procedural textile experiment
Overlapping ZigZag, procedural textile experiment
Overlapping ZigZag, procedural textile experiment
Playing with narrow laid extrusion close enough to over area
Playing with narrow laid extrusion close enough to over area, 3D printed
Related Projects
OpenSCAD.org: scripted CAD using dedicated language which is rather functional than procedural