Skip to content

Latest commit

 

History

History
105 lines (68 loc) · 3.42 KB

File metadata and controls

105 lines (68 loc) · 3.42 KB

Parametric CAD II. OpenSCAD

🚧 This documentation is WIP

Introduction to OpenSCAD

OpenSCAD is a free script based application for creating solid 3D CAD objects.

Install OpenSCAD in your computer

It has a specific description language which specifies geometric primitives and defines how they are modified to render a 3D model. No one likes manuals, but you have to read the manual sometimes.
rtfm

Seeing the Matrix

Script based CAD software like OpenSCAD has a number of advantages over traditional and more intuitive click and drag software.

Name a few advantages of script based CAD software. Can you imagine any disadvantage also?

It also helps you develop some personal skills like abstraction, rigor and spatial vision. In fact, when you master OpenSCAD you will see like this:

thematrix

Commenting the code

In all code, commenting is very important. OpenSCAD uses C style comments.

// This is a single line comment in C and also OpenSCAD

/*
And this is a multiple
line comment in C and
also in OpenSCAD
*/

Not only comment every step you do (so others can learn from you) but also include a header in every file with the following information:

  • filename
  • short description
  • your name (author)
  • date
  • license and credits

You will greatly appreciate that info when you or others open the file later in the future.

Hello-world cube

The Hello-world of OpenSCAD is a cube.

cube(size=[x,y,x]); creates a cube with one corner on the origin and x,y,z dimensions like cube([10,20,30]);

Why did the above code work if size= was omitted? Create a 15x15x15 cube centered in the origin.

Translations and rotations

Rotations are about an axis using the right hand rule.

Cylinders, polygons and pyramids

Unions and differences

Defining parameters

Creating modules

Default parameters

Grids and Arrays

Adding color and modifiers

Calling other files

The incredible hull

Assemblies using equations

Cheat-sheet

TODO the logic, loops, runtime, compile time variables "The variable retains its last assigned value at compile time, in line with Functional programming languages"

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#Variables

Functional vs Imperative programming languages

Back to Summary