POV-Ray : Newsgroups : povray.general : Suggestion for new object : Re: Suggestion for new object Server Time
14 Aug 2024 01:15:55 EDT (-0400)
  Re: Suggestion for new object  
From: Ron Parker
Date: 14 Jul 1998 18:56:14
Message: <35abd3fe.0@news.povray.org>
On Tue, 14 Jul 1998 23:04:15 +0200, F.VERBAAS <106120,444### [at] COMPUSERVECOM> wrote:
>But, so thinking further, what is the actual reason that a mesh can not be
>used for CSG? I assume this is because :
>1 - there is no guarantee that a mesh describes a closed surface, so no
>'real' inside or outside

True.

>2 - there is no guarantee that all triangles are consistently defined with
>their corner vertices arranged such that a normal vector defined by the
>right hand rule points outward. (or was it the left hand rule?  with POV you
>never know).

I've never understood this rule.  While it can make the job of determining
insideness easier, it's not really necessary.  All you have to do is shoot
a ray in an arbitrary direction and count how many times it intersects the
mesh surface.  If it intersects at a boundary between two or more triangles,
you'll need to shoot another ray, but I believe this condition is easy to
detect, as the intersection queue will contain a duplicated point.

>3 - there is no guarantee that the surface does not intersect itself,
>exposing the inside surface to the outside, and having the normals pointing
>inward. (hard to tell this in words, but no time to render an image)
>But, what if we would allow meshes that are closed, consistently defined,
>and not self-intersecting to engage in CSG?

If you don't care about the surface normals, self-intersecting but otherwise
closed meshes have insides.  Yes, even a 3d representation of a Klein bottle
has a well-defined inside.

>A practical solution would be to add a keyword 'CSG' to the definition of
>the mesh, like:

An even more practical solution is to only use "good" meshes in CSG 
operations.  If you get strange results because you gave it a strange mesh,
that's your problem, just as it is now if you use an open cylinder or SOR
in a CSG.  Perhaps a keyword to declare that your normals are all 
well-behaved, as in your point 2, would be useful to speed up calculations 
for such meshes.


Post a reply to this message

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