Skip to content
This repository

OpenSCAD - The Programmers Solid 3D CAD Modeller

Merge pull request #712 from openscad/number-fix

Catch exceptions caused by parsing invalid double values (fixes #706).
latest commit fcf7b27257
Torsten Paul t-paul authored
Octocat-spinner-32 contrib add children primitive, and refactor control.cc a little October 07, 2013
Octocat-spinner-32 doc release notes update March 09, 2014
Octocat-spinner-32 examples #504 Updated example: child() -> children() February 10, 2014
Octocat-spinner-32 icons Make the desktop file valid March 10, 2014
Octocat-spinner-32 libraries Updated MCAD March 07, 2014
Octocat-spinner-32 patches #559 Fix Qt font rendering on OS X 10.9 December 08, 2013
Octocat-spinner-32 qxs Merge branch 'qcodeedit' of http://www.gilesbathgate.com/openscad int… April 12, 2010
Octocat-spinner-32 releases Release preparations March 06, 2014
Octocat-spinner-32 scripts do not build gettext or glib2 by default. fix glib2.pri to find syste… March 14, 2014
Octocat-spinner-32 src Catch exceptions caused by parsing invalid double values (fixes #706). March 22, 2014
Octocat-spinner-32 test-code Removed old code made redundant by tests October 31, 2010
Octocat-spinner-32 testdata typo March 09, 2014
Octocat-spinner-32 tests Only upload failed tests March 05, 2014
Octocat-spinner-32 .gitignore Update .gitignore. January 03, 2014
Octocat-spinner-32 .gitmodules Make MCAD submodule relative to openscad toplevel. February 18, 2012
Octocat-spinner-32 .travis.yml Reenable master branch for travis March 05, 2014
Octocat-spinner-32 COPYING Fixed FSF address October 07, 2012
Octocat-spinner-32 Info.plist New feature: Drag and drop stl, off or dxf files will create an impor… May 08, 2013
Octocat-spinner-32 OpenSCAD.sdef Experimental Apple Event hack; you can now do 'tell application "Open… February 02, 2010
Octocat-spinner-32 README.md do not suggest the 'time saver' of only opencsg or cgal build, too co… March 14, 2014
Octocat-spinner-32 RELEASE_NOTES Release preparations March 06, 2014
Octocat-spinner-32 appcast-snapshots.xml.in Fixed download URL October 26, 2013
Octocat-spinner-32 appcast.xml.in Move files to files.openscad.org October 22, 2013
Octocat-spinner-32 bison.pri Put back some stuff necessary for building on non-MSVC platforms for now August 19, 2013
Octocat-spinner-32 boost.pri Fix issue with boost and Apple namespace pollution February 04, 2014
Octocat-spinner-32 cgal.pri In this commit i'll change just the Qt project, c and header files to… July 28, 2013
Octocat-spinner-32 common.pri Clipper is bundled January 09, 2014
Octocat-spinner-32 dsa_pub.pem Added support for signing binaries February 11, 2013
Octocat-spinner-32 eigen.pri fix eigen bugs mingw32/64 May 18, 2013
Octocat-spinner-32 flex.pri Modified parse to allow overloading of variables in local blocks. Als… April 26, 2013
Octocat-spinner-32 glew.pri detect netbsd / freebsd after linux not before, for bison/flex. December 23, 2012
Octocat-spinner-32 glib-2.0.pri fix glib2 build for mingw. update mxe target to '.static' March 21, 2014
Octocat-spinner-32 mingw-cross-env.pri fix mingw cross build December 30, 2013
Octocat-spinner-32 mjau.gdb First version of automatic updates for Mac February 05, 2013
Octocat-spinner-32 opencsg.pri Some more build system cleaning December 15, 2011
Octocat-spinner-32 openscad.appdata.xml AppData: Do not have 2 default screenshots December 24, 2013
Octocat-spinner-32 openscad.pro Moved MACOSX_DEPLOYMENT_TARGET to the deploy script to allow building… March 03, 2014
Octocat-spinner-32 openscad.pro.user Replaced static paths with $$PWD and $QTDIR February 15, 2012
Octocat-spinner-32 openscad.qrc Add GUI Settings page to enable/disable features. January 02, 2014
Octocat-spinner-32 openscad_win32.rc Copyright updates January 21, 2011
Octocat-spinner-32 setenv_mac-clang.sh gcc and clang profiles June 20, 2013
Octocat-spinner-32 setenv_mac-gcc.sh gcc and clang profiles June 20, 2013
Octocat-spinner-32 setenv_mac-homebrew.sh Experimental homebrew dependency build January 04, 2014
Octocat-spinner-32 setenv_mac-qt5.sh Fix issue with boost and Apple namespace pollution February 04, 2014
Octocat-spinner-32 sparkle.pri Mac fixes: Moved sparkle config to sparkle.pri. Link with Application… January 04, 2014
Octocat-spinner-32 valgrind.supp Killed some memory leaks November 27, 2011
Octocat-spinner-32 version.pri Added OPENSCAD_COMMIT define to show which git commit a binary actual… January 14, 2012
Octocat-spinner-32 win.pri In this commit i'll change just the Qt project, c and header files to… July 28, 2013
Octocat-spinner-32 winconsole.pri add wrapper code from nop head, mod build scripts January 21, 2013
README.md

Travis CI

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) it does not focus on the artistic aspects of 3D modeling but instead on the CAD aspects. Thus it might be the application you are looking for when you are planning to create 3D models of machine parts but pretty sure is not what you are looking for when you are more interested in creating computer-animated movies.

OpenSCAD is not an interactive modeler. Instead it is something like a 3D-compiler that reads in a script file that describes the object and renders the 3D model from this script file (see examples below). This gives you (the designer) full 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 data exchange format format for this 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.

Getting started

You can download the latest binaries of OpenSCAD at http://www.openscad.org. 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://openscad.org/) 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 (http://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 (http://reprap.org/wiki/MCAD), do the following:

cd openscad
git submodule update --init

Building for Mac OS X

Prerequisites:

  • XCode, including XCode command-line tools (install from XCode Preferences).
  • CMake and pkg-config, both can be installed manually or through MacPorts/homebrew.

Then after you've cloned this git repository, run the script that sets up the environment variables.

source setenv_mac-gcc.sh

(or setenv_mac-clang.sh if you want to use the clang compiler instead of gcc). Then run the script to compile all the prerequisite libraries above:

./scripts/macosx-build-dependencies.sh

You can also install the prerequisites using MacPorts. Unfortunately, brew doesn't yet support CGAL and OpenCSG.

After that, follow the Compilation instructions below.

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 or qt 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: http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows

To cross-build, first make sure that you have 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 32

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

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

Note that this process can take several hours, 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 mingw32

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

cd mingw32
qmake .. CONFIG+=mingw-cross-env
make

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

Compilation

First, run 'qmake' from Qt4 to generate a Makefile. On some systems you need to run 'qmake4', 'qmake-qt4' or something alike to run the qt4 version of the tool.

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: http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_OpenSCAD_from_Sources

Something went wrong with that request. Please try again.