Function to draw 3d text via ruby
-
Hi all. I need function to draw 3D text via ruby. Exists this function? If not how to draw 3D text?
-
I think TIG has an extension that does this. Check the Index in the Plugins forum.
-
My 2dTools 2dText makes 3d 'flat text' with zero thickness - it'd be easy enough to cannibalize the code to have a 'thickness' etc... read its code...
-
Entities#add_3d_text()
? -
As Jim says there is a straightforward
entities.add_3d_text()
method.
You need to pass a whole raft of arguments to it to specify height, font, extrusion and so on.
The arguments are:
The text string [use a "\n" for newline], alignment [only relevant for multi-line strings], the font [ttf name], then 'optional' settings - bold?, italic?, height [inches/units], tolerance [for curves, 0=best], z-height [default=0], faced? and extrusion thickness [inches/units, default=0]
("text", TextAlignLeft, "Arial", true, false, 1.0, 0.0, 0.5, true, 1.0)
You also need to do something like this to keep the 3dtext's geometry away from other stuff...
grp=Sketchup.active_entities.add_group() grp.entities.add_3d_text(...)
Because you then have the geometry safely inside a group you can easily do extra thing to it - like add materials, hide edges etc...
Because 3dtext is always made flat, 'lying down', you can then also transform the group [or its entities] so that the letters are standing up etc... -
entities.add_3d_text. This function I am needed. Thank you.
Advertisement