POV-Ray : Newsgroups : povray.binaries.images : CSG merge/union test : CSG merge/union test Server Time
2 Nov 2024 16:12:16 EDT (-0400)
  CSG merge/union test  
From: StephenS
Date: 12 Jun 2010 11:35:01
Message: <web.4c13a8b6bda1e33d1fbc8ec90@news.povray.org>
In an attempt to model a glass food container with locking lid, I can across the
following behaviour.

There is a different result when useing merge or union in the following scene,
which I was not expecting. I think it comes down to this setup which contains a
co-incident surface.

intersection {
 merge {        // union
  difference { }
  difference { }
 }
 box { }
}

Removing the co-incident surface fixes the problem, but why is there a problem
to begin with? Useing a difference{} with two boxes instead of the intersection
did not change the result.

A full scene:

background { color rgb <1.000,1.000,1.000> }

#declare Gray_85_ =
texture {
 pigment {
  color rgbft <0.850,0.850,0.850,0.000,0.000>
 }
}

camera {
 perspective
 location <1.814,4.257,-13.213>
 up y
 right 1.333*x
 angle 11.731
 sky <-0.041,0.953,0.301>
 look_at < 0.000, -0.000, 0.000 >
}

light_source {
 < 0.000000, 0.000000, 0.000000 >, color rgb <1.000,1.000,1.000>
 fade_power 0.000
 fade_distance 100.000
 media_attenuation off
 media_interaction on
 translate <8.125000,6.250000,-2.656250>
}

intersection {
 merge {                                       // union // merge
  difference {  // Tube3
   cylinder {-0.5625000*y,0.5625000*y,1.075}
   cylinder {-1.5625000*y,1.5625000*y,0.925}   // .925
   translate <0.000000,-0.562500,0.000000>
  }

  difference {  // Tube0
   cylinder {-0.0900000*y,0.0900000*y,1.235}
   cylinder {-1.0900000*y,1.0900000*y,0.925}   // .925  // .926
   translate <0.000000,-0.200000,0.000000>
  }

 }

 box {
  < -0.6500000, -0.7500000, -0.6500000 >, < 0.6500000, 0.7500000, 0.6500000 >
  translate <-0.650000,-0.625000,0.650000>
 }
 texture{ Gray_85_ }
}

In the following picture;
 the corner of the soon to be glass container,
 useing union,
 useing merge.

The fix for the problem is to change the second tube object to avoid the
co-incident surface.

Why is there a difference between a union and merge in this scene?


Post a reply to this message


Attachments:
Download 'test_csg_merge_union.png' (34 KB)

Preview of image 'test_csg_merge_union.png'
test_csg_merge_union.png


 

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