POV-Ray : Newsgroups : povray.binaries.images : IRTC WIP Server Time
31 Jul 2024 08:23:43 EDT (-0400)
  IRTC WIP (Message 29 to 38 of 38)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: JWV
Subject: Re: IRTC WIP
Date: 14 Apr 2010 05:43:21
Message: <4bc58e39$1@news.povray.org>
clipka schreef:
> Am 14.04.2010 11:18, schrieb JWV:
> 
>> As a reult, i now have a macro that makes a beveled shape, following a
>> path defined by a spline. This way one could make letters (anyone has a
>> libray of splines that are shaped like letters?).
> 
> How did you do this?


I make a mesh that follows the spline, capping the ends with a cylinder 
and a cone. The code is still a bit messy, but here it is:

#macro bevel_spline(S1,dd,eps,w,w2,H1, H2) 

         #union{ 

         #mesh{
         #declare ctr = 0;
         #while (ctr < 1-(dd))

           #local dy = S1(ctr+eps).z-S1(ctr).z;
           #local dx = S1(ctr+eps).x-S1(ctr).x;
           #local ds = sqrt(dy*dy+dx*dx);
           #local vt1 = < -dy/ds,0, dx/ds>*sqrt(pow(dx/ds,2)+pow(dy/ds,2));

           #local dy = S1(ctr+dd+eps).z-S1(ctr+dd).z;
           #local dx = S1(ctr+dd+eps).x-S1(ctr+dd).x;
           #local ds = sqrt(dy*dy+dx*dx);
           #local vt2 = < -dy/ds,0, dx/ds>*sqrt(pow(dx/ds,2)+pow(dy/ds,2));

           #local P1 = S1(ctr)+w*vt1;
           #local P2 = S1(ctr)-w*vt1;
           #local P3 = S1(ctr)+(w+w2)*vt1-H1*y;
           #local P4 = S1(ctr)-(w+w2)*vt1-H1*y;
           #local P5 = P3-H2*y;
           #local P6 = P4-H2*y;

           #local P1_ = S1(ctr+dd)+w*vt2;
           #local P2_ = S1(ctr+dd)-w*vt2;
           #local P3_ = S1(ctr+dd)+(w+w2)*vt2-H1*y;
           #local P4_ = S1(ctr+dd)-(w+w2)*vt2-H1*y;
           #local P5_ = P3_-H2*y;
           #local P6_ = P4_-H2*y;


           triangle{P1,P2,P2_  }
           triangle{P1,P1_,P2_ }

           triangle{P1,P1_,P3  }
           triangle{P3_,P1_,P3  }

           triangle{P2,P4,P4_  }
           triangle{P2,P2_,P4_  }

           triangle{P5,P3,P3_  }
           triangle{P5,P5_,P3_  }

           triangle{P6,P4,P4_  }
           triangle{P6,P6_,P4_ }

           triangle{P5,P6,P6_ }
           triangle{P5,P5_,P6_ }

           #declare ctr = ctr + dd;
         #end
         }

         cone{ S1(0)-H1*y,(w+w2),S1(0),(w)}
         cone{ S1(0)-H1*y,(w+w2),S1(0)-(H1+H2)*y,(w+w2)}
 

         cone{ S1(1)-H1*y,(w+w2),S1(1),(w)}
         cone{ S1(1)-H1*y,(w+w2),S1(1)-(H1+H2)*y,(w+w2)}
         translate H1+H2*y
         }
  #end


object{bevel_spline(S1, 0.001, 0.00002, 0.075, 0.025, 0.05, 0.15) 
pigment{Red} finish { diffuse 1 ambient 0 } }


Post a reply to this message

