-
Notifications
You must be signed in to change notification settings - Fork 0
/
flexaedre-2D.scad
78 lines (58 loc) · 1.64 KB
/
flexaedre-2D.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
/*
Flexaèdre "HyperQBS"
B. Vernay 2016-08-28
https://www.youtube.com/watch?v=Kg3_gLO-reE
http://www.openscad.org/
*/
b = 100;
a = b * sqrt(2); // 141;
c = b * sqrt(3)/2; // 87;
echo("Taille des cotés: a=",a, " b=",b, " c=",c, "." );
function hauteur_triangle_isocele(base, cote_congru) =
sqrt( pow(cote_congru, 2) -pow(base/2, 2) );
// Angles face aux petits cotés
Aa = acos( (a/2) / c );
Ba = (180-90)/2; // acos( (a/2) / b );
Ca = acos( (b/2) / c );
Ah = hauteur_triangle_isocele(a, c);
Bh = a/2; // B a un angle droit!
echo("Hauteur Bh=", Bh, " = ", hauteur_triangle_isocele(a, b));
Ch = hauteur_triangle_isocele(b, c);
module triangle_isocele(base, cote_congru) {
polygon([
[0, 0],
[base, 0],
[base/2, hauteur_triangle_isocele( base, cote_congru)]
]);
};
color ("Silver") {
triangle_isocele(a, c);
rotate(-(180-90)/2)
mirror([0,1,0]) triangle_isocele(b, c);
translate([+a/2,0,0]) mirror([1,0,0])
translate([-a/2,0,0])
rotate(-Ba)
mirror([0,1,0]) triangle_isocele(b, c);
/* Another solution:
translate([a,0,0])
rotate(Ba) translate([-b,0,0])
mirror([0,1,0]) triangle_isocele(b, c);
*/
}
// Optionnel (pour coller l'intérieur)
color ("LightGrey") offset(delta=-1) {
translate([a,0,0])
rotate(180-Aa-Ca)
triangle_isocele(b, c);
rotate(-Ba-Ca-Aa)
triangle_isocele(a, c);
rotate(-Ba)
translate([b,0,0])
rotate( -(90 +2*Ca -180) )
triangle_isocele(b, c);
}
color ("Black") {
translate([a/2, Ah/2,0]) text("A", halign="center");
translate([a/2, -Bh/2,0]) text("B", halign="center");
translate([c/5, -b/2,0]) text("C", halign="center");
}