POV-Ray : Newsgroups : povray.newusers : forcing POVray to ignore degenerate cylinders Server Time
29 Jul 2024 14:21:31 EDT (-0400)
  forcing POVray to ignore degenerate cylinders (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From: Sebastian H 
Subject: Re: forcing POVray to ignore degenerate cylinders
Date: 13 Feb 2006 15:05:44
Message: <43f0e698$1@news.povray.org>
Florian Brucker wrote:
> Nevertheless it's annoying that a degenerate cylinder causes a parse 
> time error and not a warning. 

Not to mention unions containing just one object.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: forcing POVray to ignore degenerate cylinders
Date: 13 Feb 2006 15:34:55
Message: <43f0ed6f$1@news.povray.org>
Florian Brucker wrote:
> Nevertheless it's annoying that a degenerate cylinder causes a parse 
> time error and not a warning. Degenerate triangles, spheres and boxes do 
> not trigger errors (in fact they're not even triggering warnings), 
> whereas an empty mesh throws an error, too. Is that really necessary? 

Not really, but it certainly was a deliberate choice at the time. Not one I 
personally think was the best, but things like this happen.

> What's the problem with ignoring those objects at parse time?

The errors are for some (did not check all) of these cases due to POV-Ray 
precomputing some values to increase speed of intersection tests right after 
parsing the object. It then detects the object is degenerate and instead of 
deleting the invalid object plus issuing a warning, it generates an error 
because rendering would most certainly fail if the object would be left in 
the scene.

Some of these annoyances have already been addressed in POV-Ray 3.7 betas, 
some more are marked on the POV-Team's internal (well, source code comments, 
not more so far) todo list for 3.7 and others won't make it for 3.7 to get 
improved. Eventually, I suppose all errors should be detected at parse time 
(there are even some detected at render-time!) and issue warnings or 
possible errors (which are non-fatal) and delete the offending object from 
the scene and continue by default,. Of course, other options making this 
still a fatal error might be useful, too, such that nobody wastes days 
rendering a scene just to discover an object is missing due to a typo that 
made in degenerate, and the final image is useless.

	Thorsten


Post a reply to this message

From: Trevor G Quayle
Subject: Re: forcing POVray to ignore degenerate cylinders
Date: 13 Feb 2006 15:50:01
Message: <web.43f0f0b94e14e3576c4803960@news.povray.org>
Florian Brucker <tor### [at] torfboldcom> wrote:
> Nevertheless it's annoying that a degenerate cylinder causes a parse
> time error and not a warning. Degenerate triangles, spheres and boxes do
> not trigger errors (in fact they're not even triggering warnings),
> whereas an empty mesh throws an error, too. Is that really necessary?
> What's the problem with ignoring those objects at parse time?
>

As an additional note, degenerate cylinders are not equal to other
degenerate objects.  Other objects that are degenerate are essentially
objects of 0 dimension in all directions, and will not form a surface of
any sort so the rays can pass by without intersection without deleting the
object.  However, a cylinder can be degenerate in length but not radius.
This would be equivilant to a flat disc with zero thickness which would be
a surface that rays can intersect with.  However with no length vectors,
the orientation of this disc is unknown to POV and the surface intersection
cannot be calculated which can cause a calculation problem.
There may be ways that this can be fixed in a newer version as Thorsten has
pointed out, by automatically deleting the offending object, however in
some instances it may not be desired.


-tgq


Post a reply to this message

From: Christoph Hormann
Subject: Re: forcing POVray to ignore degenerate cylinders
Date: 13 Feb 2006 15:50:03
Message: <dsqrbj$uon$1@chho.imagico.de>
Florian Brucker wrote:
> 
> Nevertheless it's annoying that a degenerate cylinder causes a parse 
> time error and not a warning. Degenerate triangles, spheres and boxes do 
> not trigger errors (in fact they're not even triggering warnings), 
> whereas an empty mesh throws an error, too. Is that really necessary? 
> What's the problem with ignoring those objects at parse time?

In contrast to a sphere with radius 0 a degenerate cylinder is not 
simply invisible - it is not well defined how it should look like.  Also 
note triangles, spheres and boxes are not ignored - triangles in a mesh 
are but this is something different.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 31 Oct. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Florian Brucker
Subject: Re: forcing POVray to ignore degenerate cylinders
Date: 14 Feb 2006 04:41:22
Message: <43f1a5c2@news.povray.org>
Thanks for your opinions about that. I hadn't considered that from a 
mathematical point of view a degenerate cylinder is troublesome 
(although, from a user's point of view it may not be).
I'm glad to hear that the POV team is aware of the issue and that first 
measures will already be included in 3.7.


Florian


Post a reply to this message

From: Warp
Subject: Re: forcing POVray to ignore degenerate cylinders
Date: 14 Feb 2006 09:42:01
Message: <43f1ec39@news.povray.org>
Florian Brucker <tor### [at] torfboldcom> wrote:
> Thanks for your opinions about that. I hadn't considered that from a 
> mathematical point of view a degenerate cylinder is troublesome 
> (although, from a user's point of view it may not be).

  The problem is simply that if the endpoints of the cylinder are the
same point but the cylinder has a non-zero radius, POV-Ray cannot know how
to orientate the resulting disc.

  Basically there doesn't exist degenerate spheres (the only exceptional
case is a sphere with a radius of 0, but that's just no sphere at all)
or degenerate boxes (creating an infinitely thin "box" is umambiguous
and thus there's no problem). However, a cylinder with a non-zero radius
but with coincident endpoints is a problem because it can't be created
unambiguously.

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: forcing POVray to ignore degenerate cylinders
Date: 14 Feb 2006 19:58:00
Message: <43f27c98$1@news.povray.org>
Warp nous apporta ses lumieres en ce 14/02/2006 09:42:
> Florian Brucker <tor### [at] torfboldcom> wrote:
> 
>>Thanks for your opinions about that. I hadn't considered that from a 
>>mathematical point of view a degenerate cylinder is troublesome 
>>(although, from a user's point of view it may not be).
> 
> 
>   The problem is simply that if the endpoints of the cylinder are the
> same point but the cylinder has a non-zero radius, POV-Ray cannot know how
> to orientate the resulting disc.
> 
>   Basically there doesn't exist degenerate spheres (the only exceptional
> case is a sphere with a radius of 0, but that's just no sphere at all)
> or degenerate boxes (creating an infinitely thin "box" is umambiguous
> and thus there's no problem). However, a cylinder with a non-zero radius
> but with coincident endpoints is a problem because it can't be created
> unambiguously.
> 
It's obvious that in that case, the axis of the cylinder is undefined: it's impossible
to know it's 
orientation. You have a few options:
- ignore the object. Don't draw it and issue a warning or a non-fatal error.
- "assume" it's a sphere of the defined radius. Issue a warning about the
"asumption"/conversion. 
This is somewhat similar to scale 0.
- throw a fatal error and abort the render.


-- 
Alain
-------------------------------------------------
Change is inevitable, except from vending machines.


Post a reply to this message

From: Sebastian H 
Subject: Re: forcing POVray to ignore degenerate cylinders
Date: 15 Feb 2006 04:02:39
Message: <43f2ee2f$1@news.povray.org>
Alain wrote:
> It's obvious that in that case, the axis of the cylinder is undefined: 
> it's impossible to know it's orientation. 

I second that. There's simply not enough information to define the
object. But why should POV make wild guesses of what it could have
been the user intended. Just drop the thing like a box/sphere of zero
volume. I would prefer just a warning message and no fatal error
in that case.

Sebastian


Post a reply to this message

From: Trevor G Quayle
Subject: Re: forcing POVray to ignore degenerate cylinders
Date: 15 Feb 2006 08:30:01
Message: <web.43f32c454e14e3576c4803960@news.povray.org>
"Sebastian H." <van### [at] gmxde> wrote:
> Alain wrote:
> > It's obvious that in that case, the axis of the cylinder is undefined:
> > it's impossible to know it's orientation.
>
> I second that. There's simply not enough information to define the
> object. But why should POV make wild guesses of what it could have
> been the user intended. Just drop the thing like a box/sphere of zero
> volume. I would prefer just a warning message and no fatal error
> in that case.
>
> Sebastian

POV doesn't need to think to 'drop' zero volume spheres and boxes.  They
have no diminesional surface for rays to intersect so they can be left in
the scene as is without causing parsing problems, the individual rays will
pass by them unhindered without POV having to alter the scene.  This is not
the case for cylinders, POV would need to be able to think to see that a
cylinder is degenerate and remove it because of the problem with them as
its been explained.   This additional thinking by POV may add to the
parsing overhead.


-tgq


Post a reply to this message

From: Sebastian H 
Subject: Re: forcing POVray to ignore degenerate cylinders
Date: 15 Feb 2006 10:57:57
Message: <43f34f85$1@news.povray.org>
Trevor G Quayle wrote:
> 
> POV doesn't need to think to 'drop' zero volume spheres and boxes.  They
> have no diminesional surface for rays to intersect so they can be left in
> the scene as is without causing parsing problems, the individual rays will
> pass by them unhindered without POV having to alter the scene.  This is not
> the case for cylinders, POV would need to be able to think to see that a
> cylinder is degenerate and remove it because of the problem with them as
> its been explained.   This additional thinking by POV may add to the
> parsing overhead.
> 

This sounds as if the POV parser is in bad need for a
garbage filter. Imagine a typo in a macro produces
boxes with no volume. Actually I tried it and the
only message I got was that there was no pigment given.
With given pigment I could blow up parsing time at will.

#declare c=0;
#while(c<100000)
   box{<0,0,0><0,0,0> pigment {rgb <1,0,0>}}
   #declare c=c+1;
#end

even replies:
Slab Building Error: Out of memory.  Cannot allocate -124288 bytes for 
temporary tree entry.

It shouldn't be too hard to check a box size or a
cylinder length while parsing. Probably it's that
nobody had enough spare time to implement this.

Sebastian


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

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