POV-Ray : Newsgroups : povray.programming : An inside/outside test for triangles mesh : Re: An inside/outside test for triangles mesh Server Time
29 Jul 2024 00:26:19 EDT (-0400)
  Re: An inside/outside test for triangles mesh  
From: Ron Parker
Date: 5 Mar 1999 09:04:23
Message: <36dfe467.0@news.povray.org>
The point I was trying to make is this: All edges are shared between exactly 
two triangles.  The problem is, we don't know whether an edge intersection 
should be counted as one intersection, two, or none.  Consider the following 
ugly 2-d art:

                  /
_ _ _ _ _ _ _ _ _/_ _ _ 
    /\           \               
   /A \         B \

The dotted horizontal line is your ray.  At A, it hits an edge that should 
not be counted.  At B, it hits an edge that should be counted.  Each is
shared between exactly two faces.

The workaround in a situation like this is to cast another ray, parallel
to the first one but offset by a sufficiently small amount, through the
triangles in question.  Count the intersections of that ray and use that
number to represent the intersections at the edge.  The same thing works 
for intersections at vertices, except that you have to make sure that you
don't hit any edges with the parallel ray.


Post a reply to this message

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