POV-Ray : Newsgroups : povray.advanced-users : Povtree macro (mesh created at parsing whith loops) seems to waste memory : Povtree macro (mesh created at parsing whith loops) seems to waste memory Server Time
20 Apr 2024 00:18:04 EDT (-0400)
  Povtree macro (mesh created at parsing whith loops) seems to waste memory  
From: Warren
Date: 19 Jul 2018 14:30:01
Message: <web.5b50d7d9e0f2cd5020df21d60@news.povray.org>
Hi/Hello
I have a problem and can't fix it. I download two files that generate a tree
several months ago. Before that download I used to generate the trees with an
executable (java file povtree.jar), Povtree that allows the user to generate a
mesh directly in a file (idealy a *.inc file), a mesh object with a lot of
triangles. Then with the two files ("TOMLEAF.inc" and "TOMTREE-1.5.inc" that
contain macro) and a smaller tree file generated with Povtree java executable
(that smaller file contains only some parameter like numbers #declares and
leaves, trunk colors but doesn't contain lots of triangles (excepted a sample of
a leaf , a mesh object definition)), unlike the previous include file described
above.
There are advantages at using the two macro files with the small tree config
file:
- It seems that the flore is generated faster at parsing time.
- The total size of the povray scene files is a lot smaller (5 MB against 285 MB
for example for a kapok tree).
I'd like to keep theses advantages and not using the big included mesh file. But
this configuration has a bug (I think): When I generate the kapok tree (the
macro creates an object with a declare: a mesh object named TREE ) and without
modifying it after and planting it several time with nested for loops, I see on
the system monitor of Ubuntu 18.04 that I quickly reach max occupied ram I can
get on my computer : 16 GB of ram (I CTRL-C before ). The loops are like this:
//-----------
#for(it_x, -100, 100, 2)
    #for(it_z, -100, 100, 2)
        object{TREE translate <it_x, 0, it_z> }
    #end
#end
//----------
As you can see there is not so much sample of kapok tree (at least nothing that
can spare 16 GB of ram.
When I render the scene with the big include file (~285 MB ) POVray manages the
memory much better because the memory this time doesn't overcome 1 GB.

I think the solution is in the macro files but I can't get the solution. I made
some modifications (after the memory problem, taht said) like commenting blocks
of code like (in TOMTREE-1.5.inc:

//bounded_by{cylinder{<0, 0, 0>, <0, BH, 0>, BH}}

//--------------
or in TOMLEAF.inc:
 /*
      clipped_by
      {
            cylinder
            {
                  <.5,0,0>,<.5,1.1,0>,.5
                  scale <1,1,2/3>
            }
      }
 */

....because POVray complained there was unecessarily bounding in these files.

Infos: I use POVRay in version 3.8 : POV-Ray
3.8.0-x.tokenizer.9686180.unofficial

But I had the same issue with POVRay 3.7 (stable)

The macro files TOMLEAF.inc and TOMTREE-1.5.inc can be downloaded on this link:

http://www.ant01.fr/fichiersAnt01/povray/povtreeMacroFiles.zip the archive size
is 2.6MB and I didn't include the big kapok tree file (it doesn't bug).

Thank you.


Post a reply to this message

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