POV-Ray : Newsgroups : povray.advanced-users : Beveled text attempt Server Time
29 Jul 2024 18:16:55 EDT (-0400)
  Beveled text attempt (Message 1 to 4 of 4)  
From: Dave Blandston
Subject: Beveled text attempt
Date: 16 Dec 2000 13:49:55
Message: <3a3bb953$1@news.povray.org>
Hi folks,

I've been trying to use the matrix keyword to make beveled text, without
much luck. Although I did get some nice italic text. Has anyone ever made
beveled text before?

Regards,
Dave


Post a reply to this message

From: Chris Huff
Subject: Re: Beveled text attempt
Date: 16 Dec 2000 16:08:57
Message: <chrishuff-9E96F6.16095916122000@news.povray.org>
In article <3a3bb953$1@news.povray.org>, "Dave Blandston" 
<gra### [at] earthlinknet> wrote:

> I've been trying to use the matrix keyword to make beveled text, without
> much luck. Although I did get some nice italic text. Has anyone ever made
> beveled text before?

You can not make beveled text with the matrix keyword alone, the closest 
you can get is shearing (slanting) it. However, you might try an 
intersection of several text objects, each sheared in a different 
direction. I'll try to work up a useful macro for this.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Chris Huff
Subject: Re: Beveled text attempt
Date: 16 Dec 2000 19:21:33
Message: <chrishuff-3C0143.19223516122000@news.povray.org>
In article <chrishuff-9E96F6.16095916122000@news.povray.org>, Chris 
Huff <chr### [at] maccom> wrote:

> I'll try to work up a useful macro for this.

It's not perfect (it has problems with some sharp corners), but it works.
BevelText(String, Cuts, BevelAng, BevelDepth, Depth, Offset)
String: the text string
Cuts: the number of "cuts" to use to get the bevel effect.
BevelAng: the angle of the bevel.
BevelDepth: the thickness of the bevelled portion.
Depth: the total thickness of the text object
Offset: the offset vector for the text object. Might screw stuff up...


#macro Shear(A, B, C)
    matrix <    A.x, A.y, A.z,
                B.x, B.y, B.z,
                C.x, C.y, C.z,
                0, 0, 0>
#end

#macro BevelText(String, Cuts, BevelAng, BevelDepth, Depth, Offset)
    union {
        text {ttf "crystal.ttf", String Depth-BevelDepth, Offset}
        intersection {
            #local J=0;
            #while(J<Cuts)
                #local A = 2*pi*J/(Cuts);
                #local CA = cos(radians(BevelAng));
                #local SA = sin(radians(BevelAng));
                text {ttf "crystal.ttf", String BevelDepth, Offset
                    translate -z*(BevelDepth+J*0.0001)
                    Shear(x, y, < cos(A)*SA, sin(A)*SA, CA>/CA)
                }
                #local J=J+1;
            #end
        }
        translate z*BevelDepth
    }
#end

object {BevelText("POV", 6, 45, 0.02, 0.3, 0)
    texture {
        pigment {color White}
        finish {
            specular 1 roughness 0.02
            metallic reflect_metallic
            diffuse 0.7 ambient 0 reflection 0.25
        }
    }
}

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Dave Blandston
Subject: Re: Beveled text attempt
Date: 16 Dec 2000 21:07:20
Message: <3a3c1fd8@news.povray.org>
"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-3C0143.19223516122000@news.povray.org...
> It's not perfect (it has problems with some sharp corners), but it works.

Wow. Once again I am humbled by you folks. I would just like to say that I
was on the right track, but your solution is fantastic. A font with very few
or no sharp corners should render just fine. Thanks, Chris!

Regards,
Dave


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.