From: Dave Blandston
Subject: Re: IRTC WIP
Date: 14 Apr 2010 08:10:01
Message: <web.4bc5b07bfef3d347cba3fb0f0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Note however that, technically speaking, working with assumed_gamma 2.2
> /is/ wrong already, so it's no surprise you need to mess up your
> settings to get the expected results.
>
> The officially /right/ way to address the washed-out appearance you see
> in 3.7 is to fix all the colors you use in your existing scenes: Raise
> all RGB color values (but not transmit or filter) to the power of 2.2
> and you should be quite ok with display_gamma=2.2 and file_gamma=2.2 in
> 3.7. Where that still doesn't match your expectations, you're actually
> expecting physically unrealistic results. (For that "X", for instance,
> you may need to reduce radiosity brightness to get what you expect.)

Thank you - I appreciate the advice. That's very helpful. I turned my video
card's gamma setting down from the default setting and POV pictures rendered
with the display_gamma=2.2 and file_gamma=2.2 settings look correct.

Regards,
Dave Blandston


Post a reply to this message

From: Alain
Subject: Re: IRTC WIP
Date: 14 Apr 2010 11:52:58
Message: <4bc5e4da$1@news.povray.org>

> Hi!
>
> I've been following the discussions on how to bevel te edges of text.
> Since I've been playing in my head with this kind of stuff for other
> purposes (but never got to actualy make the macro for real), this seemed
> to be a good moment to sit down and try the concept.
>
> As a reult, i now have a macro that makes a beveled shape, following a
> path defined by a spline. This way one could make letters (anyone has a
> libray of splines that are shaped like letters?).
>
> Thing to do: make the width of the shape variable using another spline.
> This is needed to make thicker sections of letters.
>
> Don't know if it's usefull, just wanted to share it.
>
> Attached is an image of an A (2 splines) and a Beta (1 ugly spline).
>
> Comments and questions are welcome as usual!
>
> JWV
>
>
>
> Tek schreef:
>> Some postcards from across the universe!
>>
>> Obviously I don't have enough images yet, so I've duplicated some, but
>> I thought people might be interested in what I'm working on :)
>>
>> BTW, I know this sounds like a newbie question but: has anyone got a
>> nice way to round or bevel the edges on those letters?
>>
>> For my purposes it would suffice to have a mesh of a nicely rounded
>> font, but ideally i'd like an all-pov solution which could handle
>> strings of text. The only option I can think of is to intersect
>> sheared version of the text object to get a bevel... in fact that
>> would work quite well! I'll do that if nobody has a better solution!
>>
>> Comments/criticism appreciated :)
>

For the thickness, you can have a 4D vector for your spline. Use the 
first 3 components as usual to define the path, and use the 4th one to 
define the thickness.

For the path, you have nothing special to do, the last component will be 
ignored.
Use Spline[x].t to extract the last component when you set the thickness.



Alain


Post a reply to this message

From: Stephen Klebs
Subject: Re: IRTC WIP
Date: 15 Apr 2010 07:05:01
Message: <web.4bc6f20cfef3d347fc413f510@news.povray.org>
Here is another way of rounding edges of fonts. The method isn't very innovative
or elegant but it's proven very versatile and useful and the results come out
okay, at least for simple objects like icons, which is mainly what I use it for.
It involves taking the outline of bezier curves -- exported from Illustrator or
CorelDRAW with a macro -- and using the curve as the path for the well-travelled
connect-the-dots, cones-and-spheres route. The sides are extruded with a
parallel, contour curve. The tricky part is telling the POV macro how to cut out
the holes. I'll post the set of macros when I get a chance.


Post a reply to this message


Attachments:
Download '9.3.png' (214 KB)

Preview of image '9.3.png'
9.3.png


 

From: clipka
Subject: Re: IRTC WIP
Date: 15 Apr 2010 07:56:49
Message: <4bc6ff01@news.povray.org>
Am 15.04.2010 13:01, schrieb Stephen Klebs:
> Here is another way of rounding edges of fonts. The method isn't very innovative
> or elegant but it's proven very versatile and useful and the results come out
> okay, at least for simple objects like icons, which is mainly what I use it for.
> It involves taking the outline of bezier curves -- exported from Illustrator or
> CorelDRAW with a macro -- and using the curve as the path for the well-travelled
> connect-the-dots, cones-and-spheres route. The sides are extruded with a
> parallel, contour curve. The tricky part is telling the POV macro how to cut out
> the holes. I'll post the set of macros when I get a chance.

