openscad
Render 3D models from OpenSCAD code
TLDR
Open a file
Convert a file to STL
Render a file to PNG in a specific colorscheme
SYNOPSIS
openscad [OPTIONS] [FILE]
openscad --help
openscad --version
FILE typically refers to an .scad script to be processed.
PARAMETERS
-o <file>, --output=<file>
Specifies the output file path. The format is determined by the file extension or the --export-format option.
-D <var>=<val>, --define=<var>=<val>
Defines or overrides a variable in the .scad script. Multiple -D options can be used.
-p <file>, --parameter-file=<file>
Loads parameters from a JSON file. Useful for managing complex sets of parameters.
-P <name>, --parameter-set=<name>
Selects a specific parameter set from the JSON file specified by --parameter-file.
--export-format=<format>
Explicitly sets the output format (e.g., stl, amf, 3mf, dxf, svg). Overrides format derived from filename.
--imgsize=<width>,<height>
Sets the dimensions for image output (e.g., PNG).
--autocenter
Centers the model in the view before rendering or exporting.
--viewall
Adjusts the camera to view the entire model before rendering or exporting.
--render
Forces a complete render of the model before exporting, even if not strictly necessary.
--hardcopy
Generates output suitable for 2D plotters or laser cutters, typically for SVG projections.
--check-parameters
Performs type checking on parameters loaded from files or defined on the command line, reporting errors for mismatches.
-q, --quiet
Suppresses most informational messages and warnings during execution.
-v, --version
Prints the OpenSCAD version information and exits.
-h, --help
Prints a summary of command-line options and exits.
DESCRIPTION
OpenSCAD is a free software application for creating solid 3D CAD objects. Unlike interactive 3D modelers, it focuses on a programmatic approach, using a textual description language (the OpenSCAD language) to define objects. This allows designers to create highly parametric models by utilizing programming constructs such as variables, loops, and conditional statements. Models are typically defined in .scad files.
The command-line interface of OpenSCAD provides powerful capabilities for batch processing, automated rendering, and exporting models without the need for the graphical user interface. This makes it ideal for integrating into build systems, generating multiple variations of a design, or rendering complex models on remote servers. It supports exporting to common 3D formats like STL, AMF, 3MF, and DXF, making it a popular choice for 3D printing and precision engineering.
CAVEATS
Rendering complex or large models can be computationally intensive, requiring significant CPU time and memory resources, especially for high-resolution exports. The programmatic nature of OpenSCAD means that debugging design logic relies on understanding the OpenSCAD language and its execution flow, rather than direct visual manipulation. The command-line interface requires explicit specification of view and output settings, which are handled automatically by the GUI.
USAGE EXAMPLES
1. Render a SCAD file to STL:
openscad -o output.stl input.scad
2. Export a 2D projection to SVG for a laser cutter:
openscad -o cutting_board.svg --hardcopy input.scad
3. Render with specific parameters:
openscad -D 'length=100' -D 'width=50' -o box.stl box_design.scad
4. Render an animation frame:
openscad -o frame_001.png --imgsize=800,600 --animate=1 --animation-step=0 input.scad
5. Use a parameter file:
openscad -p config.json -P 'large_version' -o large_model.stl design.scad
HISTORY
OpenSCAD was initially created by Marius Kintel, with its first public releases appearing around 2009. The project emerged from a need for a non-interactive, script-based CAD tool focused on constructive solid geometry (CSG) and extrusion. It quickly gained traction within the emerging 3D printing community due to its ability to generate precise, parametric models that are easily reproducible and modifiable through code. Its development has been driven by a strong open-source community, consistently adding features and improving performance, solidifying its role as a unique and powerful tool for algorithmic design.
SEE ALSO
make(1): Often used to automate the process of rendering and exporting OpenSCAD designs, especially in projects with multiple configurations or dependencies., blender(1): While different in approach (GUI-based polygon modeler), it's another powerful tool for 3D modeling and rendering., freecad(1): A general-purpose parametric 3D CAD modeler, offering both GUI and scripting capabilities, often used for engineering design.