Skip to content

ad-si/NodeSCAD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeSCAD

Node.js wrapper for OpenSCAD. Modern TypeScript, ESM-only, Promise-based.

Installation

npm install nodescad

Requires Node.js 18+ and an installed OpenSCAD binary.

Usage

import { render, renderFile } from "nodescad"

// Render from a file
const result = await renderFile("path/to/file.scad", {
  binaryPath: "/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD",
})
console.log(result.buffer?.length)

// Render from an inline string
const inline = await render({
  input: "cube([2,3,4]);",
  binaryPath: "openscad",
})

// Write straight to disk (no buffer returned in result)
await render({
  inputFile: "model.scad",
  outputFile: "model.stl",
})

The full set of options is documented by the RenderOptions type in src/types.ts.

Development

npm install
npm run typecheck   # strict TS checks across src + tests
npm run build       # emit dist/
npm test            # node:test runner via tsx (needs OpenSCAD installed)

About

Node.js wrapper for OpenSCAD

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors