OpenSCAD - The Programmers Solid 3D CAD Modeller
Switch branches/tags
Clone or download
MichaelPFrey and kintel warn, when an assigment from the RootModule overwritten by an include (
…#2492)

* reseting assignmentWarning

* warn, when an assigment from the RootModule overwritten by an include

* uncomplete the path to make the warning more readable

* add include-overwrite test

* make the filesystem paths const
Latest commit 37a748f Sep 23, 2018
Permalink
Failed to load latest commit information.
.circleci Snap build via CircleCI. Jun 9, 2018
cgal remove empty file grid.cc (#2288) Feb 9, 2018
cmake/Modules Simple clang-tidy support Dec 31, 2017
color-schemes #1860 Updated syntax highlighting for assert (scadlexer.cpp, highligh… Oct 15, 2017
contrib Added $preview to OpenSCAD.plist (#2469) Sep 2, 2018
doc warn, when an assigment from the RootModule overwritten by an include ( Sep 22, 2018
examples slightly modify the examples to improve customizer compabitlity (#2326) Mar 1, 2018
features Fix merge issue, use correct order of libs for CGAL. Sep 5, 2018
fonts-osx Keep 05-osx-fonts.conf in fonts dir to make the fonts work in develop… Mar 3, 2015
fonts Keep 05-osx-fonts.conf in fonts dir to make the fonts work in develop… Mar 3, 2015
icons Add keywords to the desktop file Aug 11, 2015
images Qt fixes (#2366) Apr 5, 2018
libraries Updated MCAD Mar 7, 2014
locale Translation context (#2448) Sep 16, 2018
patches Fixes #1813: Pathed a bug in gettext Aug 3, 2017
releases sync with 2015.03-branch Feb 17, 2016
scripts Translation context (#2448) Sep 16, 2018
snap Add more interface plugins. Sep 16, 2018
sounds Play sound notification on render complete (#2393) May 27, 2018
src warn, when an assigment from the RootModule overwritten by an include ( Sep 22, 2018
test-code parse now always returns the module pointer to give the dependencies. Mar 1, 2017
testdata warn, when an assigment from the RootModule overwritten by an include ( Sep 22, 2018
tests warn, when an assigment from the RootModule overwritten by an include ( Sep 22, 2018
winconsole Move winconsole to separate folder. Jan 8, 2015
xcode Sync with recent filename changes Feb 1, 2017
.clang-format Minor tweaks Dec 27, 2017
.clang-tidy Simple clang-tidy support Dec 31, 2017
.gitignore Allow each to work on scalar values (fixes #1851). (#2390) Sep 16, 2018
.gitmodules add full url go .gitmodules (#2256) Jan 14, 2018
.qmake.cache Moved CONFIG features to features/*.prf, introduced defaults.pri and … Sep 4, 2018
.travis.yml Play sound notification on render complete (#2393) May 27, 2018
.uncrustify.cfg mod_add_long_namespace_closebrace_comment Dec 27, 2017
CMakeLists.txt remove empty file grid.cc (#2288) Feb 9, 2018
COPYING Fixed FSF address Oct 7, 2012
Info.plist Generate import() statement for AMF drag&drop; Tag AMF as experimental. Sep 19, 2016
Info.plist.in cmake Info.plist template Mar 24, 2017
OpenSCAD.sdef Experimental Apple Event hack; you can now do 'tell application "Open… Feb 2, 2010
README.md update links: http to https (#2428) Jul 13, 2018
RELEASE_NOTES.md rename RELEASE_NOTES to RELEASE_NOTES.md to reflect markdown content Oct 10, 2017
appcast-snapshots.xml.in Use correct links to release notes Mar 9, 2015
appcast.xml.in Release notes doesn't currently change for patch level releases Mar 14, 2015
bison.pri Used the qmake-defined OBJECTS_DIR rather than the Makefile-defined o… Feb 11, 2017
c++11.pri Mac High Sierra 10.13.2 build (#2269) Jan 23, 2018
common.pri Move pkg-config setup before inclusion of features. Sep 5, 2018
csgopnode.h #1527 Green refactoring: Renamed some classes, cleaned up some member… Dec 26, 2015
defaults.pri Enable ccache only when installed in PATH. (#2480) Sep 16, 2018
dsa_pub.pem Added support for signing binaries Feb 12, 2013
flex.pri Used the qmake-defined OBJECTS_DIR rather than the Makefile-defined o… Feb 11, 2017
mingw-cross-env.pri mingw-cross-env.pri: remove unnecessary options Aug 16, 2018
opengl.pri Qt fixes (#2366) Apr 5, 2018
openscad.appdata.xml.in appdata: add OARS 1.1 content rating Jul 30, 2018
openscad.pro Enable ccache only when installed in PATH. (#2480) Sep 16, 2018
openscad.qrc Play sound notification on render complete (#2393) May 27, 2018
openscad_win32.rc detect windows 10 w manifest. cleanup stuff related to old versions (… Oct 5, 2016
qt.pri Enable ccache only when installed in PATH. (#2480) Sep 16, 2018
setenv_mac.sh #1834 Added libzip to build script Oct 29, 2016
valgrind.supp Killed some memory leaks Nov 27, 2011
version.pri Now only uses num_add on Windows builds. May 1, 2017
win.pri In this commit i'll change just the Qt project, c and header files to… Jul 28, 2013

README.md

Travis CI Coverity Status

Visit our IRC channel

What is OpenSCAD?

Flattr this git repo

OpenSCAD is a software for creating solid 3D CAD objects. It is free software and available for Linux/UNIX, MS Windows and Mac OS X.

Unlike most free software for creating 3D models (such as the famous application Blender), OpenSCAD focuses on the CAD aspects rather than the artistic aspects of 3D modeling. Thus this might be the application you are looking for when you are planning to create 3D models of machine parts but probably not the tool for creating computer-animated movies.

OpenSCAD is not an interactive modeler. Instead it is more like a 3D-compiler that reads a script file that describes the object and renders the 3D model from this script file (see examples below). This gives you, the designer, complete control over the modeling process and enables you to easily change any step in the modeling process or make designs that are defined by configurable parameters.

OpenSCAD provides two main modeling techniques: First there is constructive solid geometry (aka CSG) and second there is extrusion of 2D outlines. As the data exchange format for these 2D outlines Autocad DXF files are used. In addition to 2D paths for extrusion it is also possible to read design parameters from DXF files. Besides DXF files OpenSCAD can read and create 3D models in the STL and OFF file formats.

Contents

Getting started

You can download the latest binaries of OpenSCAD at http://www.openscad.org/downloads.html. Install binaries as you would any other software.

When you open OpenSCAD, you'll see three frames within the window. The left frame is where you'll write code to model 3D objects. The right frame is where you'll see the 3D rendering of your model.

Let's make a tree! Type the following code into the left frame:

cylinder(h = 30, r = 8);

Then render the 3D model by hitting F5. Now you can see a cylinder for the trunk in our tree. Now let's add the bushy/leafy part of the tree represented by a sphere. To do so, we will union a cylinder and a sphere.

union() {
  cylinder(h = 30, r = 8);
  sphere(20);
}

But, it's not quite right! The bushy/leafy are around the base of the tree. We need to move the sphere up the z-axis.

union() {
  cylinder(h = 30, r = 8);
  translate([0, 0, 40]) sphere(20);
}

And that's it! You made your first 3D model! There are other primitive shapes that you can combine with other set operations (union, intersection, difference) and transformations (rotate, scale, translate) to make complex models! Check out all the other language features in the OpenSCAD Manual.

Documentation

Have a look at the OpenSCAD Homepage (http://www.openscad.org/documentation.html) for documentation.

Building OpenSCAD

To build OpenSCAD from source, follow the instructions for the platform applicable to you below.

Prerequisites

To build OpenSCAD, you need some libraries and tools. The version numbers in brackets specify the versions which have been used for development. Other versions may or may not work as well.

If you're using a newer version of Ubuntu, you can install these libraries from aptitude. If you're using Mac, or an older Linux/BSD, there are build scripts that download and compile the libraries from source. Follow the instructions for the platform you're compiling on below.

Getting the source code

Install git (https://git-scm.com/) onto your system. Then run a clone:

git clone git://github.com/openscad/openscad.git

This will download the latest sources into a directory named openscad.

To pull the MCAD library (https://github.com/openscad/MCAD), do the following:

cd openscad
git submodule update --init

Building for Mac OS X

Prerequisites:

  • Xcode
  • cmake
  • pkg-config

Install Dependencies:

After building dependencies using one of the following three options, follow the instructions in the Compilation section.

  1. From source

    Run the script that sets up the environment variables:

     source setenv_mac.sh
    

    Then run the script to compile all the dependencies:

     ./scripts/macosx-build-dependencies.sh
    
  2. Homebrew (assumes Homebrew is already installed)

     ./scripts/macosx-build-homebrew.sh
    
  3. MacPorts (assumes MacPorts is already installed)

    For the adventurous, it might be possible to build OpenSCAD using MacPorts. The main challenge is that MacPorts have partially broken libraries, but that tends to change from time to time.

    NB! MacPorts currently doesn't support Qt5 very well, so using Qt4 is the only working option at the moment. However, MacPorts' Qt4 has a broken moc command, causing OpenSCAD compilation to    break. This may be fixed in MacPorts by the time you read this.

        sudo port install opencsg qscintilla boost cgal pkgconfig eigen3 harfbuzz fontconfig

Building for Linux/BSD

First, make sure that you have git installed (often packaged as 'git-core' or 'scmgit'). Once you've cloned this git repository, download and install the dependency packages listed above using your system's package manager. A convenience script is provided that can help with this process on some systems:

sudo ./scripts/uni-get-dependencies.sh

After installing dependencies, check their versions. You can run this script to help you:

./scripts/check-dependencies.sh

Take care that you don't have old local copies anywhere (/usr/local/). If all dependencies are present and of a high enough version, skip ahead to the Compilation instructions.

Building for Linux/BSD on systems with older or missing dependencies

If some of your system dependency libraries are missing or old, then you can download and build newer versions into $HOME/openscad_deps by following this process. First, run the script that sets up the environment variables.

source ./scripts/setenv-unibuild.sh

Then run the script to compile all the prerequisite libraries above:

./scripts/uni-build-dependencies.sh

Note that huge dependencies like gcc, qt, or glib2 are not included here, only the smaller ones (boost, CGAL, opencsg, etc). After the build, again check dependencies.

./scripts/check-dependencies.sh

After that, follow the Compilation instructions below.

Building for Windows

OpenSCAD for Windows is usually cross-compiled from Linux. If you wish to attempt an MSVC build on Windows, please see this site: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows

To cross-build, first make sure that you have all necessary dependencies of the MXE project ( listed at http://mxe.cc/#requirements ). Don't install MXE itself, the scripts below will do that for you under $HOME/openscad_deps/mxe

Then get your development tools installed to get GCC. Then after you've cloned this git repository, start a new clean bash shell and run the script that sets up the environment variables.

source ./scripts/setenv-mingw-xbuild.sh 64

Then run the script to download & compile all the prerequisite libraries above:

./scripts/mingw-x-build-dependencies.sh 64

Note that this process can take several hours, and tens of gigabytes of disk space, as it uses the http://mxe.cc system to cross-build many libraries. After it is complete, build OpenSCAD and package it to an installer:

./scripts/release-common.sh mingw64

If you wish you can only build the openscad.exe binary:

cd mingw64
qmake ../openscad.pro CONFIG+=mingw-cross-env
make

For a 32-bit Windows cross-build, replace 64 with 32 in the above instructions.

Compilation

First, run qmake openscad.pro from Qt to generate a Makefile.

On some systems, depending on which version(s) of Qt you have installed, you may need to specify which version you want to use, e.g. by running qmake4, qmake-qt4, qmake -qt=qt5, or something alike.

Then run make. Finally you might run make install as root or simply copy the 'openscad' binary (OpenSCAD.app on Mac OS X) to the bin directory of your choice.

If you had problems compiling from source, raise a new issue in the issue tracker on the github page.

This site and it's subpages can also be helpful: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_OpenSCAD_from_Sources