Name Date Size

..13-Jul-20204 KiB

.circleci/H25-May-20204 KiB

.clang-formatH A D02-Aug-2019550

.clang-tidyH A D02-Aug-201994

.github/workflows/H08-Apr-20204 KiB

.gitignoreH A D02-Aug-20201.1 KiB

.gitmodulesH A D02-Aug-201996

.qmake.cacheH A D02-Aug-20191

.travis.ymlH A D05-Aug-20199.5 KiB

.uncrustify.cfgH A D02-Aug-20192 KiB

appcast-snapshots.xml.inH A D02-Aug-2019943

appcast.xml.inH A D02-Aug-2019927

appveyor.ymlH A D02-Aug-20192.8 KiB

bison.priH A D02-Aug-2019467

c++std.priH A D25-Apr-20201.2 KiB

cgal/H20-Nov-20194 KiB

cmake/Modules/H02-Aug-20194 KiB

CMakeLists.txtH A D02-Aug-202021.1 KiB

CMakeSettings.jsonH A D02-Aug-20192.1 KiB

color-schemes/H02-Aug-20194 KiB

common.priH A D21-Dec-20191.1 KiB

contrib/H28-Jun-20204 KiB

COPYINGH A D02-Aug-201918 KiB

csgopnode.hH A D02-Aug-2019431

defaults.priH A D02-Aug-201919

doc/H02-Aug-20204 KiB

dsa_pub.pemH A D02-Aug-2019654

examples/H02-Aug-20194 KiB

features/H21-Dec-20194 KiB

flex.priH A D02-Aug-2019432

fonts/H02-Aug-20194 KiB

fonts-osx/H02-Aug-20194 KiB

icons/H27-Dec-20194 KiB

images/H02-Aug-20194 KiB

Info.plistH A D02-Aug-20192.8 KiB

Info.plist.inH A D02-Aug-20192.6 KiB

info.priH A D02-Aug-2019896

lgtm.ymlH A D30-May-2020857

libraries/MCAD/H02-Aug-20194 KiB

locale/H09-Aug-20204 KiB

mingw-cross-env.priH A D02-Aug-2019275

opengl.priH A D02-Aug-2019693

openscad.appdata.xml.inH A D02-Aug-20192.9 KiB

openscad.proH A D07-Jun-202023.2 KiB

openscad.qrcH A D02-Aug-20194.1 KiB

OpenSCAD.sdefH A D02-Aug-2019378

openscad_win32.rcH A D09-Mar-2020923

org.openscad.OpenSCAD.xmlH A D02-Aug-20192.4 KiB

patches/H02-Aug-20194 KiB

qt.priH A D02-Aug-2019129

README.mdH A D06-Jun-202011 KiB

RELEASE_NOTES.mdH A D09-Mar-202016.4 KiB

releases/H02-Aug-20194 KiB

scripts/H02-Aug-20204 KiB

setenv_mac.shH A D02-Aug-2019366

snap/H23-May-20204 KiB

sounds/H02-Aug-20194 KiB

src/H08-Aug-202012 KiB

templates/H02-Aug-20194 KiB

test-code/H02-Aug-20194 KiB

testdata/H02-Feb-20204 KiB

tests/H08-Aug-20204 KiB

valgrind.suppH A D02-Aug-20191 KiB

version.priH A D02-Aug-20192.5 KiB

win.priH A D02-Aug-2019838

winconsole/H02-Aug-20194 KiB

xcode/H02-Aug-20194 KiB

README.md

