[OpenSCAD] text on stars

MichaelAtOz oz.at.michael at gmail.com
Thu Jun 16 21:47:25 EDT 2016

Lucy wrote
> Hi there! Quick openscad question: When placing text on a solid, how can
> you control the location? This code works for a different solid but not
> this one. Any suggestions are helpful. Here's what I've got:
> // LetterBlock.scad - Basic usage of text() and linear_extrude()
> // Module instantiation
> LetterBlock("proxima centauri");
> // Module definition.
> // size=30 defines an optional parameter with a default value.
> module LetterBlock(letter, size=1000) {
>     difference() {
> hull(){ translate([95.0,-163.904109589,151.164383562])cube(0.1,0.1,0.1);
> translate([74.4927536232,-15.5072463768,158.043478261])cube(0.1,0.1,0.1);
> translate([95.0,5.0,35.0])cube(0.1,0.1,0.1);
> translate([95.0,-25.4301075269,171.935483871])cube(0.1,0.1,0.1);
> translate([68.0,-22.0,-149.6])cube(0.1,0.1,0.1);
> translate([95.0,5.0,-137.0])cube(0.1,0.1,0.1);
> translate([39.2764397906,-161.705759162,-188.248167539])cube(0.1,0.1,0.1);
> translate([95.0,-247.647058824,-158.235294118])cube(0.1,0.1,0.1);
> translate([59.9502982107,-110.546719682,-180.188866799])cube(0.1,0.1,0.1);
> translate([95.0,-77.6,-164.533333333])cube(0.1,0.1,0.1);
> translate([95.0,-254.594594595,-151.891891892])cube(0.1,0.1,0.1);
> translate([95.0,-270.688622754,121.706586826])cube(0.1,0.1,0.1);
> translate([63.2793546108,-274.709103757,110.753150395])cube(0.1,0.1,0.1);
> translate([-4.26742331864,-281.601632117,59.0591876935])cube(0.1,0.1,0.1);
> translate([10.2365415987,-272.349102773,-61.9738988581])cube(0.1,0.1,0.1);
> translate([-53.1773399015,-143.177339901,43.1403940887])cube(0.1,0.1,0.1);
> translate([-34.5580110497,-124.55801105,-129.08839779])cube(0.1,0.1,0.1);
> translate([-23.0774962742,-148.90461997,-145.715350224])cube(0.1,0.1,0.1);
> }       translate([-80,40,0])
> {
>             // convexity is needed for correct preview
>             // since characters can be highly concave
>             linear_extrude(height=size, convexity=4)
>                 text(letter,
>                      size=size*3/30,
>                      font="Bitstream Vera Sans",
>                      halign="center",
>                      valign="center");
>         }
>     }
> }

Hi Lucy, welcome to the forum. 
Firstly, your post is still flagged as "This post has NOT been accepted by
the mailing list yet", so nobody gets it unless they look. 
You need to subscribe to the  mailing list
<http://forum.openscad.org/mailing_list/MailingListOptions.jtp?forum=1>  ,
and respond to the registration email.

Re positioning text, you use either rotate() and/or translate() to position
the text.
In your code you don't see the text because it is beside the solid. Add a
'#' at the front of the linear_extrude, ie #linear_extrude(height=size,
convexity=4), and you will see the text. It is way to big ATM.

So you need


Play with the numbers to move it around.

Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
View this message in context: http://forum.openscad.org/text-on-stars-tp17722p17727.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

More information about the Discuss mailing list