Difference between revisions of "Printable D20 (Q52878)"

From Library of Open Source Hardware
Jump to navigation Jump to search
(Reconciliation Edit)
 
(‎Added [en] label: Printable D20)
 
label / enlabel / en
 +
Printable D20

Latest revision as of 20:02, 25 February 2022

No description defined
Language Label Description Also known as
English
Printable D20
No description defined

    Statements

    thingiverse.com
    0 references
    en
    0 references
    0 references
    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); }
    0 references
    www.thingiverse.com
    0 references
    whosawhatsis
    0 references
    1.0.0
    0 references
    auto
    0 references
    https://spdx.org/licenses/CC-BY-SA-4.0
    0 references