POV-Ray : Newsgroups : povray.binaries.images : Fill any object with dense-packed spheres of any radius (16kbbu) : Re: Fill any object with dense-packed spheres of any radius (16kbbu) Server Time
19 Aug 2024 06:24:21 EDT (-0400)
  Re: Fill any object with dense-packed spheres of any radius (16kbbu)  
From: Chris Huff
Date: 31 Dec 2000 11:20:55
Message: <chrishuff-CF1915.11222031122000@news.povray.org>
In article <3a4f3e21@news.povray.org>, "Greg M. Johnson" 
<"gregj;-)56590\""@aol.c;-)om> wrote:

> Here is the core of my algo:
> 
>    #declare obfun=pigment {object {MyObject color Black color White}}
>     #local blank=eval_pigment(obfun,place);

Hmm, I use something more like "eval_pattern(object {MyObject})" when I 
do this...actually, I wrap it in a macro.
This would make your code shorter and probably slightly reduce parse 
time(though the use of a macro might counteract that benefit), the main 
advantage is that it is shorter and easier to read.
Instead of:
   #declare obfun=pigment {object {MyObject color Black color White}}
...
    #local blank=eval_pigment(obfun,place);
    #if (blank.x>0)

My version would be:
#macro InObj(Pt, Obj) eval_pattern(object {Obj}, Pt) #end
...
    #if(InObj(place, MyObject))

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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