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:33:05 EDT (-0400)
  Re: An inside/outside test for triangles mesh  
From: Nathan Kopp
Date: 4 Mar 1999 23:30:06
Message: <36DF5DBA.2E7033EE@Kopp.com>
Ron Parker wrote:
> 
> First, when someone says a triangle mesh is closed, it's relatively easy to
> verify that that's likely the case: simply verify that each edge has exactly
> two adjacent faces.  This won't catch certain degenerate self-intersecting
> surfaces, but it'll be a good start.  From there, it's a (relatively) simple
> matter to reorient all of the triangles so that the insideness test doesn't
> require intersection counting, but only requires finding the closest triangle
> along a random ray and checking the orientation of that triangle relative to
> the ray.  Meshes already have an internal structure that optimizes this search.

I like this.

> A side note, and hopefully Nathan will see this too and make sure he's dealing
> with it correctly: CSG requires more than just an insideness test.  It also
> requires that the All_Intersections method really return all intersections,
> because if the closest one fails it wants to find the next-closest.  Internally
> bounded meshes DO NOT do this by default, because of the optimization I noted
> above.

What part of CSG requires that All_Intersections push everything onto the depth
stack (it's been a while)?  (I knew that mesh optimized that, since I had to
skip that part in order to count every intersection.)

My implementation of this is very simple and really hasn't been tested much.
I don't handle any of the gotchas (like intersecting an edge, but I like
using orientation better anyway (it should be faster and is a more standard
way of solving the problem).  What about using the already existing surface
normals (stored in the mesh structure)?  Of course, that would require any
user-specified normals to always point 'out'.  Just a thought.

-Nathan


Post a reply to this message

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