Node wrapper for JSC3D, a cool little (unmaintained?) 3D model renderer originally written for the browser.
Supports in-memory, software rendering of certain 3D Models with a simple interface, great for generating previews of STL or OBJ files.
Install locally with:
npm install --save jsc3d
NOTE: It (presently) relies on
node-canvas for PNG rendering and
canvas implementation. This requires Cairo and Pango to be installed on
the host system. Read more
Provides a few helper methods, notably
render, for more easily
interacting with JSC3D. See
bin/jsc3d.js for full example of using
const jsc3d = ;const canvas = jsc3d;jsc3d;
The original JSC3D API is also directly exposed.
const jsc3d = ;const canvas = jsc3d;const viewer = canvas;viewer;viewer;viewer;jsc3d;viewer;
Install globally with
npm install -g jsc3d
jsc3d examples/example.stl examples/example.png
This node wrapper exposes all arguments as CLI arguments, also.
jsc3d \--ModelColor=#00ff00 \--RenderMode=wireframe \--BackgroundColor1=#000000 \--BackgroundColor2=#000000 \examples/example.stl \examples/example_wireframe.png
To match JSC3D, this wrapper is also released under MIT License.
Background images do not load: need to mock HTML Image interface
Implement new, simpler mock canvas using Buffer to avoid Cairo dependency
Monkey patch JSC3D's BinaryStream with a faster implementation using Buffer