Text on a dodecahedron

classic Classic list List threaded Threaded
39 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Text on a dodecahedron

unkerjay
Tried using Blender.

It's been a REAL challenge as there doesn't seem to be much
on the subject of text on polyhedra other than by texture,
which, 3D Printed, leaves only the option of sandstone printing.
Not very durable.

Not to mention that it's LARGE and hasn't passed ANY printability
OR repair tests yet.  

As you can see from the image below, it's not that complex.

Tried this:

http://blender.stackexchange.com/questions/28829/set-edge-as-axis-for-surface-rotation

as a starting point.  Thickened the edges.  Added the text.  Put it all
together, and voila!  Mush!

Looks nice.  Won't print.

There's this by the GREAT, and I use that word deliberately,
Kit Wallace:

http://kitwallace.tumblr.com/post/84238290024/adding-text

but, for me, it's just not clear.  

What I don't know about Openscad is a far greater chasm
than what I know.  So, please, bear that in mind.

I'm guessing, if it's to be done at all, in a remotely printable
format, my best option might be through Openscad.  But, I
have no idea how to begin.

Anyone?

Thanx

12_Days_Dodec_JPG.jpg
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

fred_dot_u
I can't tell you this is the specific answer, but it might be of use. I'm a simpleton when it comes to OpenSCAD, but this set of modules perhaps might be helpful?




On Friday, January 1, 2016 4:42 PM, unkerjay <[hidden email]> wrote:


Tried using Blender.

It's been a REAL challenge as there doesn't seem to be much
on the subject of text on polyhedra other than by texture,
which, 3D Printed, leaves only the option of sandstone printing.
Not very durable.

Not to mention that it's LARGE and hasn't passed ANY printability
OR repair tests yet. 

As you can see from the image below, it's not that complex.

Tried this:

http://blender.stackexchange.com/questions/28829/set-edge-as-axis-for-surface-rotation

as a starting point.  Thickened the edges.  Added the text.  Put it all
together, and voila!  Mush!

Looks nice.  Won't print.

There's this by the GREAT, and I use that word deliberately,
Kit Wallace:

http://kitwallace.tumblr.com/post/84238290024/adding-text

but, for me, it's just not clear. 

What I don't know about Openscad is a far greater chasm
than what I know.  So, please, bear that in mind.

I'm guessing, if it's to be done at all, in a remotely printable
format, my best option might be through Openscad.  But, I
have no idea how to begin.

Anyone?

Thanx

12_Days_Dodec_JPG.jpg
<http://forum.openscad.org/file/n15409/12_Days_Dodec_JPG.jpg



--
View this message in context: http://forum.openscad.org/Text-on-a-dodecahedron-tp15409.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

Neon22
I recently "fixed" the "deprecated use of assign statement" in that lib and my pull request got accepted but I broke the TTB, BTT options he had added.

It works pretty well though and uses the new text() statement.
I need to try to fix that. its all in those nested if conditionals I think.
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

Parkinbot
In reply to this post by unkerjay
There is a very elegant approach to construct a dodekaeder in OpenSCAD and it goes hand in hand with putting some text on the sides as well.



Try this code (CGAL rendering works quite well).

strings = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];

dodekaeder(10);

module dodekaeder(r = 10)
{
  w = acos(1/sqrt(5));
  rotate([0, 0, 180])
  twosides(r, 0);
  for(i=[0:4])
    rotate([0, -w, i*72])  // tricky!
    twosides(r, i+1);
}

module twosides(r=1, i=1)
{
  h = r*2.618;
  linear_extrude(height = h, twist = 36, center = true) // tricky twist
  circle(r, $fn=5);
 
  // text for upper and lower surface
  translate([0, 0, h/2])
  linear_extrude(height = 1)
  text(strings[i],halign = "center", valign = "center");
  rotate([0, 180, 0])
  translate([0, 0, h/2])
  linear_extrude(height = 1)
  text(strings[i+6],halign = "center", valign = "center");
}
unkerjay wrote
I'm guessing, if it's to be done at all, in a remotely printable
format, my best option might be through Openscad.  But, I
have no idea how to begin.

Anyone?
- Rudolf
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

Neon22
In reply to this post by Neon22
submitted new pull req - rotate on circle and cylinder cases fixed.
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

