POV-Ray : Newsgroups : povray.general : CSG mesh bug : CSG mesh bug Server Time
5 Nov 2024 13:23:42 EST (-0500)
  CSG mesh bug  
From: Jozef Gatial
Date: 27 Mar 2003 02:10:09
Message: <web.3e82a371ff88dac376ced8e90@news.povray.org>
The same results with difference or intersection of two meshes.
Please, see next simple sample
Jozef Gatial


// Persistence of Vision Ray Tracer Scene Description File

#version 3.5;
#include "colors.inc"
global_settings { assumed_gamma 1.0 }

// ----------------------------------------

camera {location <0.0, 0.5, -4.0> direction 1.5*z right
x*image_width/image_height look_at<0,0,0> }
sky_sphere { pigment { gradient y color_map { [0 rgb <0.6,0.7,1.0>] [0.7 rgb
<0.0,0.1,0.8>] } } }
light_source { <0, 0, 0> color rgb <1, 1, 1> translate <-30, 30, -30> }
plane { y, -1 pigment { color rgb <0.7,0.5,0.3> } }

// ----------------------------------------

#declare Object1Material1 = material {
texture {
  pigment { color rgbf <1, 1, 1, 0> }
  finish  { ambient .5 diffuse .5 }
  }
}
#declare Object1Material2 = material {
texture {
  pigment { color rgbf <1, 1, 0, 0> }
  finish  { ambient .5 diffuse .5 }
  }
}

#declare Object1 = mesh {
   inside_vector <0, 0, 1>
   smooth_triangle { <-1, -1, -1>, <0, 1, 0>, <1, -1, -1>, <0, 1, 0>, <1,
-1, 1>, <0, 1, 0> }
   smooth_triangle { <1, -1, 1>, <0, 1, 0>, <-1, -1, 1>, <0, 1, 0>, <-1, -1,
-1>, <0, 1, 0> }
   smooth_triangle { <-1, 1, -1>, <0, -1, 0>, <1, 1, 1>, <0, -1, 0>, <1, 1,
-1>, <0, -1, 0> }
   smooth_triangle { <1, 1, 1>, <0, -1, 0>, <-1, 1, -1>, <0, -1, 0>, <-1, 1,
1>, <0, -1, 0> }
   smooth_triangle { <-1, -1, -1>, <0, 0, 1>, <1, 1, -1>, <0, 0, 1>, <1, -1,
-1>, <0, 0, 1> }
   smooth_triangle { <1, 1, -1>, <0, 0, 1>, <-1, -1, -1>, <0, 0, 1>, <-1, 1,
-1>, <0, 0, 1> }
   smooth_triangle { <1, -1, -1>, <-1, 0, 0>, <1, 1, 1>, <-1, 0, 0>, <1, -1,
1>, <-1, 0, 0> }
   smooth_triangle { <1, 1, 1>, <-1, 0, 0>, <1, -1, -1>, <-1, 0, 0>, <1, 1,
-1>, <-1, 0, 0> }
   smooth_triangle { <1, -1, 1>, <0, 0, -1>, <-1, 1, 1>, <0, 0, -1>, <-1,
-1, 1>, <0, 0, -1> }
   smooth_triangle { <-1, 1, 1>, <0, 0, -1>, <1, -1, 1>, <0, 0, -1>, <1, 1,
1>, <0, 0, -1> }
   smooth_triangle { <-1, -1, 1>, <1, 0, 0>, <-1, 1, -1>, <1, 0, 0>, <-1,
-1, -1>, <1, 0, 0> }
   smooth_triangle { <-1, 1, -1>, <1, 0, 0>, <-1, -1, 1>, <1, 0, 0>, <-1, 1,
1>, <1, 0, 0> }
}

difference
//intersection
{
object { Object1 material { Object1Material1 } scale .5 rotate <45,45,45>
translate <-.5,0,0>}
object { Object1 material { Object1Material2 } scale .5 rotate <45,45,45>
translate <.5,0,0>}
}


Post a reply to this message

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