OpenJSCAD Quick Reference

This is a V1 outdated documentation and deprecated see https://github.com/jscad/OpenJSCAD.org/issues/783.

The page provides a quick reference to OpenJSCAD and CSG library functions.

OpenJSCAD User Guide

CSG and CAG User Guide

Note: Default values and notes are highlighted in bold fonts.

General Usage
Note: Messages are displayed in the Javascript console in browsers.

Note: If not provided, the default resolution is used when creating rounded shapes. * CSG.defaultResolution2D: 32 * CSG.defaultResolution3D: 12

Shape Transformations
Shape transformations always return a new shape, leaving the original shape unchanged. The original shape can be changed by reassigning the original, like this.

Shape transformations can be chained together. For example:''

Shape Operations
Shape operations always return a new shape, leaving the original shape unchanged. The original shape can be changed by reassigning the original, like this.

OpenSCAD-like Functions
These functions ease the transition of designs from OpenSCAD (Lisp-like) to OpenJSCAD (JavaScript and objects).

Text
Note: The text function as known in OpenSCAD is not supported.

Interactive Parameters
A design can have interactive parameters by declaring a special function; getParameterDefinitions.

Usage
This function must return an array of parameter definitions, as show below.

The parameters are evaluated and values are passed into the main function. Be sure to declare the main function properly.

Parameter Types
The parameters are defined as input fields on a single HTML5 form, i.e. the list of parameters. For more information on HTML5 input fields, see some examples at W3 Schools.

Note: Browsers are NOT the same and will treat unsupported parameter types as TEXT.

''Note: The parameters accept additional restrictions and assistance. These include 'initial', 'max', 'maxLength', 'min', 'pattern', 'placeholder', 'size', and 'step'.''