POV-Ray : Newsgroups : povray.binaries.images : universal filler : Re: universal filler Server Time
15 Aug 2024 22:20:43 EDT (-0400)
  Re: universal filler  
From:
Date: 22 Apr 2002 11:18:46
Message: <9898cus8vi97a6d3ibj70bm9a26516t52f@4ax.com>
On Mon, 22 Apr 2002 09:55:00 -0500, "Shay" <sah### [at] simcopartscom> wrote:
> Are the tori considered bound by a cylinder, or is it possible that other
> object may pass through them.

May pass. Only volume is considered.

> I think that this macro should have switches
> to limit the variety of objects and to therefore limit the number of
> calculations necessary to test for intersections.

No need for switches. When previous element is placed then next element is
requested by call of Filler_Element macro. User have to write this macro so he
can control. It have to create next object for place and additional can
specify additional region when element shoud appear for sure. For example I
can fill glass in 75% from bottom with white spheres and top 75% with black
spheres so in middle 50% they are mixed. Only necessary number of objects are
created.

main engine is called with:

#macro Filler( Initial_Space , Accuracy , Seed , Placed_Limit , Removed_Limit)

  Initial_Space - object/container to fill
  Accuracy - Largest deep which can intersect
  Seed - 0 for regular placing should be performed
                initialized random generator for random placing 
  Placed_Limit - how many objects should be placed
  Removed_Limit - how many objects can be placed in "trash" before
               "not enogh space for placing" message

Filler() macro calls Filler_Element() macro (by user) which in case of my
example looks like

#local Elements = array[5]
#local Elements[0] = sphere{ 0 1 }
#local Elements[1] = box{ -1 1 }
#local Elements[2] = torus{ 1 .1 }
#local Elements[3] = cylinder{ -y y 1 }
#local Elements[4] = cone{ -y 1 y 0 }
#local Generator = seed(1);

#macro Filler_Element( Element )
  // define object geometry for functions
  #declare Element[ 0 ] = object{
    Rand_Array_Item(Elements,Generator)
    scale (.1 + VRand(Generator))/30
    rotate 360 * VRand(Generator)
  }
  // specify decoration
  #declare Element[ 1 ] = object{
    Element[ 0 ]
    pigment{color rgb VRand(Generator)/2+.5}
  }
  // additionaly specify space appearance if you want it
  // #declare Element[ 2 ] = sphere{ rand(Generator) 100 } 
#end



> Have you guessed the calculation time for one intersection test? If this
> picture parsed for 35 minutes, I can imagine that the parsing time for a
> very densely packed object would be really extreme.

Unfortunatelly. I plan text output so placing can be performed once.

> I have another idea for a macro which fills a plane with objects. First a
> spline would need to be built that covers the entire viewing area.

You mean screen ? In fact this is easy possible with my macro.

ABX


Post a reply to this message

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