OpenSCAD - The Programmers Solid 3D CAD Modeller (fork with Delaunay triangulation and bend operator)
 
 
 
 
 
 
Go to file
Marius Kintel 6ecf96b081 Minor tweaks to checklist 2013-01-17 15:18:46 -05:00
contrib added auto-loads to scad-mode.el so when it is installed via 2012-07-09 16:43:42 +10:00
doc Minor tweaks to checklist 2013-01-17 15:18:46 -05:00
examples Added better example023 with test output. 2012-02-18 21:22:31 -05:00
icons add flattr icon 2012-08-04 22:35:53 -05:00
libraries updated MCAD 2012-10-31 12:30:20 -04:00
patches No need to link OpenCSG with Qt 2012-07-29 17:25:59 -04:00
qxs Cleaned up qnfa file so it is more taylored to openscad 2010-04-11 10:01:37 +01:00
scripts Note about setting VERSION env. variable 2013-01-17 15:02:28 -05:00
src Updated copyright year to 2013 2013-01-17 15:18:30 -05:00
test-code Copyright updates 2011-01-21 02:21:09 +01:00
testdata Don't just ignore geometric nodes having zero volume/area - when doing difference/intersection, they tend to turn negative objects into positive ones. Fixes #221 2013-01-08 13:26:25 -05:00
tests Test results for updated tests for issue #221 2013-01-17 11:43:17 -05:00
.gitignore Added /openscad to .gitignore 2012-04-24 01:14:33 +02:00
.gitmodules Make MCAD submodule relative to openscad toplevel. 2012-02-18 18:37:53 +01:00
COPYING Fixed FSF address 2012-10-07 19:52:43 +02:00
Info.plist Experimental Apple Event hack; you can now do 'tell application "OpenSCAD" to reload' 2010-02-02 01:01:38 +00:00
OpenSCAD.sdef Experimental Apple Event hack; you can now do 'tell application "OpenSCAD" to reload' 2010-02-02 01:01:38 +00:00
README.md point out that you need a clean shell to run the mingw crossbuild 2013-01-17 16:57:58 +01:00
RELEASE_NOTES Updated RELEASE_NOTES 2013-01-15 19:06:02 -05:00
bison.pri qmake-macx last detected on eigen. (unix=1 on osx). clarify comments. 2012-12-29 17:10:52 -06:00
boost.pri dont use boost-chrono if not doing mingw build 2012-07-15 22:09:40 +02:00
cgal.pri initial steps towards support of clang compiler 2012-07-20 15:23:16 -05:00
common.pri look for EIGENDIR env var. (also look for EIGEN2DIR for backwards compatability) 2012-08-19 08:10:33 -05:00
eigen.pri Linux build fix: qmake exists() was using the variable name instead of its contents 2013-01-16 14:59:45 -05:00
flex.pri detect netbsd / freebsd after linux not before, for bison/flex. 2012-12-23 17:14:58 -06:00
glew.pri detect netbsd / freebsd after linux not before, for bison/flex. 2012-12-23 17:14:58 -06:00
mingw-cross-env.pri rework mingw build to use 'out of source build' for better dual-building 2012-08-01 20:36:27 -05:00
mjau.gdb moved location 2011-08-02 01:44:14 +02:00
opencsg.pri Some more build system cleaning 2011-12-15 05:17:04 +01:00
openscad.pro cleanup 2012-12-29 17:14:13 -06:00
openscad.pro.user Replaced static paths with $$PWD and $QTDIR 2012-02-15 08:42:53 -05:00
openscad.qrc Extracted the about box contents to an external file for easier editing 2012-08-21 21:08:55 -04:00
openscad_win32.rc Copyright updates 2011-01-21 02:21:09 +01:00
setenv_mac-clang.sh Minor clang updates 2012-10-22 22:05:25 -04:00
setenv_mjau.sh Added path to self-built Qt 2013-01-17 09:58:29 -05:00
valgrind.supp Killed some memory leaks 2011-11-27 05:20:18 +01:00
version.pri Added OPENSCAD_COMMIT define to show which git commit a binary actually is built from in the about box. Pass -c to release_common.sh to turn this on. Please use this for development builds, see publish-macosx.sh for how development vs. release is handled 2012-01-14 17:37:34 +01:00
win32.pri fix qmake under mingw-cross-compile 2011-12-16 21:03:10 -06:00

README.md

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 init
git submodule update

Building for Mac OS X

First, make sure that you have XCode installed to get GCC. Then after you've cloned this git repository, run the script that sets up the environment variables.

source setenv_mjau.sh

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

./scripts/macosx-build-dependencies.sh

We currently don't use MacPorts or brew to install the prerequisite libraries because CGAL doesn't exist on brew and opencsg doesn't exist on ports. And more importantly, there are some patches to GMP in the compilation process.

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:

./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

This may take an hour or more, depending on your network and system. It is recommended to have at least 1 gigabyte of free disk space. As a special timesaver if you are only missing CGAL and OpenCSG, you can do this instead:

./scripts/uni-build-dependencies.sh opencsg
./scripts/uni-build-dependencies.sh cgal

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 shell and run the script that sets up the environment variables.

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

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

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

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

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