1[![Travis (master)](https://img.shields.io/travis/openscad/openscad/master.svg?logo=travis&logoColor=black&colorA=f9d72c&style=plastic)](https://travis-ci.org/openscad/openscad/)
2[![AppVeyor (master)](https://img.shields.io/appveyor/ci/kintel/openscad/master.svg?logo=appveyor&logoColor=black&colorA=f9d72c&style=plastic)](https://ci.appveyor.com/project/kintel/openscad)
3[![CircleCI (master)](https://img.shields.io/circleci/project/github/openscad/openscad/master.svg?logo=circleci&logoColor=black&colorA=f9d72c&style=plastic)](https://circleci.com/gh/openscad/openscad/tree/master)
4[![Coverity Scan](https://img.shields.io/coverity/scan/2510.svg?colorA=f9d72c&logoColor=black&style=plastic)](https://scan.coverity.com/projects/2510)
5
6
7[![Visit our IRC channel](https://kiwiirc.com/buttons/irc.freenode.net/openscad.png)](https://kiwiirc.com/client/irc.freenode.net/#openscad)
8
9# What is OpenSCAD?
10[![Flattr this git repo](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=openscad&url=http://openscad.org&title=OpenSCAD&language=&tags=github&category=software)
11
12OpenSCAD is a software for creating solid 3D CAD objects. It is free software
13and available for Linux/UNIX, MS Windows and Mac OS X.
14
15Unlike most free software for creating 3D models (such as the famous
16application Blender), OpenSCAD focuses on the CAD aspects rather than the 
17artistic aspects of 3D modeling. Thus this might be the application you are
18looking for when you are planning to create 3D models of machine parts but
19probably not the tool for creating computer-animated movies.
20
21OpenSCAD is not an interactive modeler. Instead it is more like a
223D-compiler that reads a script file that describes the object and renders
23the 3D model from this script file (see examples below). This gives you, the
24designer, complete control over the modeling process and enables you to easily
25change any step in the modeling process or make designs that are defined by
26configurable parameters.
27
28OpenSCAD provides two main modeling techniques: First there is constructive
29solid geometry (aka CSG) and second there is extrusion of 2D outlines. As the data
30exchange format for these 2D outlines Autocad DXF files are used. In
31addition to 2D paths for extrusion it is also possible to read design parameters
32from DXF files. Besides DXF files OpenSCAD can read and create 3D models in the
33STL and OFF file formats.
34
35# Contents
36
37- [Getting Started](#getting-started)
38- [Documentation](#documentation)
39    - [Building OpenSCAD](#building-openscad)
40        - [Prerequisites](#prerequisites)
41        - [Getting the source code](#getting-the-source-code)
42        - [Building for Mac OS X](#building-for-mac-os-x)
43        - [Building for Linux/BSD](#building-for-linuxbsd)
44        - [Building for Linux/BSD on systems with older or missing dependencies](#building-for-linuxbsd-on-systems-with-older-or-missing-dependencies)
45        - [Building for Windows](#building-for-windows)
46        - [Compilation](#compilation)
47
48# Getting started
49
50You can download the latest binaries of OpenSCAD at
51<https://www.openscad.org/downloads.html>. Install binaries as you would any other
52software.
53
54When you open OpenSCAD, you'll see three frames within the window. The
55left frame is where you'll write code to model 3D objects. The right
56frame is where you'll see the 3D rendering of your model.
57
58Let's make a tree! Type the following code into the left frame:
59
60    cylinder(h = 30, r = 8);
61
62Then render the 3D model by hitting F5. Now you can see a cylinder for
63the trunk in our tree. Now let's add the bushy/leafy part of the tree
64represented by a sphere. To do so, we will union a cylinder and a
65sphere.
66
67    union() {
68      cylinder(h = 30, r = 8);
69      sphere(20);
70    }
71
72But, it's not quite right! The bushy/leafy are around the base of the
73tree. We need to move the sphere up the z-axis.
74
75    union() {
76      cylinder(h = 30, r = 8);
77      translate([0, 0, 40]) sphere(20);
78    }
79
80And that's it! You made your first 3D model! There are other primitive
81shapes that you can combine with other set operations (union,
82intersection, difference) and transformations (rotate, scale,
83translate) to make complex models! Check out all the other language
84features in the [OpenSCAD
85Manual](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual).
86
87# Documentation
88
89Have a look at the OpenSCAD Homepage (https://www.openscad.org/documentation.html) for documentation.
90
91## Building OpenSCAD
92
93To build OpenSCAD from source, follow the instructions for the
94platform applicable to you below.
95
96### Prerequisites
97
98To build OpenSCAD, you need some libraries and tools. The version
99numbers in brackets specify the versions which have been used for
100development. Other versions may or may not work as well.
101
102If you're using a newer version of Ubuntu, you can install these 
103libraries from aptitude. If you're using Mac, or an older Linux/BSD, there 
104are build scripts that download and compile the libraries from source. 
105Follow the instructions for the platform you're compiling on below.
106
107* A C++ compiler supporting C++14
108* [Qt (5.4 ->)](https://qt.io/)
109* [QScintilla2 (2.9 ->)](https://riverbankcomputing.com/software/qscintilla/)
110* [CGAL (4.9 ->)](https://www.cgal.org/)
111 * [GMP (5.x)](https://gmplib.org/)
112 * [MPFR (3.x)](https://www.mpfr.org/)
113* [cmake (2.8 ->, required by CGAL and the test framework)](https://cmake.org/)
114* [boost (1.55 ->)](https://www.boost.org/)
115* [OpenCSG (1.3.2 ->)](http://www.opencsg.org/)
116* [GLEW (1.5.4 ->)](http://glew.sourceforge.net/)
117* [Eigen (3.x)](https://eigen.tuxfamily.org/)
118* [glib2 (2.x)](https://developer.gnome.org/glib/)
119* [fontconfig (2.10 -> )](https://fontconfig.org/)
120* [freetype2 (2.4 -> )](https://freetype.org/)
121* [harfbuzz (0.9.19 -> )](https://www.freedesktop.org/wiki/Software/HarfBuzz/)
122* [libzip (0.10.1 -> )](https://libzip.org/)
123* [Bison (2.4 -> )](https://www.gnu.org/software/bison/)
124* [Flex (2.5.35 -> )](http://flex.sourceforge.net/)
125* [pkg-config (0.26 -> )](https://www.freedesktop.org/wiki/Software/pkg-config/)
126* [double-conversion (2.0.1 -> )](https://github.com/google/double-conversion/)
127
128### Getting the source code
129
130Install git (https://git-scm.com/) onto your system. Then run a clone:
131
132    git clone git://github.com/openscad/openscad.git
133
134This will download the latest sources into a directory named `openscad`.
135
136To pull the MCAD library (https://github.com/openscad/MCAD), do the following:
137
138    cd openscad
139    git submodule update --init
140
141### Building for Mac OS X
142
143Prerequisites:
144
145* Xcode
146* curl
147* cmake
148* pkgconfig
149* autoconf automake libtool (for HIDAPI / InputDevice support)
150
151Install Dependencies:
152
153After building dependencies using one of the following three options, follow the instructions in the *Compilation* section.
154
1551. **From source**
156
157    Run the script that sets up the environment variables:
158
159        source setenv_mac.sh
160
161    Then run the script to compile all the dependencies:
162
163        ./scripts/macosx-build-dependencies.sh
164
1651. **Homebrew** (assumes [Homebrew](https://brew.sh/) is already installed)
166
167        ./scripts/macosx-build-homebrew.sh
168
1691. **MacPorts** (assumes [MacPorts](https://www.macports.org/) is already installed)
170
171    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.
172
173    NB! MacPorts currently doesn't support Qt5 very well, so using Qt4
174    is the only working option at the moment. However, MacPorts' Qt4
175    has a broken `moc` command, causing OpenSCAD compilation to
176    break. This may be fixed in MacPorts by the time you read this.
177```
178        sudo port install opencsg qscintilla boost cgal pkgconfig eigen3 harfbuzz fontconfig
179```
180
181
182### Building for Linux/BSD
183
184First, make sure that you have git installed (often packaged as 'git-core' 
185or 'scmgit'). Once you've cloned this git repository, download and install 
186the dependency packages listed above using your system's package 
187manager. A convenience script is provided that can help with this 
188process on some systems:
189
190    sudo ./scripts/uni-get-dependencies.sh
191
192After installing dependencies, check their versions. You can run this 
193script to help you:
194
195    ./scripts/check-dependencies.sh
196
197Take care that you don't have old local copies anywhere (`/usr/local/`). 
198If all dependencies are present and of a high enough version, skip ahead 
199to the Compilation instructions. 
200
201### Building for Linux/BSD on systems with older or missing dependencies
202
203If some of your system dependency libraries are missing or old, then you 
204can download and build newer versions into `$HOME/openscad_deps` by 
205following this process. First, run the script that sets up the 
206environment variables. 
207
208    source ./scripts/setenv-unibuild.sh
209
210Then run the script to compile all the prerequisite libraries above:
211
212    ./scripts/uni-build-dependencies.sh
213
214Note that huge dependencies like gcc, qt, or glib2 are not included 
215here, only the smaller ones (boost, CGAL, opencsg, etc). After the 
216build, again check dependencies.
217
218    ./scripts/check-dependencies.sh
219
220After that, follow the Compilation instructions below.
221
222### Building for Windows
223
224OpenSCAD for Windows is usually cross-compiled from Linux. If you wish to
225attempt an MSVC build on Windows, please see this site:
226https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows
227
228To cross-build, first make sure that you have all necessary dependencies 
229of the MXE project ( listed at https://mxe.cc/#requirements ). Don't install
230MXE itself, the scripts below will do that for you under `$HOME/openscad_deps/mxe`
231
232Then get your development tools installed to get GCC. Then after you've 
233cloned this git repository, start a new clean bash shell and run the 
234script that sets up the environment variables.
235
236    source ./scripts/setenv-mingw-xbuild.sh 64
237
238Then run the script to download & compile all the prerequisite libraries above:
239
240    ./scripts/mingw-x-build-dependencies.sh 64
241
242Note that this process can take several hours, and tens of gigabytes of 
243disk space, as it uses the [https://mxe.cc](https://mxe.cc) system to cross-build many
244libraries. After it is complete, build OpenSCAD and package it to an 
245installer:
246
247    ./scripts/release-common.sh mingw64
248
249If you wish you can only build the `openscad.exe` binary:
250
251    cd mingw64
252    qmake ../openscad.pro CONFIG+=mingw-cross-env
253    make
254
255For a 32-bit Windows cross-build, replace 64 with 32 in the above instructions. 
256
257### Compilation
258
259First, run `qmake openscad.pro` from Qt to generate a Makefile.
260
261On 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. 
262
263Then run `make`. Finally you might run `make install` as root or simply copy the
264'openscad' binary (`OpenSCAD.app` on Mac OS X) to the bin directory of your choice.
265
266If you had problems compiling from source, raise a new issue in the
267[issue tracker on the github page](https://github.com/openscad/openscad/issues).
268
269This site and it's subpages can also be helpful:
270https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_OpenSCAD_from_Sources
271