summaryrefslogtreecommitdiff
path: root/example.scad
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-06-21 11:41:11 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-06-21 11:41:11 (GMT)
commite24a87b8a37b8f71be30d99251908a5d80bb8bc7 (patch)
treedaea8c3a9841c723cd550d5d55617edd06f65247 /example.scad
parent0e4681913485cb450493e9a35ae297d88f12b19d (diff)
Clifford Wolf:
Compilation to CSG tree is working now git-svn-id: http://svn.clifford.at/openscad/trunk@6 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'example.scad')
-rw-r--r--example.scad39
1 files changed, 26 insertions, 13 deletions
diff --git a/example.scad b/example.scad
index 35fa12e..7a80a5d 100644
--- a/example.scad
+++ b/example.scad
@@ -1,20 +1,33 @@
-function r_from_dia(d) = d / 2;
+module test001()
+{
+ function r_from_dia(d) = d / 2;
-module rotcy(rot, r, h) {
- rot(rot) cylinder(r = r, h = h);
-}
+ module rotcy(rot, r, h) {
+ rot(rot) cylinder(r = r, h = h);
+ }
+
+ difference() {
+ sphere(r = r_from_dia(size));
+ rotcy([ 0 0 0], cy_r, cy_h);
+ rotcy([90 0 0], cy_r, cy_h);
+ rotcy([ 0 90 0], cy_r, cy_h);
+ }
-difference() {
- sphere(r = r_from_dia(size));
- rotcy([ 0 0 0], cy_r, cy_h);
- rotcy([90 0 0], cy_r, cy_h);
- rotcy([ 0 90 0], cy_r, cy_h);
+ size = 10;
+ hole = 2;
+
+ cy_r = r_from_dia(hole);
+ cy_h = r_from_dia(size * 1.5);
}
-size = 10;
-hole = 2;
+module test002()
+{
+ difference() {
+ cube(1);
+ trans([0.5, 0.5, 0.5]) cube(1);
+ }
+}
-cy_r = r_from_dia(hole);
-cy_h = r_from_dia(size * 1.5);
+test002();
contact: Jan Huwald // Impressum