Download the STL or ask me how I made this at thingiverse.com
back
cairo torus

// r = r_0 + t(r_1 - r_0)

//for(t=[0:10])
// //.1*10=1
//{
// vector_1 = [1.5 + (1 - 1.5)*.1*t,
// -.866025404 + (0 - -.866025404)*.1*t];
// echo(vector_1);
//}



vectors = [
[-1, 0], //v_7 v_1
[-0.9, 0],
[-0.8, 0],
[-0.7, 0],
[-0.6, 0],
[-0.5, 0],
[-0.4, 0],
[-0.3, 0],
[-0.2, 0],
[-0.1, 0],
[0, 0],
[0.1, 0],
[0.2, 0],
[0.3, 0],
[0.4, 0],
[0.5, 0],
[0.6, 0],
[0.7, 0],
[0.8, 0],
[0.9, 0],
[1, 0],
[1, 0],

[0, 1], //v_4 v_10
[0, 0.9],
[0, 0.8],
[0, 0.7],
[0, 0.6],
[0, 0.5],
[0, 0.4],
[0, 0.3],
[0, 0.2],
[0, 0.1],
[0, 0],
[0, -0.1],
[0, -0.2],
[0, -0.3],
[0, -0.4],
[0, -0.5],
[0, -0.6],
[0, -0.7],
[0, -0.8],
[0, -0.9],
[0, -1],

[0, -1], //v_10 v_11
[0.0633975, -1.0366],
[0.126795, -1.07321],
[0.190192, -1.10981],
[0.25359, -1.14641],
[0.316987, -1.18301],
[0.380385, -1.21962],
[0.443782, -1.25622],
[0.50718, -1.29282],
[0.570577, -1.32942],
[0.633975, -1.36603],

[0.633975, -1.36603], //v_11 v_12
[0.720577, -1.31603],
[0.80718, -1.26603],
[0.893782, -1.21603],
[0.980385, -1.16603],
[1.06699, -1.11603],
[1.15359, -1.06603],
[1.24019, -1.01603],
[1.32679, -0.966025],
[1.4134, -0.916025],
[1.5, -0.866025],

[1.5, -0.866025], //v_12 v_1
[1.45, -0.779423],
[1.4, -0.69282],
[1.35, -0.606218],
[1.3, -0.519615],
[1.25, -0.433013],
[1.2, -0.34641],
[1.15, -0.259808],
[1.1, -0.173205],
[1.05, -0.0866025],
[1, 1.11022e-016],

[1, 0], //v_1 v_2-
[1.0366, 0.0633975],
[1.07321, 0.126795],
[1.10981, 0.190192],
[1.14641, 0.25359],
[1.18301, 0.316987],
[1.21962, 0.380385],
[1.25622, 0.443782],
[1.29282, 0.50718],
[1.32942, 0.570577],
[1.36603, 0.633975],

[1.36603, 0.633975], //v_2 v_3
[1.31603, 0.720577],
[1.26603, 0.80718],
[1.21603, 0.893782],
[1.16603, 0.980385],
[1.11603, 1.06699],
[1.06603, 1.15359],
[1.01603, 1.24019],
[0.966025, 1.32679],
[0.916025, 1.4134],
[0.866025, 1.5],

[0.866025, 1.5], //v_3 v_4
[0.779423, 1.45],
[0.69282, 1.4],
[0.606218, 1.35],
[0.519615, 1.3],
[0.433013, 1.25],
[0.34641, 1.2],
[0.259808, 1.15],
[0.173205, 1.1],
[0.0866025, 1.05],
[-1.11022e-016, 1],

[0, 1], //v_4 v_5
[-0.0633975, 1.0366],
[-0.126795, 1.07321],
[-0.190192, 1.10981],
[-0.25359, 1.14641],
[-0.316987, 1.18301],
[-0.380385, 1.21962],
[-0.443782, 1.25622],
[-0.50718, 1.29282],
[-0.570577, 1.32942],
[-0.633975, 1.36603],

[-0.633975, 1.36603], //v_5 v_6
[-0.720577, 1.31603],
[-0.80718, 1.26603],
[-0.893782, 1.21603],
[-0.980385, 1.16603],
[-1.06699, 1.11603],
[-1.15359, 1.06603],
[-1.24019, 1.01603],
[-1.32679, 0.966025],
[-1.4134, 0.916025],
[-1.5, 0.866025],

[-1.5, 0.866025], //v_6 v_7
[-1.45, 0.779423],
[-1.4, 0.69282],
[-1.35, 0.606218],
[-1.3, 0.519615],
[-1.25, 0.433013],
[-1.2, 0.34641],
[-1.15, 0.259808],
[-1.1, 0.173205],
[-1.05, 0.0866025],
[-1, -1.11022e-016],

[-1, 0], //v_7 v_8
[-1.0366, -0.0633975],
[-1.07321, -0.126795],
[-1.10981, -0.190192],
[-1.14641, -0.25359],
[-1.18301, -0.316987],
[-1.21962, -0.380385],
[-1.25622, -0.443782],
[-1.29282, -0.50718],
[-1.32942, -0.570577],
[-1.36603, -0.633975],

[-1.36603, -0.633975], //v_8 v_9
[-1.31603, -0.720577],
[-1.26603, -0.80718],
[-1.21603, -0.893782],
[-1.16603, -0.980385],
[-1.11603, -1.06699],
[-1.06603, -1.15359],
[-1.01603, -1.24019],
[-0.966025, -1.32679],
[-0.916025, -1.4134],
[-0.866025, -1.5],

[-0.866025, -1.5], //v_9 v_10
[-0.779423, -1.45],
[-0.69282, -1.4],
[-0.606218, -1.35],
[-0.519615, -1.3],
[-0.433013, -1.25],
[-0.34641, -1.2],
[-0.259808, -1.15],
[-0.173205, -1.1],
[-0.0866025, -1.05],
[1.11022e-016, -1],
[1.11022e-016, -1],

];

