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 06:26:47 EDT (-0400)
  Re: An inside/outside test for triangles mesh  
From: Ken
Date: 7 Mar 1999 23:08:39
Message: <36E34C8B.E7318311@pacbell.net>
On a side note to this thread I have always assumed from what is specified
in the docs that mesh objects are not allowed in csg operations.

From the Pov v3.1d documentation:

------------------------

Finite Patch Primitives

There are six totally thin, finite objects which have no well-defined inside.
They are bicubic patch, disc, smooth triangle, triangle, polygon and mesh.
They may be combined in CSG union but cannot be use in other types of CSG
(or inside a clipped_by statement). 

---------------------------------

  It specificaly states that these objects CANNOT be used in any csg operation
except for a union. If you take a moment to render the code below this note
you will find that this is not altogether true. I put together 4 triangles
that make up a square flat face for simplicity sake. The csg operations
that I have illustrated below work perfectly and the only thing the parser
does in protest is issue a quiet warning that patch objects are not allowed
in csg operations.  

Comments anyone ?


/******************************/

camera{location<0,0,-5>look_at 0}
light_source{<0,0,-30>rgb 1}

// first operation

 intersection{
   mesh {
    triangle{<-1,-1,0>,<0,0,0>,< 1,-1,0>}
    triangle{<-1,-1,0>,<0,0,0>,<-1, 1,0>}
    triangle{<-1, 1,0>,<0,0,0>,< 1, 1,0>}
    triangle{< 1, 1,0>,<0,0,0>,< 1,-1,0>}
    pigment{rgb 1}
   } // end mesh object

    sphere{0,.5 
      pigment{blue 1}
     inverse
    } // end sphere object

   translate<-1.5,0,0>

  } // end intersection


// second operation

 difference{
   mesh {
    triangle{<-1,-1,0>,<0,0,0>,< 1,-1,0>}
    triangle{<-1,-1,0>,<0,0,0>,<-1, 1,0>}
    triangle{<-1, 1,0>,<0,0,0>,< 1, 1,0>}
    triangle{< 1, 1,0>,<0,0,0>,< 1,-1,0>}
    pigment{rgb 1}
   } // end mesh object

    sphere{0,.5 
      pigment{blue 1}
     inverse
    } // end sphere object

   translate<1.5,0,0>

  } // end intersection


/*********************************/


-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

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