POV-Ray : Newsgroups : povray.general : Bent text? Server Time
6 Aug 2024 21:41:31 EDT (-0400)
  Bent text? (Message 13 to 22 of 22)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Peter Popov
Subject: Re: Bent text?
Date: 14 Feb 2002 15:44:23
Message: <pugn6uo5qscbokvkaua1e76o25fj0mb19u@4ax.com>
On Thu, 14 Feb 2002 15:14:43 +0200, "Hershel Robinson"
<her### [at] yahoocom> wrote:

>I would like to model a column with words engraved or carved into or out of
>(i.e. protruding from) the column.  I don't know how to create 3D letters
>which are curved to match the column, however.

Type your text in a paint program or render it white-on-black in POV,
then use the resulting image to displace an isosurface. Some blurring
on the image would help as it would decrease the gradient of the
isosurface and will reduce render times. It will probably look better,
too.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From:
Subject: Re: Bent text?
Date: 15 Feb 2002 09:35:07
Message: <tp6q6u46ci53cskl4huds0cff0bkomtdf3@4ax.com>

wrote:
> 1. split text into letters
> 2. measure width of each letter

Thinking more about above two operations I found that it's not a trivial task
when kerning is considered. I have posted my solution at:
http://news.povray.org/sa6q6u8ic6tt2ntql1kt4mm2fiebtf1pih%404ax.com

ABX


Post a reply to this message

From:
Subject: Extended object pattern (was Re: Bent text?)
Date: 15 Feb 2002 12:21:53
Message: <o1fq6uk3k4bmuu1kqeqd0mmpgu976nlg45@4ax.com>
On Thu, 14 Feb 2002 15:18:11 +0100, Christoph Hormann <chr### [at] gmxde>
wrote:
> object pattern & isosurface are not a very
> good combination.

Well, I have an idea around this problem. In the truth it's even feature
request. What about changing definition of Inside method of objects ?
I mean if it could return not only yes/no to describe object but variable
float value to describe distance (not in units) to surface just like
isosurface does. So positive value means outside, zero means surface, negative
means inside.

In particular:
- for plane it returns linear distance to plane
- for sphere it returns distance to center minus radius
- for cylinders, cones, linear lathes, linear prisms, boxes, disc, separated
triangles, polygons, heighfields, torus etc. it returns obvious combination of
plane and sphere method listed above
- for csg it returns min/max of insides of components (just like method used
in isosurfaces)
- for isosurface and blob it returns value of function modified with threshold
- meshes and other patches has no inside now so no problem with them

I suppose it could be probably possible also for rest of object like: julia,
curved lathe, prism, sor, and sphere_sweep, superellipsoid, ttf, quadrics,
polys etc. They are available with formulas so probably calculation of value
could be possible.

I want to highlight that I don't mean linear distance. I mean value of math
formula used to build shape.

It should allow then recreation of object via object pattern with isosurface
and easy displace of surface of complex CSGs, bending, twisting perhaps even
beveling etc. It could be probably either blur  and proximity pattern :-)

What do you think?

ABX


Post a reply to this message

From: Warp
Subject: Re: Extended object pattern (was Re: Bent text?)
Date: 15 Feb 2002 12:30:02
Message: <3c6d459a@news.povray.org>

: Well, I have an idea around this problem. In the truth it's even feature
: request. What about changing definition of Inside method of objects ?
: I mean if it could return not only yes/no to describe object but variable
: float value to describe distance (not in units) to surface just like
: isosurface does.

  I suggested this some time ago (a year or two perhaps). It would make
the proximity pattern much faster.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From:
Subject: Re: Extended object pattern (was Re: Bent text?)
Date: 15 Feb 2002 12:30:49
Message: <b7hq6u4kcf9lrumg1v76q1apstgtprb4u1@4ax.com>

wrote:
> - meshes and other patches has no inside now so no problem with them

I wonder if it could be possible even for patches but returns not negative
values (becouse of no inside). Then with small treshold it could be possible
to rebuild mesh with isosurface and displace its surface.

