POV-Ray : Newsgroups : povray.general : # of objects in a model Server Time
5 Nov 2024 20:17:12 EST (-0500)
  # of objects in a model (Message 1 to 8 of 8)  
From: gonzo
Subject: # of objects in a model
Date: 16 Jan 2003 17:05:04
Message: <web.3e272b5a2c0a881a0c272b50@news.povray.org>
I've been building a pretty complex model using numerous #while loops and
macros. Is there a way to tell how many parts are in the final model?

POV tells me there are 1047 frame level objects, but what does that mean?
(It was over 1100 before I added a macro that I estimate added another
200-300 pieces.)

My guesstimate so far is about 3700 parts, but I'd really like to have a
precise number.

Thanks.

RG - remember, its not whether you win or lose, its how many endorsement
contracts you signed before the season ended


Post a reply to this message

From: Slime
Subject: Re: # of objects in a model
Date: 16 Jan 2003 17:09:09
Message: <3e272d85@news.povray.org>
Put just the model in a scene by itself, without any other objects (like
ground planes or whatever). The "number of frame level objects" should then
be an accurate count of the number of objects in the model.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Vadim Sytnikov
Subject: Re: # of objects in a model
Date: 16 Jan 2003 19:16:31
Message: <3e274b5f$1@news.povray.org>
"Slime" <slm### [at] slimelandcom> wrote in message
news:3e272d85@news.povray.org...
> Put just the model in a scene by itself, without any other objects (like
> ground planes or whatever). The "number of frame level objects" should
then
> be an accurate count of the number of objects in the model.

Well, it wouldn't. At least, not always.

Roughly speaking, "number of frame-level objects" is the number of
primitives plus the number of intersections and other compound objects
*except* unions. POV-Ray's parser splits unions (including nested unions, to
any depth) until it "hits" a primitive, or a non-union compound object. It
is the result of this process that defines that number... And the reason
behind this is very strong: building an efficient bounding slabs' tree.

As an illustration, try making the following scene: turn your complex model
into, say, a stone one by making an intersection of your model and large
enough sphere; assign stone texture to that intersection; add a point light.
Render the scene and see how many "frame level objects" you've got. Voila --
just one. If you make a complex enough model with intersection being at its
root, and then try to render it (so that this model occupies entire camera
view), chances are it will render for ages. The rendering performance
distinction between unions and other compounds is so big that that might as
well be in the VFAQ and/or manual...

So, if I understood your question correctly, you are not supposed to get an
easy unswer. If your model, say, contains a golf ball made as an
intersection of a sphere with N smaller ones (e.g. created using #while),
your ball will always count as a single frame-level object.


Post a reply to this message

From: Slime
Subject: Re: # of objects in a model
Date: 16 Jan 2003 20:03:46
Message: <3e275672$1@news.povray.org>
> POV-Ray's parser splits unions (including nested unions, to
> any depth) until it "hits" a primitive, or a non-union compound object.

I had heard this before. I was wondering, how does it handle, say:

intersection {
sphere{...}
union {
sphere{...}
sphere{...}
}
}

without retaining the union? (assume all three spheres intersect.)

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Vadim Sytnikov
Subject: Re: # of objects in a model
Date: 16 Jan 2003 20:16:09
Message: <3e275959$1@news.povray.org>
"Slime" <slm### [at] slimelandcom> wrote
> > POV-Ray's parser splits unions (including nested unions, to
> > any depth) until it "hits" a primitive, or a non-union compound object.
>
> I had heard this before. I was wondering, how does it handle, say:
>
> intersection {
> sphere{...}
> union {
> sphere{...}
> sphere{...}
> }
> }
>
> without retaining the union? (assume all three spheres intersect.)

As I wrote, "parser splits ... until it hits ... non-union compound object".
That is, since the union you draw as an example is *within* intersection
(which is one of the "non-union compound objects" I was referring to), it
will be retained.


Post a reply to this message

From: Slime
Subject: Re: # of objects in a model
Date: 16 Jan 2003 20:41:37
Message: <3e275f51$1@news.povray.org>
> As I wrote, "parser splits ... until it hits ... non-union compound
object".
> That is, since the union you draw as an example is *within* intersection
> (which is one of the "non-union compound objects" I was referring to), it
> will be retained.


Ooh, OK. So not all unions are split. Makes more sense.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Mark Wagner
Subject: Re: # of objects in a model
Date: 17 Jan 2003 01:06:17
Message: <pan.2003.01.17.06.05.01.719347.302@gte.net>
On Thu, 16 Jan 2003 16:59:55 -0500, gonzo quoth:

> I've been building a pretty complex model using numerous #while loops
> and macros. Is there a way to tell how many parts are in the final
> model?
> 
> POV tells me there are 1047 frame level objects, but what does that
> mean? (It was over 1100 before I added a macro that I estimate added
> another 200-300 pieces.)
> 
> My guesstimate so far is about 3700 parts, but I'd really like to have a
> precise number.

In order to do this, you'll need to replace all "difference",
"intersection", and "merge" keywords with "union", then render.  The
resulting model won't look anything like your original model, but the
"frame level objects" count will be the number of parts in the model.

A "frame level" object is any object that is in the "top level" of the
scene; that is, not part of a difference, merge, or intersection, and that
is not a bounding or clipping object.

-- 
Mark


Post a reply to this message

From: gonzo
Subject: Re: # of objects in a model
Date: 17 Jan 2003 03:00:06
Message: <web.3e27b6e267d12d4d3f329d050@news.povray.org>
Mark Wagner wrote:
>On Thu, 16 Jan 2003 16:59:55 -0500, gonzo quoth:
>
>In order to do this, you'll need to replace all "difference",
>"intersection", and "merge" keywords with "union", then render.

That's about what I was figuring from reading the above. I could tell it had
something to do with the CSG operations but wasn't sure which ones...

>A "frame level" object is any object that is in the "top level" of the
>scene; that is, not part of a difference, merge, or intersection, and that
>is not a bounding or clipping object.

Ok, that's clearer. That explains why I could add a macro and the number
went down.

Thanks much everybody!

I had tried modeling things like this in other programs, but it got too
complex in a hurry. Thanks to POV it's now possible! WHEEEEEE!!!!

RG - just because I'm paranoid doesn't mean everyone's not out to get me


Post a reply to this message

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