Skip to content
t-paul edited this page Sep 21, 2014 · 11 revisions

This page is intended to collect ideas what to put into a longer Tutorial documentation (either as part of the User Manual or as separate document).

Introduction

The building blocks

3D Shapes

Show all possible shapes with examples for different parameters. sphere() / cube() / cylinder() / polyhedron()

2D Shapes

Show all possible shapes with examples for different parameters. circle() / square() / polygon()

Combining shapes / CSG

Needs some ideas for simple objects to create

Translation

Difference

Intersection

Example models:

  • Cable hanger

Extrude 2D into 3D

Linear extrude

Example models:

  • Tablecloth clip using 2d subsystem
  • Cookie cutters using DXF import for outline

Rotate extrude

Example models: ?

Funnel: http://forum.openscad.org/Best-way-to-draw-a-funnel-td9741.html#a9752

Advanced examples

  • construction of a gearbox

  • use command line to generate multiple results with different parameters

params = [
        [10, 20, 4],
        [12, 12, 2],
        [20, 15, 3],
];

module m(x, y, r) {
        difference() {
                cube([x, y, 20], center = true);
                cylinder(r = r, h = 30, center = true);
        }
}

m(params[idx][0], params[idx][1], params[idx][2]);
openscad -Didx=0 example.scad -o 0.stl
openscad -Didx=1 example.scad -o 1.stl
openscad -Didx=2 example.scad -o 2.stl

Tips & Tricks

  • Ranges include start & end so it does not match the usual for (a = 0;a < 10;a++) pattern
count = 6;
for (a = [0 : count]) {
	rotate([0, 90, 360 / (count + 1) * a]) {
		cylinder(r = 2, h = 40);
	}
}
  • Auto-reload & compile
include <settings.scad>
cylinder(r = radius, h = height);