The nagging thing about this all is that TrueType fonts /are/ based on 
spline curves...


Post a reply to this message

From: Tek
Subject: Re: IRTC WIP
Date: 16 Apr 2010 19:17:30
Message: <4bc8f00a$1@news.povray.org>
> Am 15.04.2010 13:01, schrieb Stephen Klebs:
>> Here is another way of rounding edges of fonts. The method isn't very 
>> innovative
>> or elegant but it's proven very versatile and useful and the results come 
>> out
>> okay, at least for simple objects like icons, which is mainly what I use 
>> it for.
>> It involves taking the outline of bezier curves -- exported from 
>> Illustrator or
>> CorelDRAW with a macro -- and using the curve as the path for the 
>> well-travelled
>> connect-the-dots, cones-and-spheres route. The sides are extruded with a
>> parallel, contour curve. The tricky part is telling the POV macro how to 
>> cut out
>> the holes. I'll post the set of macros when I get a chance.

Ooh that looks nice!

"clipka" <ano### [at] anonymousorg> wrote in message 
news:4bc6ff01@news.povray.org...
>
> The nagging thing about this all is that TrueType fonts /are/ based on 
> spline curves...

I had the same thought. Surely it wouldn't be hard to patch a text-to-spline 
function into pov's code?

Of course, I'm actually a programmer by day so I should really try it 
myself, but I just can't be bothered to do any coding outside work!

-- 
Tek
http://evilsuperbrain.com


Post a reply to this message

From: Tek
Subject: Re: IRTC WIP
Date: 16 Apr 2010 19:21:51
Message: <4bc8f10f$1@news.povray.org>
Well the main problem with that is the surface normal is never going to 
describe a slope, every ray hits either a vertical or horizontal surface. I 
specifically want a very small amount of rounding to add a little highlight 
to the edges of my letters. Basically to make them look like plastic fridge 
magnets.

I think the best way to improve it would be to shear the object so you get 
actual slopes, like my bevels, but then you could combine multiple shear 
angles to get a good curve approximation. Though even there you only have a 
finite number of angles not a smooth continuous surface.

Anyway, it doesn't really matter, I just want some nice fridge magnets. 
Letters are proving too complicated so I'll go with other shapes :)

-- 
Tek
http://evilsuperbrain.com

"Dave Blandston" <nomail@nomail> wrote in message 
news:web.4bc3b90cfef3d347cba3fb0f0@news.povray.org...
> "Tek" <tek### [at] evilsuperbraincom> wrote:
>> BTW, I know this sounds like a newbie question but: has anyone got a nice
>> way to round or bevel the edges on those letters?
>
> I don't think this is quite what you're looking for, but it does round the 
> edges
> of text. It would make a smoothly rounded edge if an infinite number of 
> objects
> were used. It can be adapted to make concave or other curved edges. It 
> distorts
> the outline of the letters, it's incredibly inefficient and can't 
> realistically
> make smoothly rounded edges. But I'm sharing it because maybe someone will 
> have
> an idea of how to improve it. I think that to do this right would require 
> adding
> support for rounding the edges of fonts to the POV-Ray code itself which 
> is far
> beyond my ability.
>
> This "X" consists of 361 copies of the "X" object and took almost two 
> hours to
> render using version 3.7 with four microprocessors and radiosity 
> recursion_limit
> 1. Each "layer" of the object is colored differently for demonstration 
> purposes.
>
> The source is posted in the text scene files group.
>
> Regards,
> Dave Blandston
>


Post a reply to this message

From: Stephen Klebs
Subject: Re: IRTC WIP
Date: 17 Apr 2010 14:05:01
Message: <web.4bc9f786fef3d347fc413f510@news.povray.org>
> Surely it wouldn't be hard to patch a text-to-spline
> function into pov's code?

