POV-Ray : Newsgroups : povray.binaries.images : Tovolume: Sam found ridiculously easy way to create shapes. Server Time
1 Nov 2024 08:13:23 EDT (-0400)
  Tovolume: Sam found ridiculously easy way to create shapes. (Message 1 to 10 of 10)  
From: William F Pokorny
Subject: Tovolume: Sam found ridiculously easy way to create shapes.
Date: 21 Oct 2013 09:55:52
Message: <52653268@news.povray.org>
Off work today and playing with Sam's Tovolume code when it hit me, what 
he has discovered is an incredibly easy way to create silhouette based 
isosurface shapes.

The blur.png file was drawn freehand in gimp with a solid brush after 
which a Gaussian blur was applied - the blur is what Sam's proximity 
pattern is doing in Tovolume. This single image is then used to create 
the isosurfaces with the following code:

//------------------- Cut here --------------------------
global_settings {
     assumed_gamma 1.00
     ambient_light srgb <1.00,1.00,1.00>
}
#declare Grey35 = srgbft <0.35,0.35,0.35,0.00,0.00>;
background { color Grey35 }
#declare Camera00 = camera {
     perspective
     location <2.00,2.00,-2.00>
     sky <0.00,1.00,0.00>
     angle 35.00
     right x*(image_width/image_height)
     look_at <0.00,0.00,0.00>
}
#declare White = srgbft <1.00,1.00,1.00,0.00,0.00>;
#declare Light00 = light_source { <50.00,50.00,5.00>, White }
#declare Red = srgbft <1.00,0.00,0.00,0.00,0.00>;
#declare CylinderX = cylinder {
     <-1.10,0.00,0.00>, <1.10,0.00,0.00>, 0.01
     pigment { color Red }
}
#declare Green = srgbft <0.00,1.00,0.00,0.00,0.00>;
#declare CylinderY = cylinder {
     <0.00,-1.10,0.00>, <0.00,1.10,0.00>, 0.01
     pigment { color Green }
}
#declare Blue = srgbft <0.00,0.00,1.00,0.00,0.00>;
#declare CylinderZ = cylinder {
     <0.00,0.00,-1.10>, <0.00,0.00,1.10>, 0.01
     pigment { color Blue }
}
#include "functions.inc"
#declare Fnct00 = function {
     pigment{image_map {"blur.png" gamma 1.0 once map_type 0 interpolate 
3 }}
}
#declare Fnct01 = function (x,y,z) { Fnct00(x,y,0).red-0.95 }
#declare Fnct02 = function (x,y,z) { Fnct01(f_r(x,0,z),y,f_th(x,0,z)) }
#declare Fnct03 = function (x,y,z) {
     // Fnct02(x,y,z)+(f_noise3d(x*29.0,y*29.0,z*29.0)*0.900)
        Fnct02(x,y,z)+(f_agate(x*9.0,y*9.0,z*9.0)*0.900)
     // Fnct02(x,y,z)+(f_bozo(x*29.0,y*29.0,z*29.0)*0.900)
     // Fnct02(x,y,z)+(f_ripples(x*29.0,y*29.0,z*29.0)*0.900)
     // Fnct02(x,y,z)+(f_wrinkles(x*29.0,y*29.0,z*29.0)*0.900)
     // Fnct02(x,y,z)+(f_crackle(x*29.0,y*29.0,z*29.0)*0.900)
     // Fnct02(x,y,z)+(f_granite(x*2.0,y*2.0,z*2.0)*0.900)
     // Fnct02(x,y,z)+(f_leopard(x*49.0,y*49.0,z*49.0)*0.900)
     // Fnct02(x,y,z)+(f_wood(x*49.0,z*49.0,y*49.0)*0.900)
}
#declare Magenta = srgbft <1.00,0.00,1.00,0.00,0.00>;
#declare Iso00 = isosurface {
     function { Fnct03(x,y,z) }
     contained_by { box { <-0.68,0.02,-0.68>,<0.68,0.98,0.68> } }
     threshold 0.00
     accuracy  0.001
     max_gradient 160.00
     max_trace 1
     pigment { color Magenta }
}

camera { Camera00 }
light_source { Light00 }
object { Iso00 }
object { CylinderX }
object { CylinderY }
object { CylinderZ }
//------------------- Cut here --------------------------

The three magenta vase show the shapes from the three internal functions 
above.

The solid silhouette and Gaussian blur technique can be replaced in 
gimp, photoshop with a blurred paintbrush. I been have fun just drawing 
whatever freehand and watching shapes appear...

