File: include-tests-expected.ast

package info (click to toggle)
openscad 2021.01-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 36,096 kB
  • sloc: cpp: 53,199; sh: 4,384; ansic: 4,382; python: 1,813; yacc: 853; javascript: 762; lex: 417; lisp: 163; xml: 127; makefile: 118
file content (90 lines) | stat: -rw-r--r-- 2,510 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
function deg(angle) = ((360 * angle) / TAU);
module test3() {
	cylinder(r1 = 0.7, r2 = 0.2, center = true);
}
module test4() {
	cylinder(r = 0.5, $fn = 10, center = true);
}
module test2() {
	cube(center = true);
}
module test5() {
	sphere(r = 0.5, $fn = 8);
}
module test5() {
	sphere(r = 0.5, $fn = 8);
}
module test6() {
	difference() {
		cube(center = true);
		cylinder(r = 0.4, h = 2, center = true);
	}
}
module test7() {
	cube([0.5, 0.5, 1], center = true);
}
module alignds420(position, rotation, screws = 0, axle_lenght = 0) {
	translate(position) rotate(rotation) {
		union() {
			translate([0, 0, 17]) {
				cylinder(r = 6, h = 8, $fn = 30);
				cylinder(r = 2.5, h = 10.5, $fn = 20);
			}
			translate([-6, -6, 0]) {
				cube([12, 22.8, 19.5], false);
				translate([0, -5, 17]) cube([12, 7, 2.5]);
				translate([0, 20.8, 17]) cube([12, 7, 2.5]);
			}
			if((screws > 0)) {
				translate([0, (-10.2 + 1.8), 11.5]) cylinder(r = (1.8 / 2), h = 6, $fn = 6);
				translate([0, (21 - 1.8), 11.5]) cylinder(r = (1.8 / 2), h = 6, $fn = 6);
			}
			translate([-6, 0, 19]) rotate([90, 0, 90]) triangle(4, 18, 12);
			translate([-6, -6, 19]) cube([12, 6.5, 4]);
		}
		if((axle_lenght > 0)) cylinder(r = 0.9, h = axle_lenght, center = true, $fn = 8);
	}
}
module futabas3003(position, rotation) {
	translate(position) rotate(rotation) union() {
		translate([0, 0, 0]) {
			cube([20.1, 39.9, 36.1], false);
			translate([1.1, -7.6, 26.6]) difference() {
				cube([18, 7.6, 2.5]);
				translate([4, 3.5, 0]) cylinder(100, 2);
				translate([14, 3.5, 0]) cylinder(100, 2);
			}
			translate([1.1, 39.9, 26.6]) difference() {
				cube([18, 7.6, 2.5]);
				translate([4, 4.5, 0]) cylinder(100, 2);
				translate([14, 4.5, 0]) cylinder(100, 2);
			}
		}
		translate([10, 30, 36.1]) {
			cylinder(r = 6, h = 0.4, $fn = 30);
			cylinder(r = 2.5, h = 4.9, $fn = 20);
		}
	}
}
module test_alignds420() {
	alignds420(screws = 1);
}
module test1() {
	test2();
	translate([2, 0, 0]) test3();
	translate([2, -2, 0]) test4();
	translate([-2, 0, 0]) test5();
	translate([-2, -2, 0]) test6();
	translate([0, 2, 0]) test7();
	translate([0, -2, 0]) sphere(test2_variable, $fn = 16);
	translate([0, -4, 0]) cube([(TAU / 4), 0.5, 0.5], center = true);
	translate([-2, -4, 0]) cube([(deg(0.5) / 20), 0.5, 0.5], center = true);
	translate([2, -4, -0.5]) scale(0.05) alignds420([0, 0, 0], [0, 0, 0]);
}
test2_variable = 0.7;
TAU = 6.28319;
PI = (TAU / 2);
mm_per_inch = 25.4;
echo("included.scad");
echo("included2.scad");
test1();