POV-Ray : Newsgroups : povray.general : Fast way to subtract multiple spheres? Server Time
5 Nov 2024 16:38:55 EST (-0500)
  Fast way to subtract multiple spheres? (Message 1 to 7 of 7)  
From: Mike Raiford
Subject: Fast way to subtract multiple spheres?
Date: 12 Jan 2005 14:30:43
Message: <41e57ae3$1@news.povray.org>
Okay,

I have a box. I want to subtract hundreds of spheres from said box.

I have attempted 2 methods ...

1) CSG. Reasonable up to about 100, beyond 100, painful. Cand be 
somewhat mitigated by bounding the final object, but that particular 
object's render speed is unacceptably slow. And before you point me to 
it... yes, I am aware of the holes tutorial. The object is transparent 
and a merge does no better.

2) Isosurface. Quite simply, I'd recommend jumping off a building first. 
Hundreds of f_sphere calls and calls to min() to create the union of 
spheres is really too much to ask of POV-Ray. Render time is painful to 
excruciating.

One thought I haven't entertained is... is there a function that will 
give me random spherical areas w/o the high cost of a few thousand 
function calls per sample?

Feature Request for POV4: Fix bounding on CSG :) <Applies asbestos clothing>



-- 
~Mike


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Fast way to subtract multiple spheres?
Date: 12 Jan 2005 14:46:18
Message: <41e57e8a@news.povray.org>
"Mike Raiford" <mra### [at] hotmailcom> wrote in message
news:41e57ae3$1@news.povray.org...
> Okay,
>
> I have a box. I want to subtract hundreds of spheres from said box.
>
> I have attempted 2 methods ...
>
> 1) CSG. Reasonable up to about 100, beyond 100, painful. Cand be
> somewhat mitigated by bounding the final object, but that particular
> object's render speed is unacceptably slow. And before you point me to
> it... yes, I am aware of the holes tutorial. The object is transparent
> and a merge does no better.
>
> 2) Isosurface. Quite simply, I'd recommend jumping off a building first.
> Hundreds of f_sphere calls and calls to min() to create the union of
> spheres is really too much to ask of POV-Ray. Render time is painful to
> excruciating.
>
> One thought I haven't entertained is... is there a function that will
> give me random spherical areas w/o the high cost of a few thousand
> function calls per sample?

crackle-pattern with a form of <1,0,0> will give you something that looks more
or less like a bunch of randomly placed intersecting spheres.

cu!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)               // ZK http://www.povplace.be.tf


Post a reply to this message

From: Mike Raiford
Subject: Re: Fast way to subtract multiple spheres?
Date: 12 Jan 2005 16:06:34
Message: <41e5915a$1@news.povray.org>
Zeger Knaepen wrote:

> crackle-pattern with a form of <1,0,0> will give you something that looks more
> or less like a bunch of randomly placed intersecting spheres.

This works more or less, but is still a bit slow, though not as bad as 
the other methods.

Thanks!

-- 
~Mike


Post a reply to this message

From: Tim Nikias
Subject: Re: Fast way to subtract multiple spheres?
Date: 12 Jan 2005 16:30:33
Message: <41e596f9@news.povray.org>
IIRC, someone had experimented and found that using a blob to subtract
dozens of spheres is *way* faster than using single spheres, even if the
threshold et al is set so that you don't actually see the difference. Might
want to try that?

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Alain
Subject: Re: Fast way to subtract multiple spheres?
Date: 12 Jan 2005 17:17:11
Message: <41e5a1e7@news.povray.org>
Tim Nikias nous apporta ses lumieres en ce 2005-01-12 16:30:
> IIRC, someone had experimented and found that using a blob to subtract
> dozens of spheres is *way* faster than using single spheres, even if the
> threshold et al is set so that you don't actually see the difference. Might
> want to try that?
> 
Was about to suggest the same. Try with a thresshold of zero to get the full radius of
the 
components.

Alain


Post a reply to this message

From: Mike Williams
Subject: Re: Fast way to subtract multiple spheres?
Date: 13 Jan 2005 02:30:03
Message: <hMmAPEA+Mi5BFwTf@econym.demon.co.uk>
Wasn't it Mike Raiford who wrote:
>Okay,
>
>I have a box. I want to subtract hundreds of spheres from said box.
>
>I have attempted 2 methods ...
>
>1) CSG. Reasonable up to about 100, beyond 100, painful. Cand be 
>somewhat mitigated by bounding the final object, but that particular 
>object's render speed is unacceptably slow. And before you point me to 
>it... yes, I am aware of the holes tutorial. The object is transparent 
>and a merge does no better.
>
>2) Isosurface. Quite simply, I'd recommend jumping off a building first. 
>Hundreds of f_sphere calls and calls to min() to create the union of 
>spheres is really too much to ask of POV-Ray. Render time is painful to 
>excruciating.

I think you may have misunderstood the isosurface page of my holes
tutorial. The idea isn't to use hundreds of isosurface functions, but to
use one isosurface that evaluates to hundreds of spheres.

Since your object is transparent, I would have suggested that you should
have first tried part 3 of the holes tutorial: Transparent Holes.

If you've got as particular problem that *really* isn't covered with my
existing holes tutorial, I'd be interested in hearing more details about
what you're trying to do and seeing your current source code. 

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Mike Raiford
Subject: Re: Fast way to subtract multiple spheres?
Date: 13 Jan 2005 07:36:59
Message: <41e66b6b$1@news.povray.org>
Mike Williams wrote:
> Wasn't it Mike Raiford who wrote:
> 
>>Okay,
>>
>>I have a box. I want to subtract hundreds of spheres from said box.
>>
>>I have attempted 2 methods ...
>>
>>1) CSG. Reasonable up to about 100, beyond 100, painful. Cand be 
>>somewhat mitigated by bounding the final object, but that particular 
>>object's render speed is unacceptably slow. And before you point me to 
>>it... yes, I am aware of the holes tutorial. The object is transparent 
>>and a merge does no better.
>>
>>2) Isosurface. Quite simply, I'd recommend jumping off a building first. 
>>Hundreds of f_sphere calls and calls to min() to create the union of 
>>spheres is really too much to ask of POV-Ray. Render time is painful to 
>>excruciating.
> 
> 
> I think you may have misunderstood the isosurface page of my holes
> tutorial. The idea isn't to use hundreds of isosurface functions, but to
> use one isosurface that evaluates to hundreds of spheres.
> 
> Since your object is transparent, I would have suggested that you should
> have first tried part 3 of the holes tutorial: Transparent Holes.
> 
> If you've got as particular problem that *really* isn't covered with my
> existing holes tutorial, I'd be interested in hearing more details about
> what you're trying to do and seeing your current source code. 

Ahgh.. I never saw that part of the tutorial before... pure genius. :)

That was what I was trying to accomplish in a nutshell.



-- 
~Mike


Post a reply to this message

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