// SPDX-License-Identifier: LicenseRef-PD-hp OR CC0-1.0 OR 0BSD OR MIT-0 OR MIT // *haven dice stand for d20 status display. // Size of a standard d20 face to face in mm. // Measuring face to face avoids dealing with rounded corners. d20ftf = 19; // Length of an edge of a d20. // The face to face distance is the diameter of an inscribed sphere // which is (sqrt(3)/6)*(3+sqrt(5))*edge . edge = d20ftf/((sqrt(3)/6)*(3+sqrt(5))); // Radius of a sphere circumscribing a d20. d20cr = edge*sqrt(10+2*sqrt(5))/4; // Thickness of base in mm. thick = 1; // Ratio of circumscribed circle around stands to reserved area. ccr = 1.2; // Reserved radius is the reserved ratio times the radius of a sphere // that circumscribes an icosahedron with edges of length 'edge'. rr = ccr*d20cr; // Overlap for connecting parts. ol = .001; // Limit to 3600 arc fragments for circles. $fa = .1; // Limit fragment size to the minimum. $fs = .01; // Define what the backstops look like. They should be tetrahedrons // whose upward face is intended to match one of the faces of the d20 // sharing an edge with the base. It is designed to be rotated around // the origin and then translated to one of the circles defining the base. // The height of the tetrahedron is edge*(sqrt(3)/2)*(2/3). bsh = edge/sqrt(3); // The base extent of the tetrahedron is edge*(sqrt(3)/2)*(sqrt(5)/3). bse = edge*sqrt(15)/6; // The setback of the tetrahedron from the origin is edge*(sqrt(3)/2)/2. bss = edge*sqrt(3)/6; module backstop() { polyhedron( points=[ [0, bss+bse, thick+bsh], [0, bss+bse, thick], [-edge/2, bss, thick], [edge/2, bss, thick] ], faces=[ [0, 3, 2], [0, 1, 3], [0, 2, 1], [1, 2, 3] ] ); } // Define the base. linear_extrude(thick+ol) { hull() { translate([-rr, 0]) {circle(rr);} translate([rr, 0]) {circle(rr);} } } // Add the backstops. translate([-rr,0]) { backstop(); rotate(120) { backstop(); } rotate(240) { backstop(); } } translate([rr,0]) { backstop(); rotate(120) { backstop(); } rotate(240) { backstop(); } }