Notes:
1) As in Sam's Tovolume code, the blur depth from white to black sets 
the limit for how much other functions can displace the surface.
2) The inverse blur image (white blurry lines on black) & base iso 
function didn't work because povray seems to be returning 1.0 for out of 
range values from the image_map.
3) The image_map interpolation with black on the png image edges causes 
noise on the opposite edge despite using "once". Shrink the contained_by 
range on that edge a little to avoid it. Sam did something similar in 
his code which had me puzzled until I saw the edge interpolation, wrap 
noise.

Have fun & thanks Sam for the image map with blurred image to isosurface 
find!
Bill P.


Post a reply to this message


Attachments:
Download 'blur.png' (38 KB) Download 'fnct03.jpg' (61 KB) Download 'fnct02.jpg' (49 KB) Download 'fnct01.jpg' (66 KB)

Preview of image 'blur.png'
blur.png

Preview of image 'fnct03.jpg'
fnct03.jpg

Preview of image 'fnct02.jpg'
fnct02.jpg

Preview of image 'fnct01.jpg'
fnct01.jpg


 

From: Paolo Gibellini
Subject: Re: Tovolume: Sam found ridiculously easy way to create shapes.
Date: 21 Oct 2013 11:24:28
Message: <5265472c@news.povray.org>
>William F Pokorny  on date 21/10/2013 15.55 wrote:
> Off work today and playing with Sam's Tovolume code when it hit me, what
> he has discovered is an incredibly easy way to create silhouette based
> isosurface shapes.
>
> The blur.png file was drawn freehand in gimp with a solid brush after
> which a Gaussian blur was applied - the blur is what Sam's proximity
> pattern is doing in Tovolume. This single image is then used to create
> the isosurfaces with the following code:
>

A very interesting application of Sam's code, full of paths to explore!
Paolo


Post a reply to this message

From: Doctor John
Subject: Re: Tovolume: Sam found ridiculously easy way to create shapes.
Date: 21 Oct 2013 11:53:16
Message: <52654dec$1@news.povray.org>
On 21/10/13 14:55, William F Pokorny wrote:
> Off work today and playing with Sam's Tovolume code when it hit me, what
> he has discovered is an incredibly easy way to create silhouette based
> isosurface shapes.

...which only goes to show how productive you can be when freed from the
constraints of making a living.
Excellent work, Bill

John
-- 
Protect the Earth
It was not given to you by your parents
You hold it in trust for your children


Post a reply to this message

From: William F Pokorny
Subject: Re: Tovolume: Sam found ridiculously easy way to create shapes.
Date: 21 Oct 2013 13:46:20
Message: <5265686c@news.povray.org>
On 10/21/2013 11:53 AM, Doctor John wrote:
> ...which only goes to show how productive you can be when freed from the
> constraints of making a living.
> Excellent work, Bill
>
> John
>
Indeed & thanks - though this trick is very much built on Sam's find.

Attached is a more artistic image using Sam's plane and two colored, 
adaptive area lights. Area lights, alas, with areas that are somewhat 
too small. In anycase an ugly vase it is. :-)

1hr 9 minutes on i7 920 overclocked to 3.4Ghz.

Bill P.


Post a reply to this message


Attachments:
Download 'uglyvase.jpg' (157 KB)

Preview of image 'uglyvase.jpg'
uglyvase.jpg


 

From: Thomas de Groot
Subject: Re: Tovolume: Sam found ridiculously easy way to create shapes.
Date: 22 Oct 2013 02:55:51
Message: <52662177$1@news.povray.org>
That's a very interesting application, full of potentials indeed. This 
vase clearly proves it. Well done.

[opens ToDo volume 2, page 134]

Thomas


Post a reply to this message

From: Alain
Subject: Re: Tovolume: Sam found ridiculously easy way to create shapes.
Date: 26 Oct 2013 20:09:51
Message: <526c59cf$1@news.povray.org>

> Off work today and playing with Sam's Tovolume code when it hit me, what
> he has discovered is an incredibly easy way to create silhouette based
> isosurface shapes.
>
> The blur.png file was drawn freehand in gimp with a solid brush after
> which a Gaussian blur was applied - the blur is what Sam's proximity
> pattern is doing in Tovolume. This single image is then used to create
> the isosurfaces with the following code:
>

> #declare Iso00 = isosurface {
>      function { Fnct03(x,y,z) }
>      contained_by { box { <-0.68,0.02,-0.68>,<0.68,0.98,0.68> } }
>      threshold 0.00
>      accuracy  0.001
>      max_gradient 160.00
>      max_trace 1
>      pigment { color Magenta }
> }


I have'nt tryed the third version, but I got very good renders, much 
faster after some little changes to your code.

First, max_gradient 160 if huge overkill.
Using max_gradient 1.5 resulted in a nice render without any message 
about max_gradient been to small or to large.
Next, I used:
#declare MinFact = 0.6;
evaluate 1.5*MinFact, sqrt(1/MinFact), 0.7
and got a slightly faster render.