That wouldn't be as simple as it sounds though. Different fonts - TrueType,
OpenType, Postscript, etc. - use different flavors of splines. It's always been
easier for me to just let a vector drawing program do the conversion to cubic
beziers, a beautifully efficient yet precise way of describing curves, and
export from there.  That way, too, you can use any curve not just fonts. What
would be more useful would be if POV could handle cubic beziers more directly in
a tubular shape like sphere sweeps, for example -- rather than having to
subdivide everything first into tiny linear splines and connect the dots. Never
had much luck with sphere_sweep, especially with transparent materials, because
it doesn't play nice with merge and seems to have too much tolerance for gaps.


Post a reply to this message

From: clipka
Subject: Re: IRTC WIP
Date: 17 Apr 2010 14:58:11
Message: <4bca04c3$1@news.povray.org>
Am 17.04.2010 20:01, schrieb Stephen Klebs:
>> Surely it wouldn't be hard to patch a text-to-spline
>> function into pov's code?
>
> That wouldn't be as simple as it sounds though. Different fonts - TrueType,
> OpenType, Postscript, etc. - use different flavors of splines.

Given that POV-Ray only supports TrueType fonts anyway, we'd be talking 
about a single spline type only.

While you do advocate Bezier splines (cubic I suppose), that's not 
necessarily a contradiction: TrueType uses quadratic B-splines, which 
can just as well be expressed in terms of cubic Bezier splines.

And speaking of it, PostScript happens to use cubic Bezier splines 
"natively", while OpenType comes in two flavors, which "concidentally" 
use the same underlying representation as TrueType and PostScript, 
respectively.

So I guess there's no reason why POV-Ray shouldn't grow some feature to 
automatically generate splines from fonts.

And yes, you're right: POV-Ray is definitely in lack of consistency 
regarding support of spline types:

- b_spline is only available in sphere_sweep
- quadratic_spline is available everywhere /except/ in sphere_sweep
- natural_spline is only available in spline

And last not least, allowing to use predefined splines in sphere_sweep, 
prism and lathe would be pretty neat I think (with sphere_sweep 
obviously neding either a 4D spline or an additional 1D-spline to 
represent radius).

What's really missing in POV-Ray is an internal framework for 
consolidating all the spline-based stuff.


Post a reply to this message

From: Nekar Xenos
Subject: Re: IRTC WIP
Date: 17 Apr 2010 16:29:16
Message: <op.vbbpuyngufxv4h@xena>
On Sat, 17 Apr 2010 20:58:09 +0200, clipka <ano### [at] anonymousorg> wrote:

> Am 17.04.2010 20:01, schrieb Stephen Klebs:
>>> Surely it wouldn't be hard to patch a text-to-spline
>>> function into pov's code?
>>
>> That wouldn't be as simple as it sounds though. Different fonts -  
>> TrueType,
>> OpenType, Postscript, etc. - use different flavors of splines.
>
> Given that POV-Ray only supports TrueType fonts anyway, we'd be talking  
> about a single spline type only.
>
> While you do advocate Bezier splines (cubic I suppose), that's not  
> necessarily a contradiction: TrueType uses quadratic B-splines, which  
> can just as well be expressed in terms of cubic Bezier splines.
>
> And speaking of it, PostScript happens to use cubic Bezier splines  
> "natively", while OpenType comes in two flavors, which "concidentally"  
> use the same underlying representation as TrueType and PostScript,  
> respectively.
>
> So I guess there's no reason why POV-Ray shouldn't grow some feature to  
> automatically generate splines from fonts.
>
> And yes, you're right: POV-Ray is definitely in lack of consistency  
> regarding support of spline types:
>
> - b_spline is only available in sphere_sweep
> - quadratic_spline is available everywhere /except/ in sphere_sweep
> - natural_spline is only available in spline
>
> And last not least, allowing to use predefined splines in sphere_sweep,  
> prism and lathe would be pretty neat I think (with sphere_sweep  
> obviously neding either a 4D spline or an additional 1D-spline to  
> represent radius).
>
> What's really missing in POV-Ray is an internal framework for  
> consolidating all the spline-based stuff.

I really think this should be considered for PovRay 4

-- 
-Nekar Xenos-

"The spoon is not real"


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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