POV-Ray : Newsgroups : povray.advanced-users : Turning squares into a smooth isosurface Server Time
1 Nov 2024 05:19:57 EDT (-0400)
  Turning squares into a smooth isosurface (Message 1 to 10 of 22)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Greg M  Johnson
Subject: Turning squares into a smooth isosurface
Date: 8 Apr 2003 09:41:47
Message: <3e92d19b@news.povray.org>
Suppose you have a bitmap which comprises white rectangles on a black
backround. In a paint editor, one may do a blur operation and then use the
resulting bitmap in povray as a heightfield.

I'm looking for a more sophisticated and automatic analogue to this
approach,  perhaps starting with prisms,  DXF files,  boxes, or the like.
What operations like this are available as an isosurface??


Post a reply to this message

From: Warp
Subject: Re: Turning squares into a smooth isosurface
Date: 8 Apr 2003 10:07:32
Message: <3e92d7a3@news.povray.org>
Greg M. Johnson <gregj:-)565### [at] aolcom> wrote:
> I'm looking for a more sophisticated and automatic analogue to this
> approach,  perhaps starting with prisms,  DXF files,  boxes, or the like.
> What operations like this are available as an isosurface??

  One idea comes to my mind:

  You probably know the HF_Square() macro and how you can create a mesh
(which looks like a heightfield) with it using an image (ie. you make
a pigment function with the image and then a function which takes the .gray
value of this pigment function and give it to HF_Square()).

  My idea: Instead of making a function which takes the .gray value of
the pigment function, make this function to take several .gray values
from the pigment function and average them together (perhaps with a weight
value if you want).
  That is, when you normally would do this:

#declare ImageGray = function { Image(x,y,z).gray }

you would do for example this:

#declare ImageGray =
  function
  {  .16 * Image(x,y,z).gray +

     .13 * Image(x+Offsx,y,z).gray +
     .13 * Image(x-Offsx,y,z).gray +
     .13 * Image(x,y+Offsy,z).gray +
     .13 * Image(x,y-Offsy,z).gray +

     .08 * Image(x+Offsx,y+Offsy,z).gray +
     .08 * Image(x-Offsx,y+Offsy,z).gray +
     .08 * Image(x+Offsx,y-Offsy,z).gray +
     .08 * Image(x-Offsx,y-Offsy,z).gray
  }

  Then you give ImageGray to HF_Square() to generate the mesh.

  Note that the sum of all the factors should always be 1.

  The 'Offsx' and 'Offsy' values above are offset values which depend on the
resolution of the image. They could get the adjacent pixel of the image, but
they can perfectly go further, which probably smoothens the image more.
  And of course you can add even more "samples" to the function in order
to get a smoother result from a larger area (eg using "Offsx*2" etc).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: ABX
Subject: Re: Turning squares into a smooth isosurface
Date: 8 Apr 2003 10:14:00
Message: <e4m59voqjep5o5h06ojj5qabte823uoduv@4ax.com>
On 8 Apr 2003 10:07:32 -0400, Warp <war### [at] tagpovrayorg> wrote:
> My idea: Instead of making a function which takes the .gray value of
> the pigment function, make this function to take several .gray values
> from the pigment function and average them together (perhaps with a weight
> value if you want).

tests of my proxity/blur pattern: http://news.povray.org/search/?s=proximity

ABX


Post a reply to this message

From: Christopher James Huff
Subject: Re: Turning squares into a smooth isosurface
Date: 8 Apr 2003 11:41:51
Message: <cjameshuff-324DEE.11411308042003@netplex.aussie.org>
In article <e4m59voqjep5o5h06ojj5qabte823uoduv@4ax.com>,
 ABX <abx### [at] abxartpl> wrote:

> tests of my proxity/blur pattern: http://news.povray.org/search/?s=proximity

