POV-Ray : Newsgroups : povray.bugreports : Mesh CSG Operation Bug Server Time
14 May 2024 03:31:29 EDT (-0400)
  Mesh CSG Operation Bug (Message 1 to 1 of 1)  
From: Ken
Subject: Mesh CSG Operation Bug
Date: 11 Sep 2002 22:59:05
Message: <3d8002f9@news.povray.org>
Mesh bug report -

  A mesh object (w/inside_vector used) evaluates properly only when it is a
top level object in a CSG operation. The behavior is incorrect when it is a
second level object. This bug has been confirmed.

POV-Ray for Windows version 3.5.icl.win32, Win 98, Athlon 950, 256meg sdram.

Ken Tyler

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

#macro Box_Mesh(Vec1,Vec2,In_Vect)

#if (Vec1.x=Vec2.x | Vec1.y=Vec2.y | Vec1.z=Vec2.z) 

#debug "\n  Box_Mesh detected identical vector values.\n" #end

#local P1=<Vec1.x, Vec1.y, Vec1.z>;
#local P2=<Vec2.x, Vec1.y, Vec1.z>; 
#local P3=<Vec2.x, Vec1.y, Vec2.z>;
#local P4=<Vec1.x, Vec1.y, Vec2.z>;
#local P5=<Vec1.x, Vec2.y, Vec1.z>;
#local P6=<Vec2.x, Vec2.y, Vec1.z>;
#local P7=<Vec2.x, Vec2.y, Vec2.z>;
#local P8=<Vec1.x, Vec2.y, Vec2.z>;

mesh
{
    triangle { P5, P1, P2} triangle { P5, P6, P2}
    triangle { P6, P2, P3} triangle { P6, P7, P3}
    triangle { P7, P3, P4} triangle { P7, P8, P4}
    triangle { P8, P4, P1} triangle { P8, P5, P1}
    triangle { P8, P5, P6} triangle { P8, P7, P6}
    triangle { P4, P1, P2} triangle { P4, P3, P2}
    inside_vector In_Vect
}
#end


camera { location<-2,3,-5> look_at y*.5 }

light_source { <-5,5,-5> 1 }

default { pigment {red 1} finish { ambient .4 diffuse .6 }}


// Works as expected - mesh as top level object in csg

difference
{
   Box_Mesh(<-1,-1,-1>,<1,1,1>,<0,0,1>)
   box{<-.75,-.75,-1.1>,<.75,.75,1.1> pigment{rgb 1}}
  translate x*-1.2
}

// Does not work as expected - mesh as second level object in csg

difference
{
   box{<-1,-1,-1>,<1,1,1> pigment{rgb 1}}
   Box_Mesh(<-.75,-.75,-1.1>,<.75,.75,1.1>,<0,0,1>)
  translate x*1.2
}

// Does not work as expected - mesh as top and second level object in csg

difference
{
   Box_Mesh(<-1,-1,-1>,<1,1,1>, <0,0,1>)
   Box_Mesh(<-.75,-.75,-1.1>,<.75,.75,1.1>,<0,0,1>)
  translate y*2
}


Post a reply to this message

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