-
Notifications
You must be signed in to change notification settings - Fork 41
/
gem.scad
74 lines (60 loc) · 2.09 KB
/
gem.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
/*
create a brilliant cut diamond based on the guidance in
http://www.usfacetersguild.org/gem_designs/simple_brilliance/
with an added culet to make a total of (1+16+8+8+16+1+16 )= 66 facets
function make_facets() creates the data for each facet
(index_angle, axial_angle and height)
based on data in the design
e.g.
B 35.00 01-03-05-07-09-11-13-15-17-19-21-23-25-27-29-31
translates to
make_facets(1,2,32,35)
the distance from the centre of these facets is height and
this is set by experimentation to make the facets follow the pattern
(I guess they could be computed but changing them by hand retains a
sense of the operation of a mechanical faceting machine)
gem() then recursively creates each facet and removes it from
the remainder of the original cube
thanks to nop-head and the openscad forum
Kit Wallace
*/
function make_facets(start,increment,limit,axial_angle,height) =
start <= limit
? concat([[start/limit*360, axial_angle, height]] ,
make_facets(start+increment,increment,limit,axial_angle,height))
: [] ;
module body(Size=100) {
cube(Size,center=true);
}
module cut_facet_data(index_angle,axial_angle,height,Width=200,Depth=50) {
rotate([0,0,index_angle])
rotate([0,axial_angle,0])
translate([0,0,Depth/2 + height])
cube([Width,Width,Depth],center=true);
}
module cut_facets(facets, n) {
for (i =[0:n-1])
cut_facet(facets[i]);
}
module cut_facet(facet) {
cut_facet_data(facet[0],facet[1],facet[2]);
}
module gem(facets,n) {
difference() {
if (n==1) body(); else gem(facets,n-1);
cut_facet(facets[n-1]);
}
}
function brilliant_facets() =
concat(
make_facets(1,1,1,0,2.28), // table
make_facets(1,1,1,180,7.8), // culet
make_facets(1,2,32,35,5), // B
make_facets(4,4,32,30,4.46), // M
make_facets(2,4,32,16,3.46), // S
make_facets(2,2,32,90,8.5), // girdle
make_facets(1,2,32,42+180,6) // C
);
facets = brilliant_facets();
// echo (len(facets), facets);
scale(3) gem(facets,len(facets));