vectors_rotated = [
[-0.965926, 0.258819],
[-0.869333, 0.232937],
[-0.772741, 0.207055],
[-0.676148, 0.181173],
[-0.579555, 0.155291],
[-0.482963, 0.12941],
[-0.38637, 0.103528],
[-0.289778, 0.0776457],
[-0.193185, 0.0517638],
[-0.0965926, 0.0258819],
[0, 0],
[0.0965926, -0.0258819],
[0.193185, -0.0517638],
[0.289778, -0.0776457],
[0.38637, -0.103528],
[0.482963, -0.12941],
[0.579555, -0.155291],
[0.676148, -0.181173],
[0.772741, -0.207055],
[0.869333, -0.232937],
[0.965926, -0.258819],
[0.965926, -0.258819],
[0.258819, 0.965926],
[0.232937, 0.869333],
[0.207055, 0.772741],
[0.181173, 0.676148],
[0.155291, 0.579555],
[0.12941, 0.482963],
[0.103528, 0.38637],
[0.0776457, 0.289778],
[0.0517638, 0.193185],
[0.0258819, 0.0965926],
[0, 0],
[-0.0258819, -0.0965926],
[-0.0517638, -0.193185],
[-0.0776457, -0.289778],
[-0.103528, -0.38637],
[-0.12941, -0.482963],
[-0.155291, -0.579555],
[-0.181173, -0.676148],
[-0.207055, -0.772741],
[-0.232937, -0.869333],
[-0.258819, -0.965926],
[-0.258819, -0.965926],
[-0.207055, -1.01769],
[-0.155293, -1.06946],
[-0.103529, -1.12122],
[-0.0517636, -1.17298],
[4.11351e-007, -1.22474],
[0.0517628, -1.27651],
[0.103527, -1.32827],
[0.155292, -1.38004],
[0.207056, -1.4318],
[0.258818, -1.48357],
[0.258818, -1.48357],
[0.35541, -1.45769],
[0.452003, -1.4318],
[0.548595, -1.40592],
[0.645188, -1.38004],
[0.741783, -1.35416],
[0.838374, -1.32828],
[0.934964, -1.30239],
[1.03156, -1.27651],
[1.12815, -1.25063],
[1.22474, -1.22474],
[1.22474, -1.22474],
[1.19886, -1.12815],
[1.17298, -1.03156],
[1.1471, -0.934967],
[1.12122, -0.838374],
[1.09534, -0.741782],
[1.06945, -0.645189],
[1.04357, -0.548597],
[1.01769, -0.452004],
[0.991808, -0.355412],
[0.965926, -0.258819],
[0.965926, -0.258819],
[1.01769, -0.207055],
[1.06946, -0.155293],
[1.12122, -0.103529],
[1.17298, -0.0517636],
[1.22474, 4.11351e-007],
[1.27651, 0.0517628],
[1.32827, 0.103527],
[1.38004, 0.155292],
[1.4318, 0.207056],
[1.48357, 0.258818],
[1.48357, 0.258818],
[1.45769, 0.35541],
[1.4318, 0.452003],
[1.40592, 0.548595],
[1.38004, 0.645188],
[1.35416, 0.741783],
[1.32828, 0.838374],
[1.30239, 0.934964],
[1.27651, 1.03156],
[1.25063, 1.12815],
[1.22474, 1.22474],
[1.22474, 1.22474],
[1.12815, 1.19886],
[1.03156, 1.17298],
[0.934967, 1.1471],
[0.838374, 1.12122],
[0.741782, 1.09534],
[0.645189, 1.06945],
[0.548597, 1.04357],
[0.452004, 1.01769],
[0.355412, 0.991808],
[0.258819, 0.965926],
[0.258819, 0.965926],
[0.207055, 1.01769],
[0.155293, 1.06946],
[0.103529, 1.12122],
[0.0517636, 1.17298],
[-4.11351e-007, 1.22474],
[-0.0517628, 1.27651],
[-0.103527, 1.32827],
[-0.155292, 1.38004],
[-0.207056, 1.4318],
[-0.258818, 1.48357],
[-0.258818, 1.48357],
[-0.35541, 1.45769],
[-0.452003, 1.4318],
[-0.548595, 1.40592],
[-0.645188, 1.38004],
[-0.741783, 1.35416],
[-0.838374, 1.32828],
[-0.934964, 1.30239],
[-1.03156, 1.27651],
[-1.12815, 1.25063],
[-1.22474, 1.22474],
[-1.22474, 1.22474],
[-1.19886, 1.12815],
[-1.17298, 1.03156],
[-1.1471, 0.934967],
[-1.12122, 0.838374],
[-1.09534, 0.741782],
[-1.06945, 0.645189],
[-1.04357, 0.548597],
[-1.01769, 0.452004],
[-0.991808, 0.355412],
[-0.965926, 0.258819],
[-0.965926, 0.258819],
[-1.01769, 0.207055],
[-1.06946, 0.155293],
[-1.12122, 0.103529],
[-1.17298, 0.0517636],
[-1.22474, -4.11351e-007],
[-1.27651, -0.0517628],
[-1.32827, -0.103527],
[-1.38004, -0.155292],
[-1.4318, -0.207056],
[-1.48357, -0.258818],
[-1.48357, -0.258818],
[-1.45769, -0.35541],
[-1.4318, -0.452003],
[-1.40592, -0.548595],
[-1.38004, -0.645188],
[-1.35416, -0.741783],
[-1.32828, -0.838374],
[-1.30239, -0.934964],
[-1.27651, -1.03156],
[-1.25063, -1.12815],
[-1.22474, -1.22474],
[-1.22474, -1.22474],
[-1.12815, -1.19886],
[-1.03156, -1.17298],
[-0.934967, -1.1471],
[-0.838374, -1.12122],
[-0.741782, -1.09534],
[-0.645189, -1.06945],
[-0.548597, -1.04357],
[-0.452004, -1.01769],
[-0.355412, -0.991808],
[-0.258819, -0.965926]
];