Neon22
In reply to this post by Parkinbot
To use as a dice and have the numbers opposite each other sum to 13 you'll need to change to:
strings = ["1", "2", "3", "4", "5", "6.", "12", "11", "10", "9.", "8", "7"];

To make the text a little smaller (default size=10). use the size parameter (or make the dodec bigger).
E.g.
text(strings[i+6],halign = "center", valign = "center", size=8)
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

unkerjay
Here's what worked (sort of).

Thank you SO MUCH for this!

Haven't tried decreasing the text size.

First thing I tried, even before seeing
your reply, was to increase the dodec
size.

How would I do multiple lines of text.

strings = ["Partridge", "2 T-Doves", "3 F-Hens", "4 C-Birds", "5 G-Rings", "6 Geese", "7 Swans", "8 Maids", "9 Ladies", "10 Lords", "11 Pipers", "12 Drummers"];

dodekaeder(50);

module dodekaeder(r = 50)
{
  w = acos(1/sqrt(5));
  rotate([0, 0, 180])
  twosides(r, 0);
  for(i=[0:4])
    rotate([0, -w, i*72])  // tricky!
    twosides(r, i+1);
}

module twosides(r=1, i=1)
{
  h = r*2.618;
  linear_extrude(height = h, twist = 36, center = true) // tricky twist
  circle(r, $fn=5);
 
  // text for upper and lower surface
  translate([0, 0, h/2])
  linear_extrude(height = 1)
  text(strings[i],halign = "center", valign = "center");
  rotate([0, 180, 0])
  translate([0, 0, h/2])
  linear_extrude(height = 1)
  text(strings[i+6],halign = "center", valign = "center");
}
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

unkerjay
Final Version (including text resize):

A little tweaking in Netfabb Basic and
it's good to go!

Thank you!

strings = ["Partridge", "2 T-Doves", "3 F-Hens", "4 C-Birds", "5 G-Rings", "6 Geese", "12 Drummers","7 Swans", "8 Maids", "9 Ladies", "10 Lords", "11 Pipers"];

dodekaeder(40);

module dodekaeder(r = 40)
{
  w = acos(1/sqrt(5));
  rotate([0, 0, 180])
  twosides(r, 0);
  for(i=[0:4])
    rotate([0, -w, i*72])  // tricky!
    twosides(r, i+1);
}

module twosides(r=1, i=1)
{
  h = r*2.618;
  linear_extrude(height = h, twist = 36, center = true) // tricky twist
  circle(r, $fn=5);
 
  // text for upper and lower surface
  translate([0, 0, h/2])
  linear_extrude(height = 1)
  text(strings[i],halign = "center", valign = "center", size=6);
  rotate([0, 180, 0])
  translate([0, 0, h/2])
  linear_extrude(height = 1)
  text(strings[i+6],halign = "center", valign = "center", size=6);  
}
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

Neon22
In reply to this post by unkerjay
You could make the text into lists of two strings, implying two lines.
Then print one under the other using two translate/text statements ?

Or use a more complex method where you parse the text, separating by spaces, and then scale the whole thing to fit.
But I think you only need a special puropse one-off solution so I'd go with my first suggestion.
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

Neon22
strings = [["Partridge"], ["2","T-Doves"], ["3","F-Hens"], ["4","C-Birds"],
                   ["5","G-Rings"], ["6","Geese"], ["12","Drummers"],["7","Swans"],
                   ["8","Maids"], ["9","Ladies"], ["10","Lords"], ["11","Pipers"]  ];

t_height = 8;

dodekaeder(40);

module dodekaeder(r = 40)
{
  w = acos(1/sqrt(5));
  rotate([0, 0, 180])
  twosides(r, 0);
  for(i=[0:4])
    rotate([0, -w, i*72])  // tricky!
    twosides(r, i+1);
}

module twosides(r=1, i=1)
{
  h = r*2.618;
  linear_extrude(height = h, twist = 36, center = true) // tricky twist
  circle(r, $fn=5);
 
  // text for upper and lower surface
  translate([0, t_height, h/2])
  linear_extrude(height = 1)
        text(strings[i][0],halign = "center", valign = "center", size=t_height);
  translate([0, -t_height, h/2])
  linear_extrude(height = 1)
        text(strings[i][1],halign = "center", valign = "center", size=t_height);
  //
  rotate([0, 180, 0]) {
          translate([0, t_height, h/2])
          linear_extrude(height = 1)
                text(strings[i+6][0],halign = "center", valign = "center", size=t_height);
          translate([0, -t_height, h/2])
          linear_extrude(height = 1)
                text(strings[i+6][1],halign = "center", valign = "center", size=t_height);
        }
}
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

