]> www.fi.muni.cz Git - things.git/blob - yenyalib.scad
switch holder.scad
[things.git] / yenyalib.scad
1
2 module round_with() {
3         if ($preview) {
4                 children([1:1:$children-1]);
5         } else {
6                 minkowski() {
7                         difference() {
8                                 children([1:1:$children-1]);
9                                 minkowski() {
10                                         difference() {
11                                                 minkowski() {
12                                                         children([1:1:$children-1]);
13                                                         children(0);
14                                                 }
15                                                 children([1:1:$children-1]);
16                                         }
17                                         children(0);
18                                 }
19                         }
20                         children(0);
21                 }
22         }
23 }
24
25 module round_edges(r) {
26         round_with() {
27                 sphere(r, $fn = 8);
28                 children();
29         }
30 }
31
32 // deprecated
33 module tx(l) { translate([l, 0, 0]) children(); }
34 module ty(l) { translate([0, l, 0]) children(); }
35 module tz(l) { translate([0, 0, l]) children(); }
36
37 module rx(a) { rotate([a, 0, 0]) children(); }
38 module ry(a) { rotate([0, a, 0]) children(); }
39 module rz(a) { rotate([0, 0, a]) children(); }
40
41 module sx(a) { scale([a, 1, 1]) children(); }
42 module sy(a) { scale([1, a, 1]) children(); }
43 module sz(a) { scale([1, 1, a]) children(); }
44
45 // capital letters are ugly, but more visible in short identifiers
46 module Tx(l) { translate([l, 0, 0]) children(); }
47 module Ty(l) { translate([0, l, 0]) children(); }
48 module Tz(l) { translate([0, 0, l]) children(); }
49
50 module Rx(a) { rotate([a, 0, 0]) children(); }
51 module Ry(a) { rotate([0, a, 0]) children(); }
52 module Rz(a) { rotate([0, 0, a]) children(); }
53
54 module Sx(a) { scale([a, 1, 1]) children(); }
55 module Sy(a) { scale([1, a, 1]) children(); }
56 module Sz(a) { scale([1, 1, a]) children(); }
57
58 module Mx() { for (s = [-1, 1]) Sx(s) children(); }
59 module My() { for (s = [-1, 1]) Sy(s) children(); }
60 module Mz() { for (s = [-1, 1]) Sz(s) children(); }
61
62 eps = 0.01;
63 infty = 100;