|
![](/i/fill.gif) |
In <37DD3533.933DB877@Weizmann.ac.il>, Git### [at] weizmann ac il wrote:
>I am a green, yet eager PoV novice. Here's a bunch of questions:
>
>1. How do I engrave text on the side of e.g. a torus object?
>In the picture I made it obvious that I can't do it right; I only
>differenced the text
>object from the ring but the text should first flow with the ring
>curvature.
I have an example you might find useful at
http://www.hoboes.com/html/NetLife/POV/. It engraves text on the bottom of
a spent bullet casing.
The technique I used--doing the text a letter at a time--might not work
for you if the curvature of the ring is significant compared to the width
of the text.
I've also been experimenting with slicing up text and "curving" it in that
way. This pretty much requires a lot of patience or the max_extent keyword
of the superpatch. Something like the following should give you
#include "colors.inc"
camera {
perspective
location < 0.0, 0.0, -5 >
look_at < 0.0, 0.0, 0.0 >
}
light_source {
< -100.0, 100, -100 >
color rgb White
}
background {
color White
}
//the amount of curvature is determined by the radius
//the 'quality' of the cutting is determined by the fineness.
//the smaller the fineness, the finer the cut
#declare curveradius = 1.5;
#declare fineness = .05;
#declare mytext = text {
ttf "timrom.ttf",
"POV-Ray"
0.1, 0
}
#declare textExtent = max_extent(mytext);
#declare textMintent = min_extent(mytext);
#declare currentstep = 0;
#declare archangle=degrees(asin((fineness/2)/curveradius))*2;
#declare currentangle = 0;
/* #declare curvedText = */ union {
#while (currentstep < textExtent.x)
intersection {
object { mytext }
box {
<currentstep,textMintent.y,0>,
<currentstep+fineness,textExtent.y,textExtent.z>
}
translate <-(currentstep+fineness/2),0,0>
translate <0,0,curveradius>
rotate <0,currentangle,0>
#declare currentangle = currentangle + archangle;
}
#declare currentstep = currentstep+fineness;
#end
rotate <0,-currentangle/2,0>
pigment { color Green }
}
Post a reply to this message
|
![](/i/fill.gif) |