Next, I reduced the contained_by object as follow:
box {<-0.34,0.02,-0.34><0.34,0.908,0.34> }

It's now much tighter and large enough to contain the whole isosurface. 
This got me another performance increase.



Alain


Post a reply to this message

From: William F Pokorny
Subject: Re: Tovolume: Sam found ridiculously easy way to create shapes.
Date: 27 Oct 2013 10:15:53
Message: <526d2019$1@news.povray.org>
On 10/26/2013 08:10 PM, Alain wrote:
>
> I have'nt tryed the third version, but I got very good renders, much
> faster after some little changes to your code.
>
> First, max_gradient 160 if huge overkill.
> Using max_gradient 1.5 resulted in a nice render without any message
> about max_gradient been to small or to large.
> Next, I used:
> #declare MinFact = 0.6;
> evaluate 1.5*MinFact, sqrt(1/MinFact), 0.7
> and got a slightly faster render.
>
> Next, I reduced the contained_by object as follow:
> box {<-0.34,0.02,-0.34><0.34,0.908,0.34> }
>
> It's now much tighter and large enough to contain the whole isosurface.
> This got me another performance increase.
>
> Alain

Yes, good suggestions. I didn't tighten up my scribble and render set up 
before posting and I've never gotten my head to understand the evaluate 
option of isosurfaces.

Your post reminded me of one note I forgot to mention. On reading the 
image file, it is possible to play with the gamma option - even outside 
the range of common gamma values. You can get interesting scalloping 
effects. Especially true where the image is used for flat surface 
displacements.

Bill P.


Post a reply to this message

From: Alain
Subject: Re: Tovolume: Sam found ridiculously easy way to create shapes.
Date: 27 Oct 2013 17:50:46
Message: <526d8ab6$1@news.povray.org>

> On 10/26/2013 08:10 PM, Alain wrote:
>>
>> I have'nt tryed the third version, but I got very good renders, much
>> faster after some little changes to your code.
>>
>> First, max_gradient 160 if huge overkill.
>> Using max_gradient 1.5 resulted in a nice render without any message
>> about max_gradient been to small or to large.
>> Next, I used:
>> #declare MinFact = 0.6;
>> evaluate 1.5*MinFact, sqrt(1/MinFact), 0.7
>> and got a slightly faster render.
>>
>> Next, I reduced the contained_by object as follow:
>> box {<-0.34,0.02,-0.34><0.34,0.908,0.34> }
>>
>> It's now much tighter and large enough to contain the whole isosurface.
>> This got me another performance increase.
>>
>> Alain
>
> Yes, good suggestions. I didn't tighten up my scribble and render set up
> before posting and I've never gotten my head to understand the evaluate
> option of isosurfaces.

Relatively simple:
You first do a render using the default max_gratient value and get the 
reported max_gradient in the message.
Next, you just plug that value in the first parameter. The two others 
are normaly correct using sqrt(1/MinFact) and 0.7 with MinFact set to 
the proposed value of 0.6.

This information on how to use the feature was prety obscure in the 
documentation for version 3.6, it now much clearer in version 3.7.

The main advantage is that it allow faster renderings.
You don't need to understand it to use it.

>
> Your post reminded me of one note I forgot to mention. On reading the
> image file, it is possible to play with the gamma option - even outside
> the range of common gamma values. You can get interesting scalloping
> effects. Especially true where the image is used for flat surface
> displacements.
>
> Bill P.

Isosurface tip: Always make the containing shape as tight as possible.



Alain


Post a reply to this message

From: Bald Eagle
Subject: Re: Tovolume: Sam found ridiculously easy way to create shapes.
Date: 27 Aug 2014 16:55:01
Message: <web.53fe45105ac41c3b5e7df57c0@news.povray.org>
I'm playing with this set of files, the problem is that when I get to the
Slice.pov step, it's not creating any files that I can see.

I started off with the initial command line parameters:

+fng -f +a0.3 +am2 +r2 +w81 +h68 +kff32

and then added:

+fng -f +a0.3 +am2 +r2 +w81 +h68 +kf1 +kff32 Output_File_Name=Slice.png

But sadly, that did not seem to work.


Post a reply to this message

From: Bald Eagle
Subject: Re: Tovolume: Sam found ridiculously easy way to create shapes.
Date: 27 Aug 2014 17:15:00
Message: <web.53fe4a4e5ac41c3b5e7df57c0@news.povray.org>
> I started off with the initial command line parameters:
>
> +fng -f +a0.3 +am2 +r2 +w81 +h68 +kff32


Sorry - it was an RTFM thing.  I guess I should have started F1'ing the command
line options from the beginning, not the end.  :\

Also needed to redefine size to
#declare Size = <81, 68, 32>;
in IsoRender to have it work with the 'default' output files.

This is wicked cool.  :)


Post a reply to this message

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