unkerjay
In reply to this post by Neon22
Just curious.

Reading up, a little, and wondering.

Would it be possible to embed cr/lf (carriage return / line feed)
or "Enter" in the text (would Unicodes work for this)?

Something like:

"A-U000D-Partridge-U000D-in a-U000D-Pear Tree"

Probably got the syntax off.

Would something like that work?
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

tp3
On 01/06/2016 03:11 PM, unkerjay wrote:
> Would it be possible to embed cr/lf (carriage return / line feed)
> or "Enter" in the text (would Unicodes work for this)?
>
No, right now only the text shaping level is supported (using
the harfbuzz library). This means support for ligatures, script
languages and combining characters but no layouting.

Adding a newline to the text is no problem (e.g. using chr(13))
but it will just render the glyph that's defined in the selected
font, not produce an actual line break. In most cases that will
just be a dummy rectangle, some fonts may have a special glyph.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

unkerjay
In reply to this post by Neon22
In for a penny, in for a pound.

Here's what I'm shooting for.

It sort of works.  Sort of.

Not getting the third line.

---


strings = [["A Partridge","in a","Pear Tree"], ["2"," Turtle Doves"], ["3","French Hens"], ["4","Calling Birds"],
                   ["5","Golden", "Rings"], ["6","Geese", "a-laying"], ["12","Drummers", "drumming"],["7","Swans", "a-swimming"],
                   ["8","Maids", "a-milking"], ["9","Ladies", "Dancing"],["10","Lords", "a-leaping"],["11","Pipers Piping"] ];

t_height = 7;

dodekaeder(40);

module dodekaeder(r = 40)
{
  w = acos(1/sqrt(5));
  rotate([0, 0, 180])
  twosides(r, 0);
  for(i=[0:4])
    rotate([0, -w, i*72])  // tricky!
    twosides(r, i+1);
}

module twosides(r=1, i=1)
{
  h = r*2.618;
  linear_extrude(height = h, twist = 36, center = true) // tricky twist
  circle(r, $fn=5);
 
  // text for upper and lower surface
  translate([0, t_height, h/2])
  linear_extrude(height = 1)
        text(strings[i][0],halign = "center", valign = "center", size=t_height);
  translate([0, -t_height, h/2])
  linear_extrude(height = 1)
        text(strings[i][1],halign = "center", valign = "center", size=t_height);
  translate([1, -t_height, h/2])
  linear_extrude(height = 1)
        text(strings[i][2],halign = "center", valign = "center", size=t_height);    
  //
  rotate([0, 180, 0]) {
          translate([0, t_height, h/2])
          linear_extrude(height = 1)
                text(strings[i+6][0],halign = "center", valign = "center", size=t_height);
          translate([0, -t_height, h/2])
          linear_extrude(height = 1)
                text(strings[i+6][1],halign = "center", valign = "center", size=t_height);
          translate([0, -t_height, h/2])
          linear_extrude(height = 1)
                text(strings[i+6][2],halign = "center", valign = "center", size=t_height);      
        }
}
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

bytemedwb
Lines 37 and 51 should be -t_height*2.   The 2nd and 3rd lines are
overwriting each other.

On 1/6/16 10:19 AM, unkerjay wrote:

