OpenSCAD User Manual/The OpenSCAD User Interface

Graphic User Interface

The OpenSCAD GUI is a flexible tool for interactively editing a script with instant feedback in the rendered preview, and supporting information from the console, error log and other information panels.

Main Window with the OpenSCAD-Logo
The Windows Menu allows one to select which of the information panels to show
Windows Menu - list of information windows

By default the application window shows three panels:

  • Editing Panel
  • Console
  • Preview

Text Editor

The powerful Scintilla based editor offers all of the features that a modern programmers tool should offer:

  • multiple files open on tabs
  • search & replace
  • syntax highlighting
  • keyword and argument list completion
  • interactive value change
  • indenting
  • apply and remove comments

Interactive Modification of An Number

It is possible to change a numeric value in the source code and observe the result in real time.

Place the cursor after a numeric digit and, while holding the Alt key, use the up arrow to increment the digit and down arrow to decrements. The Preview is re-rendered after every change. Alt + Right Arrow or + Left Arrow move the cursor to the next less significant and next more significant digit respectively. In addition, when the cursor is at the least significant digit the Alt + Right Arrow will add a decimal point and the first digit of the fractional component, and more significant digits thereafter.

ON MacOS : use ⌥ Option+⇧ Shift instead of + Alt

Key Combo Description
Alt + Up Arrow Increment the numeric value to the left of the cursor.
Alt + Down Arrow Decrement the numeric value to the left of the cursor.
Alt + Left Arrow Move the cursor left to the next most significant digit.
Alt + Right Arrow Move the cursor right to the next less significant digit, and possibly a fraction.
OpenSCAD Find Dialog
OpenSCAD Replace Dialog
OpenSCAD Editor with Find / Replace functionality.

Console

Shows information from the operation of the app, normally just the results of compiling a program or the rendering results. Compilation may emit warnings, errors and assertion faults, as well as messages emitted by Echo() in the program.

During a full (F6) rendering a progress-bar is displayed in the bottom frame border of the console, with a Cancel button that can interrupt it.

A render can be cancel using the X button at the end of the progress bar.
A render can be cancel using the X button at the end of the progress bar.

Preview

The Preview rendering is updated automatically after any change to the script or the Customizer data.

There are a number of options on the View menu that enable objects in the Preview, like Show Axes to display coloured pointers for the 3 Coordinate Axes. The View menu shows the keyboard shortcuts for each option.

The viewing area is navigated primarily using the mouse:

Action Icons Description
rotating the view Dragging with the left mouse button rotates the view along the axes of the viewing area. It preserves the vertical axis' direction.

Double-click the left button to set the point of rotation.

⇧ Shift + Dragging with the left mouse button when the shift key is pressed rotates the view along the vertical axis and the axis pointing towards the user.
moving the viewing area Dragging with the right mouse button moves the viewing area.
zooming Using the scroll wheel
Dragging with the middle mouse button
⇧ Shift + Dragging with the right or middle mouse button and the shift key pressed
⇧ Shift +
+ and - The keys + and - (Ctrl+[ and Ctrl+])
show/hide rotation center Ctrl+3 Turn on or off the graphic showing the center of rotation. (It is always in the center of the viewing area).
rotation reset Ctrl+0 Rotation can be reset using the shortcut Ctrl+0.
translation reset Ctrl +
⇧ Shift+0
Translation can be reset using the shortcut Ctrl+⇧ Shift+0.

Manifold Render Mode

[Note: Requires version Dev Snapshot]

This method gives fast rendering with few, if any, rendering artifacts from convoluted geometry.

Note: must be enabled in Preferences>Advanced>Backend dropdown

Note: This rendering engine ignores the convexity parameter

OpenCSG Render Mode (F9)

[Note: Requires version pre-Snapshot versions]

This method gives fast rendering for preview, but slows significantly when working with convoluted objects.

Selecting the OpenCSG mode using F9 switches to the last generated OpenCSG view, but does not re-run the source code. If Automatic-Reload and Preview is not enabled the Design-Compile (F5) function triggers the evaluation of the source code torefresh the Preview.

CGAL Tesselate and Render

[Note: Requires version pre-Snapshot versions] This method of rendering was triggered using menu items with keybindings to F10 and F11 to tessellate and render, respectively, the model. These keybindings are removed in recent versions.

CGAL is the Computational Geometry Algorithms Library, an open source tool set that includes tessellation and rendering functions. It is used to first build a polygonal mesh from the model and then render it. Using this tool set can be slower for single images but is a significant advantage when rendering multiple images from a model, for instance when animating It also produces a more accurate rendering of the surfaces in the model than the OpenCSG version can achieve.

As with OpenCSG preview, F10 and F11 only enable the full render mode and don't run the program to update the model; for that, use the Design-Compile and Render (F6) menu item should be used.

It is possible to combine the benefits of these two display methods using the render() Operation Module. It generates the mesh that is then used as the basis for rendering, even with OpenCSG mode enabled.

View options

Show Edges (Ctrl+1)

When Show Edges is enabled, both engines render edges as well as faces. In addition the CGAL rendering includes the vertices as well.

Limitation: This option has no effect when CGAL grid mode is active

CGAL rendering shows all edges.

OpenCSG rendering does not consider edges created by boolean operations in a model, while the CGAL tessellation process does.

Show Axes (Ctrl+2)

When Show Axes is enabled an orthogonal axes indicator is displayed at the origin. Additionally, a smaller axes indicator is shown in the lower left corner of the viewing area. This three lines in this indicator are titled X, Y, and Z and are coloured red, green, blue respectively.

Show Crosshairs (Ctrl+3)

When Show Crosshairs is enabled, the center of the viewport is indicated by four lines pointing in the room diagonal directions of the global coordinate system. This is useful when aligning the viewing area to a particular point in the model to keep it centered on screen during rotation.

Animation

The menu item Window-Animate enables the processing of an animation sequence, updating the model at each step, and optionally rendering images.

An animation panel is added to the window, normally attached to the lower border in the central panel space. The panel has fields for the time value ($t), Frames Per Second (FPS) and Steps and controls for stopping and starting its operation, which starts Paused when the panel is opened.

As soon as FPS and Steps are set animation begins, which is seen by the Time increasing.

The animation period runs from zero to 1, divided into Steps moments at which the model will be evaluated and rendered. The FPS setting determines how many times per second frames should be rendered.

Reasonable starting values are FPS=10 and Steps=100.

The operation of an animation is controlled by Special Variable $t.

View alignment

The View menu items Top, Bottom, etc. align the view to look at the origin along their respective axis in the global coordinate system. The default view is Diagonal, which looks at the origin along a vector of relative angles [-45,-45,-45] in degrees.

The Center option centers the global coordinate origin in the view.

The geometry of the viewing space can be calculated in two modes, Perspective and Orthogonal, which are common to all 3D modelling applications.

Using the directional view items, Top, etc., in Orthogonal geometry mode has the effect of showing the model in the Top-Side-Front views of an engineering drawing.

Category:Book:OpenSCAD User Manual#The%20OpenSCAD%20User%20Interface%20
Category:Book:OpenSCAD User Manual