POV-Ray : Newsgroups : povray.advanced-users : How do I convert this isosurface into a CSG object Server Time
3 Jul 2024 05:48:31 EDT (-0400)
  How do I convert this isosurface into a CSG object (Message 1 to 6 of 6)  
From: Bridgeofstraws
Subject: How do I convert this isosurface into a CSG object
Date: 31 Mar 2008 13:20:00
Message: <web.47f12af3dbdbd323d67c2c340@news.povray.org>
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!


Post a reply to this message

From: Mike Williams
Subject: Re: How do I convert this isosurface into a CSG object
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

From: Bridgeofstraws
Subject: Re: How do I convert this isosurface into a CSG object
Date: 31 Mar 2008 21:30:01
Message: <web.47f19d0a1674250b21397d5a0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
>
> 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

I forgot to add #declare Sphere = sphere{0,2.8}, but you guessed it correctly
anyways.

You've helped me to understand a bit mroe about how the pow function works and I
really want to thank you for that.  I have another question though...
I unfortunately have front_smoothness set to 0.5, which makes the resulting
isosurface much different, so is there anyway I might be able to account for
this besides changing front_smoothness too much?

I could probably reduce the smoothness to 0.1 but if I go any further I loose
the smooth look I want (but I'd do this only as second last resort, the last
being, redoing my isosurface).

Thank you for your help.


Post a reply to this message

From: Mike Williams
Subject: Re: How do I convert this isosurface into a CSG object
Date: 1 Apr 2008 01:12:50
Message: <cew8FgD1Hd8HFw1Y@econym.demon.co.uk>
Wasn't it Bridgeofstraws who wrote:
>
>I forgot to add #declare Sphere = sphere{0,2.8}, but you guessed it correctly
>anyways.
>
>You've helped me to understand a bit mroe about how the pow function 
>works and I
>really want to thank you for that.  I have another question though...
>I unfortunately have front_smoothness set to 0.5, which makes the resulting
>isosurface much different, so is there anyway I might be able to account for
>this besides changing front_smoothness too much?
>
>I could probably reduce the smoothness to 0.1 but if I go any further I loose
>the smooth look I want (but I'd do this only as second last resort, the last
>being, redoing my isosurface).

If you're looking for a shape that consists of scaled spheres smoothly 
blobbed together, then you're not going to achieve that by placing three 
spheres next to each other. And you can't do it with the blob primitive 
if your spheres are scaled differently.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Christian Froeschlin
Subject: Re: How do I convert this isosurface into a CSG object
Date: 1 Apr 2008 04:21:50
Message: <47f1feae$1@news.povray.org>
Mike Williams wrote:

> If you're looking for a shape that consists of scaled spheres smoothly 
> blobbed together, then you're not going to achieve that by placing three 
> spheres next to each other. And you can't do it with the blob primitive 
> if your spheres are scaled differently.

Actually, transformations are allowed as blob component modifiers.
This includes "scale".


Post a reply to this message

From: Tim Attwood
Subject: Re: How do I convert this isosurface into a CSG object
Date: 1 Apr 2008 23:28:11
Message: <47f30b5b$1@news.povray.org>
"Christian Froeschlin" <chr### [at] chrfrde> wrote in message 
news:47f1feae$1@news.povray.org...
> Mike Williams wrote:
>
>> If you're looking for a shape that consists of scaled spheres smoothly 
>> blobbed together, then you're not going to achieve that by placing three 
>> spheres next to each other. And you can't do it with the blob primitive 
>> if your spheres are scaled differently.
>
> Actually, transformations are allowed as blob component modifiers.
> This includes "scale".

The spheres in the isosurface are smoothed with a function that
distorts the component spheres, it isn't a simple blob-like function.
It results in pointy ends, more pointy than just scaled spheres.


Post a reply to this message

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