Also this whole solution makes my old deform patch unnecessary.

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: Extended object pattern (was Re: Bent text?)
Date: 15 Feb 2002 13:00:50
Message: <3C6D4CD0.625A64E8@gmx.de>

> 
> Well, I have an idea around this problem. In the truth it's even feature
> request. What about changing definition of Inside method of objects ?
> I mean if it could return not only yes/no to describe object but variable
> float value to describe distance (not in units) to surface just like
> isosurface does. So positive value means outside, zero means surface, negative
> means inside.
> 

This would be nice, but for shapes like text a combination of lots of
different functions would be necessary, therefore it would be quite slow,
even though having this internally instead of in user defined functions
would probably be faster.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 06 Feb. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Mike Williams
Subject: Re: Bent text?
Date: 15 Feb 2002 13:02:32
Message: <fPHg8AA4jUb8Ewzs@econym.demon.co.uk>

>On Thu, 14 Feb 2002 15:14:43 +0200, "Hershel Robinson" <her### [at] yahoocom>
>wrote:
>> I would like to model a column with words engraved or carved into or out of
>> (i.e. protruding from) the column.  I don't know how to create 3D letters
>> which are curved to match the column, however.
>>
>> The hard way would be to use Chris Colefax's Bend include file.  Hard in
>> terms of render time--I have more than one column with unique text.  I would
>> like to ask if anyone knows of an easier way to accomplish this.
>
>If you want bend text but each letter can stay as is then you can use this
>method:
>
>1. split text into letters
>2. measure width of each letter
>3. create spline along  column
>4. walk along spline and measure distance to its origin
>5. put every next letter when the measured distance = width of previous letter
>
>note: remember to reorient letter according to current dirrection of spline
>
>something similiar was done in circle_text macro in 3.5

It's quite easy to grab a copy of circle_text and just flip the letters
the right way out. If you want the individual letters to actually have
bent surfaces, then invoke the Cylinder_Text macro with a slightly
larger Radius value, and then trim it by intersecting with a cylinder of
the required radius.


#include "shapes.inc"
/* Cylinder_Text( Font, Text, Size, Spacing, Thickness, Radius,
Inverted, Justification, Angle )
Creates a text object with the bottom (or top) of the character cells
aligned with all or part of a circle.  This macro should be used inside
an object{...} block.

      Font: The font to use (see the documentation for the text object)
      Text: The text string to be created
      Size: The height of the text string, as you would use to scale a 
            standard text object
      Spacing: The amount of space to add between the letters.
      Thickness: The thickness of the letters (see the documentation for 
                 the text object)
      Radius: The radius of the cylinder along which the letters are     
              aligned
      Inverted: If this parameter is nonzero, the tops of the letters 
                will point downwards (not really much point doing that, 
                I just copied it from Circle_text)
      Justification: One of the constants Align_Left, Align_Right, or 
                     Align_Center
        Angle: The point on the circle from which rendering will begin.  
               The +x direction is 0 and the -z direction is 90  */

