POV-Ray : Newsgroups : povray.advanced-users : How do I convert this isosurface into a CSG object : Re: How do I convert this isosurface into a CSG object Server Time
5 Jul 2024 15:01:24 EDT (-0400)
  Re: How do I convert this isosurface into a CSG object  
From: Mike Williams
Date: 31 Mar 2008 15:10:51
Message: <7XNlXXBBNU8HFwgT@econym.demon.co.uk>
Wasn't it Bridgeofstraws who wrote:
>Hey,
>
>I have this function in my isosurface object:
>function{(1+front_smoothness) - pow(front_smoothness, f_Sphere(7/4*x, 
>2*(y+0.9),
>1/(8/2)*(z+8))) - pow(front_smoothness, f_Sphere(12/4*x, 4.55*(y-0.17),
>10/12*(z+8.7))) - pow(front_smoothness, f_Sphere(12/4*x, 10*(y+0.5),
>6/4*(z+7.8))) }
>(a set of spheres that are smoothly unioned together)
>
>where f_Sphere = function{ sqrt(pow(x,2) + pow(y,2) + pow(z,2)) - 2.8 }
>(just a sphere with radius 2.8)
>
>I was just wondering how I might convert this isosurface to a union of spheres.
>I understand how to to apply the scaling and translations of the isosurface I
>just don't seem to be able to perform the same transformation as the pow
>function.
>
>This is my not working attempt at the CSG...
>     object{Sphere
>          scale x*4/7 scale y*1/2 scale z*8/2
>          translate x*-0 translate y*-0.9 translate z*-8
>     }
>     object{Sphere
>          scale x*4/12 scale y*1/4.55 scale z*12/10
>          translate x*-0 translate y*0.17 translate z*-8.7
>     }
>     object{Sphere
>          scale x*4/12 scale y*1/10 scale z*4/6
>          translate x*-0 translate y*-0.5 translate z*-7.8
>     }
>
>Thank you for help!

That's correct, as long as you've remembered the 2.8 when you #declared 
your Sphere object:

#declare Sphere = sphere{0,2.8}

The isosurface approaches that CSG as front_smoothness approaches zero, 
but as front_smoothness approaches zero, the required max_gradient 
approaches infinity.

With front_smoothness=0.001 and max_gradient 30 they look pretty 
similar.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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