POV-Ray : Newsgroups : povray.general : Adding inside_vector (for CSG) to HF macros in shapes.inc : Re: Adding inside_vector (for CSG) to HF macros in shapes.inc Server Time
30 Jul 2024 16:17:42 EDT (-0400)
  Re: Adding inside_vector (for CSG) to HF macros in shapes.inc  
From: Zeger Knaepen
Date: 16 Oct 2008 17:08:59
Message: <48f7ad6b$1@news.povray.org>
'inside_vector', just like 'hollow', seems to be kind of magical to a lot of 
users...  AFAIK there is NO NEED to specify inside_vector if you want to use 
a properly closed mesh in CSG, since the default will do just fine.  If 
there are holes, or other abnormalities, it might work, but in some cases 
only if you carefully specify an inside_vector.  This should not be done 
randomly.  The idea of the inside_vector, AFAIK, is as follows:
to check if a specific point is inside the triangle-mesh, POV-Ray traces a 
ray in the direction of inside_vector and counts the intersections with the 
mesh.  If there's an odd number of intersections, the point is inside the 
mesh, an even number indicates that the point is outside the mesh. The 
problem arises if inside_vector points towards an abnormality (a hole in the 
mesh for instance), I suppose it's obvious what can go wrong in such cases.

cu!
-- 
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

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