-
Notifications
You must be signed in to change notification settings - Fork 1
/
strange-shapes.scad
95 lines (86 loc) · 2.04 KB
/
strange-shapes.scad
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
91
92
93
94
95
/** includes **/
include <sn_tools.scad>
$fn = 50;
sts_radius=20;
// sphericon2(sts_radius);
sphericon_4(radius = sts_radius);
module sphericon_ground(size=1000) {
translate([0,0,-size]) cube(2*size,center=true);
}
module sphericon2_half(r) {
difference() {
union() {
cylinder(r1=r,r2=0,h=r);
rotate([180,0,0]) cylinder(r1=r,r2=0,h=r);
}
rotate([0,-90,0]) sphericon_ground();
}
}
module sphericon2(r) {
render() {
sphericon2_half(r);
rotate([90,0,0]) rotate([0,0,180]) sphericon2_half(r);
}
};
module sphericon2_half_shell(r, ratio) {
difference() {
sphericon2(r);
sphericon2(ratio*r);
sphericon_ground();
}
}
module sphericon_4(radius=20) {
sts_split_and_rotate(){
sphericon_4_base(radius);
}
}
// sphericon_4_base();
module sphericon_4_base(radius=20) {
cyl_H = radius/1.735;
offset = radius - (radius * .136);
offset_donut_ends = offset + (radius * 0.065);
offset_donut_d = radius*2 + 3;
offset_donut_ends_d = cyl_H*1.867;
offset_donut_ends_part_d = cyl_H*1.5;
echo (offset);
difference() {
hull() {
translate([0,0,offset]) {
cylinder(r1=radius,r2=0,h=cyl_H, center=true);
}
translate([0,0,-offset]) {
cylinder(r2=radius,r1=0,h=cyl_H, center=true);
}
}
union() {
translate([0,0,-offset_donut_ends]) {
torus(part_D=offset_donut_ends_part_d, D = offset_donut_ends_d);
}
torus(part_D=offset_donut_ends_part_d, D = offset_donut_d);
translate([0,0,offset_donut_ends]) {
torus(part_D=offset_donut_ends_part_d, D = offset_donut_ends_d);
}
}
}
}
module sts_split_and_rotate(angle = 120, cubesize = 100){
union() {
difference(){
union() {
children();
}
translate([cubesize/2 - 0.0001, 0, 0]) {
ccube([cubesize,cubesize,cubesize]);
}
}
rotate([angle,0,0])
difference(){
union() {
children();
}
translate([-cubesize/2 + 0.0001, 0, 0]) {
ccube([cubesize,cubesize,cubesize]);
}
}
}
}