#macro Cylinder_Text(F, T, S, Sp, Th, R, I, J, A)
   #local FW = Text_Width(F, T, S, Sp);
   #local TO = text {ttf F T 1 0 scale<S, S, 1>}
   #local TH = max_extent(TO).y;
   #local C = array[strlen(T)]
   #if(FW > 2*pi*R)
      #error concat("\n\n**** Text string \"", T, 
         "\" is too long for a circle of the specified radius.\n\n\n")
   #end
   #local AW = -FW*180/pi/R;
   #local SA = A;
   #local EA = A + AW;
   #if(((J = Align_Right) & !I)|((J = Align_Left) & I))
      #local SA = A - AW;
      #local EA = A;
   #else
      #if(J = Align_Center)
         #local SA = A - AW/2;
         #local EA = A + AW/2;
      #end
   #end
   
   #local CI = 1;
   #while(CI <= strlen(T))
      #local OE = Text_Width(F, substr(T,CI,1), S, Sp);
      #local LW = Text_Width(F, substr(T,1,CI), S, Sp) - OE;
      #local LA = SA + AW*LW/FW + OE/2/FW*AW;
      #if(I)
         #local LA = EA - (LA - SA);
      #end
      #local TO = text {ttf F substr(T, CI, 1) Th 0 scale<S,S,1>}
      #if(I)
         #local C[CI-1] =
         object {TO
            rotate 180*z
            translate <OE/2, TH, 0>
            rotate -90*y
            translate R*x
            rotate LA*y
         }
      #else
         #local C[CI-1] =
         object {TO
            translate -OE/2*x
            rotate -90*y
            translate R*x
            rotate LA*y
         }
      #end
      #local CI = CI + 1;
   #end
   
   //Create the final object, a union of individual text object letters.
   union {
      #local CI=0;
      #while(CI < strlen(T))
         object {C[CI]}
         #local CI = CI + 1;
      #end
   }
#end


// End of macro - start of example code

camera { location  <0, 1, -4> look_at <0, 0, 0>}
light_source {<0,200,-100> colour rgb 1}

#declare Radius = 2;
object {
  //intersection {
    Cylinder_Text("arial.ttf", "This is a test", 1, -0.1, 1, Radius, 0, 
                 Align_Left, 150)
    //cylinder {-y,y,Radius}
  //}
  pigment {rgb 1}
}

cylinder {-y,1.5*y,Radius-0.05 pigment {rgb 1}}


Post a reply to this message

From:
Subject: Re: Extended object pattern (was Re: Bent text?)
Date: 15 Feb 2002 13:07:01
Message: <vejq6u0nflvvto7i54gen5t8nmpie0hv7f@4ax.com>
On Fri, 15 Feb 2002 19:00:48 +0100, Christoph Hormann <chr### [at] gmxde>
wrote:
> This would be nice, but for shapes like text a combination of lots of
> different functions would be necessary, therefore it would be quite slow,

Not a problem. We are years before 4.0 so faster machines we use to test it.
;-)

ABX


Post a reply to this message

From: Christopher James Huff
Subject: Re: Extended object pattern (was Re: Bent text?)
Date: 15 Feb 2002 13:14:59
Message: <chrishuff-AB1A7F.13144615022002@netplex.aussie.org>
In article <o1fq6uk3k4bmuu1kqeqd0mmpgu976nlg45@4ax.com>,
 W?odzimierz ABX Skiba <abx### [at] babilonorg> wrote:

> Well, I have an idea around this problem. In the truth it's even feature
> request. What about changing definition of Inside method of objects ?
> I mean if it could return not only yes/no to describe object but variable
> float value to describe distance (not in units) to surface just like
> isosurface does. So positive value means outside, zero means surface, negative
> means inside.

This is what I've been doing for the updated proximity pattern/glow 
patch. (which is on hold until POV 3.5 is complete)
However, it would be a very bad idea to replace the Inside() method with 
this, as it would often take much longer to compute proximity than to 
figure out inside/outsideness...I just added a new proximity method. 
(two actually...one for proximity of a point, another for proximity of a 
ray)

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From:
Subject: Re: Extended object pattern (was Re: Bent text?)
Date: 15 Feb 2002 13:36:49
Message: <2kkq6uoua65cd3sekqslkrbuiql7gvmile@4ax.com>
On Fri, 15 Feb 2002 13:14:46 -0500, Christopher James Huff <chr### [at] maccom>
wrote:
> However, it would be a very bad idea to replace the Inside() method with 
> this, as it would often take much longer to compute proximity than to 
> figure out inside/outsideness...

But I imagine yes/no inside is calculated with real flot and then "booleaned"
with condition. Look at Inside_Plane, Inside_Sphere. Also Inside_Glyph look
complicated enough to think it somehow calculates distance :-)
But of course you can be right. I don't know internal behaviour of all
Inside() methods.

ABX


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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