I kind of wish you would stop calling it that, it has little to do with 
proximity and only resembles the proximity pattern. Just "blur" is more 
precise.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: ABX
Subject: Re: Turning squares into a smooth isosurface
Date: 8 Apr 2003 11:57:47
Message: <8hr59voc6g4am2j1uhcmlti3nffc80pcj1@4ax.com>
On Tue, 08 Apr 2003 11:41:14 -0400, Christopher James Huff
<cja### [at] earthlinknet> wrote:
> In article <e4m59voqjep5o5h06ojj5qabte823uoduv@4ax.com>,
> ABX <abx### [at] abxartpl> wrote:
>
> > tests of my proxity/blur pattern: http://news.povray.org/search/?s=proximity
>
> I kind of wish you would stop calling it that, it has little to do with 
> proximity and only resembles the proximity pattern. Just "blur" is more 
> precise.

Sadly I'm not language expert but I looked into my dictionary and I think used
algorithm fits in both. Sorry if it bother you but
http://news.povray.org/search/?s=blur does not return as precise answer as I
wanted express.

ABX


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Turning squares into a smooth isosurface
Date: 8 Apr 2003 12:02:43
Message: <3e92f2a3$1@news.povray.org>
Thanks to Warp: I'll try this as soon as I digest it.

ABX:  Could you please post an example of what it would do with, say,  an
Arial Black  uppercase "T"?  Thanks.  I'm looking for more rounding than the
example you showed, but perhaps it's a function of the starting shape.


"ABX" <abx### [at] abxartpl> wrote in message
news:e4m59voqjep5o5h06ojj5qabte823uoduv@4ax.com...
> On 8 Apr 2003 10:07:32 -0400, Warp <war### [at] tagpovrayorg> wrote:
> > My idea: Instead of making a function which takes the .gray value of
> > the pigment function, make this function to take several .gray values
> > from the pigment function and average them together (perhaps with a
weight
> > value if you want).
>
> tests of my proxity/blur pattern:
http://news.povray.org/search/?s=proximity
>
> ABX


Post a reply to this message

From: ABX
Subject: Re: Turning squares into a smooth isosurface
Date: 8 Apr 2003 12:07:27
Message: <los59vs9ml014990ptq5j85s862mvb2o9v@4ax.com>
On Tue, 8 Apr 2003 12:01:54 -0400, "Greg M. Johnson" <gregj:-)565### [at] aolcom>
wrote:
> ABX:  Could you please post an example of what it would do with, say,  an
> Arial Black  uppercase "T"?  Thanks.  I'm looking for more rounding than the
> example you showed, but perhaps it's a function of the starting shape.

http://news.povray.org/upf76ugdq6dlluklhiib1umos8qsk8k7hc%404ax.com

ABX


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Turning squares into a smooth isosurface
Date: 8 Apr 2003 12:24:34
Message: <3e92f7c2$1@news.povray.org>
Fascinating.

Right now the code says, "if any sample is close, return 1".

How could one change it to "the average of all the samples I collected" ?


"ABX" <abx### [at] abxartpl> wrote in message
news:los59vs9ml014990ptq5j85s862mvb2o9v@4ax.com...
>
> http://news.povray.org/upf76ugdq6dlluklhiib1umos8qsk8k7hc%404ax.com
>
> ABX


Post a reply to this message

From: ABX
Subject: Re: Turning squares into a smooth isosurface
Date: 8 Apr 2003 12:42:11
Message: <equ59vkh11c4tdc66qko6ikpcl34vc7j2j@4ax.com>
On Tue, 8 Apr 2003 12:23:45 -0400, "Greg M. Johnson" <gregj:-)565### [at] aolcom>
wrote:

> Right now the code says, "if any sample is close, return 1".
> How could one change it to "the average of all the samples I collected" ?

I'm affraid I do not understand the question or you do not understand code.

ABX


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Turning squares into a smooth isosurface
Date: 8 Apr 2003 13:16:31
Message: <3e9303ef@news.povray.org>
Got it.  I changed the final line of your macro to:
function{ Proximity(x,y,z)}


I not only wanted rounding in the "armpits" of the T but also rounding off
of the extremities.  The version posted in your link had *both* the points
closeby and the entirety of the object itself.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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