//
////rotating all the points
//for(n=[0:174])
//{
// vector_1 = vectors[n];
// vector_2 = [
// cos(-15)*vector_1[0]-sin(-15)*vector_1[1],
// sin(-15)*vector_1[0]+cos(-15)*vector_1[1]];
// echo(vector_2);
//}




for(l=[0:11])
{
     for(m=[0:4])
     {
         for(n=[0:20])
         {
             k = .4082482904;
             vector_1 = vectors_rotated[n];
             vector_2 = vectors_rotated[n+1];
             hull()
             {
                 translate([(9 + 6*cos(vector_1[1]*72*k + 72*m))*cos(vector_1[0]*30*k + 30*l),
                 (9 + 6*cos(vector_1[1]*72*k + 72*m))*sin(vector_1[0]*30*k + 30*l),
                 6*sin(vector_1[1]*72*k + 72*m)
                 ])
                 {
                     sphere($fn=20, .5, true);
                 }
                 translate([(9 + 6*cos(vector_2[1]*72*k + 72*m))*cos(vector_2[0]*30*k + 30*l),
                 (9 + 6*cos(vector_2[1]*72*k + 72*m))*sin(vector_2[0]*30*k + 30*l),
                 6*sin(vector_2[1]*72*k + 72*m)
                 ])
                 {
                     sphere($fn=20, .5, true);
                 }
             }
         }
         for(n=[22:173])
         {
             k = .4082482904;
             vector_1 = vectors_rotated[n];
             vector_2 = vectors_rotated[n+1];
             hull()
             {
                 translate([(9 + 6*cos(vector_1[1]*72*k + 72*m))*cos(vector_1[0]*30*k + 30*l),
                 (9 + 6*cos(vector_1[1]*72*k + 72*m))*sin(vector_1[0]*30*k + 30*l),
                 6*sin(vector_1[1]*72*k + 72*m)
                 ])
                 {
                     sphere($fn=20, .5, true);
                 }
                 translate([(9 + 6*cos(vector_2[1]*72*k + 72*m))*cos(vector_2[0]*30*k + 30*l),
                 (9 + 6*cos(vector_2[1]*72*k + 72*m))*sin(vector_2[0]*30*k + 30*l),
                 6*sin(vector_2[1]*72*k + 72*m)
                 ])
                 {
                     sphere($fn=20, .5, true);
                 }
             }
         }
     }
}























//for(i=[0:173])
//{
// vector = vectors[i];
// translate([vector[0], vector[1], vector[2]])
// {
// sphere(.2, true);
// }
//}


/////testing the vertices
//
//vertices = [
//[0, 0], //v_0
//[1, 0], //v_1
//[1.366025404, .6339745962], //v_2
//[.8660254038, 1.5], //v_3
//[0, 1], //v_4
//[-.633974596, 1.366025404],
//[-1.5, .8660254038],
//[-1, 0],
//[-1.366025404, -.6339745962], //v_8
//[-.866025404, -1.5], //v_9
//[0, -1], //v_10
//[.633974596, -1.366025404], //v_11
//[1.5, -.8660254038] //v_12
//];
//
//
//for(j=[0:12])
//{
// vertex = vertices[j];
//
// translate([vertex[0], vertex[1], vertex[2]])
// {
// color("Fuchsia", 1) sphere(.21, true);
// }
//
//}