Printable D20

di whosawhatsis

File stampabili (3)

  • stl

    d20.stl

    562 Ko · 13 955 download

    Scarica
  • stl

    regular_icosahedron.stl

    35 Ko · 11 365 download

    Scarica
  • stl

    d20_twenties.stl

    921 Ko · 11 386 download

    Scarica

Descrizione

This a regular icosahedron built in one line in OpenSCAD using no libraries, and only the value of phi as an input. I made it into a D20 by generating and placing the numbers on the surface, all in one additional line (with TBuser's bitmap font module as an input: http://www.thingiverse.com/thing:2054 ). I also included a version with all twenties to satisfy Makerblock's challenge ( http://www.makerbot.com/blog/2011/09/29/openscad-challenge-regular-icosahedron/#comment-15998 ) and take home the imaginary prize for the most efficient/elegant solution (I only took on the challenge because I wanted to see how short a script I could write to do it).

I wanted to generate the numbers numerals myself, and I considered roman numerals, seven-segment numerals, and various binary encodings, but I ended up using the library because I realized that there just isn't (currently?) an elegant way to generate numbers in OpenSCAD (and I'll give my 9000 internet points to anyone who can convince me otherwise).

Because the real point of this Thing in my mind is the conciseness of the code, here it is:

include ;

phi = (1+ sqrt(5))/2;

scale(20) translate([0, 0, cos(atan((phi - 1) / phi)) phi]) rotate([0, atan((phi - 1) / phi 2), 0]) difference() {
intersection_for(a = [0:4]) rotate([0, 31.75, 72 a]) intersection_for(r = [[0,0,0],[90,90,0],[90,0,90]]) rotate(r) linear_extrude(height = 10, center = true) polygon(points=[[phi,1],[phi,-1],[0,-phi],[-phi,-1],[-phi,1],[0,phi]], paths=[[0,1,2,3,4,5]]);
for(n = [1:20]) rotate([180
(ceil(n / 10) % 2), atan((phi - 1) / phi 2) + atan((phi - 1) / phi) 2 (ceil((n - 5) / 10) % 2), 180 + 72 n]) translate([0, 0, 1.5 - .1]) scale(0.008) for(d = [0, floor(log(n))]) translate([0, 35 floor(log(n)) + d -70, 0]) 8bit_char(str(floor(n % pow(10, d + 1) / pow(10, d))), 10, 100, false);
}

Tag