> strings = [["A Partridge","in a","Pear Tree"], ["2"," Turtle Doves"],
> ["3","French Hens"], ["4","Calling Birds"],
>                     ["5","Golden", "Rings"], ["6","Geese", "a-laying"],
> ["12","Drummers", "drumming"],["7","Swans", "a-swimming"],
>                     ["8","Maids", "a-milking"], ["9","Ladies",
> "Dancing"],["10","Lords", "a-leaping"],["11","Pipers Piping"] ];
>
> t_height = 7;
>
> dodekaeder(40);
>
> module dodekaeder(r = 40)
> {
>    w = acos(1/sqrt(5));
>    rotate([0, 0, 180])
>    twosides(r, 0);
>    for(i=[0:4])
>      rotate([0, -w, i*72])  // tricky!
>      twosides(r, i+1);
> }
>
> module twosides(r=1, i=1)
> {
>    h = r*2.618;
>    linear_extrude(height = h, twist = 36, center = true) // tricky twist
>    circle(r, $fn=5);
>    
>    // text for upper and lower surface
>    translate([0, t_height, h/2])
>    linear_extrude(height = 1)
>          text(strings[i][0],halign = "center", valign = "center",
> size=t_height);
>    translate([0, -t_height, h/2])
>    linear_extrude(height = 1)
>          text(strings[i][1],halign = "center", valign = "center",
> size=t_height);
>    translate([1, -t_height, h/2])
>    linear_extrude(height = 1)
>          text(strings[i][2],halign = "center", valign = "center",
> size=t_height);
>    //
>    rotate([0, 180, 0]) {
>            translate([0, t_height, h/2])
>            linear_extrude(height = 1)
>                  text(strings[i+6][0],halign = "center", valign = "center",
> size=t_height);
>            translate([0, -t_height, h/2])
>            linear_extrude(height = 1)
>                  text(strings[i+6][1],halign = "center", valign = "center",
> size=t_height);
>            translate([0, -t_height, h/2])
>            linear_extrude(height = 1)
>                  text(strings[i+6][2],halign = "center", valign = "center",
> size=t_height);
>          }
> }
>


--
========= mailto:[hidden email] ============
David W. Boyd
7371 Atlas Walk Way, #242
Gainesville, Va 20155
fax:     +1-703-656-4829
cell:     +1-703-402-7908
============== http://usstem.org/ ============
First Robotic Mentor - FRC, FTC - www.iliterobotics.org
Board Member- USSTEM Foundation - www.usstem.org
Program Assistant - USFIRST - www.usfirst.org

The information contained in this message may be privileged
and/or confidential and protected from disclosure.
If the reader of this message is not the intended recipient
or an employee or agent responsible for delivering this message
to the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication
is strictly prohibited.  If you have received this communication
in error, please notify the sender immediately by replying to
this message and deleting the material from any computer.

 


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

Parkinbot
In reply to this post by unkerjay
It is always better to do a bit more structured programming to get more of it. This code allowes for any number of centered lines ...

strings = [["A Partridge","in a","Pear Tree", "and a", "Unicorn"], ["2"," Turtle Doves"],
["3","French Hens"], ["4","Calling Birds"],
                   ["5","Golden", "Rings"], ["6","Geese", "a-laying"],
["12","Drummers", "drumming"],["7","Swans", "a-swimming"],
                   ["8","Maids", "a-milking"], ["9","Ladies",
"Dancing"],["10","Lords", "a-leaping"],["11","Pipers Piping"] ];

t_height = 7;

dodekaeder(40);

module dodekaeder(r = 40)
{
  w = acos(1/sqrt(5));
  rotate([0, 0, 180])
  twosides(r, 0);
  for(i=[0:4])
    rotate([0, -w, i*72])  // tricky!
    twosides(r, i+1);
}

module twosides(r=1, i=1)
{
  h = r*2.618;
  linear_extrude(height = h, twist = 36, center = true) // tricky twist
  circle(r, $fn=5);
 
  // text for upper and lower surface
  translate([0, 0, h/2+1])
  multilinetext(strings[i]);
  rotate([0, 180, 0])
  translate([0, 0, h/2])
  multilinetext(strings[i+6]);
}

module multilinetext(t)
  for(i=[0:len(t)-1])
    translate([0, (len(t)/2-i)*t_height, 0])
    linear_extrude(height = 1)
      text(t[i],halign = "center", valign = "center", size=t_height);
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

unkerjay
In reply to this post by bytemedwb
When I look at the code in my console, it ends at line 47.

So, not sure which lines you're referring to.
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

unkerjay
In reply to this post by Parkinbot
Code works.

How to adjust the line spacing?
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

unkerjay
In reply to this post by unkerjay
If THIS:

          translate([0, -t_height, h/2])

is the line you're referring to,

I changed that.

Lines 2 and 3 aren't overwriting each other anymore.

But, I now get no line 3.

So, one problem solved, I think.
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

unkerjay
In reply to this post by unkerjay
Figured it out.

      translate([0, (len(t)/2-i)*t_height*1.5, 0])

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Text on a dodecahedron

unkerjay
In reply to this post by Parkinbot
P.S.

Nice touch "Unicorn"

:)
12