aboutsummaryrefslogtreecommitdiff
path: root/lib/utils.scad
blob: 07eb11ecbfd3bbe5ac01b3bee353f423a1037bbe (plain)
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
// constant circumscribed sphere
function circ_rad(size) = size * sqrt(3) / 2;

//function s2s_d4(size) = circ_rad(size)*4/sqrt(6);
//function s2s_d6(size) = size;
//function s2s_d8(size) = circ_rad(size)*2/sqrt(2);
//function s2s_d12(size) = circ_rad(size)*4/(sqrt(3)*(1+sqrt(5)));
//function s2s_d20(size) = circ_rad(size)*4/(sqrt(10+2*sqrt(5)));

// measured on existing dice (14 mm)

function s2s_d4(size) = size * 1.57;
function s2s_d6(size) = size;
function s2s_d8(size) = size * 1.21;
function s2s_d12(size) = size * 0.86;
function s2s_d20(size) = size * 0.86;

// measured on existing dice (averaged between sizes)

//function s2s_d4(size) = size * 1.40;
//function s2s_d6(size) = size;
//function s2s_d8(size) = size * 1.16;
//function s2s_d12(size) = size * 0.81;
//function s2s_d20(size) = size * 0.78;