POV-Ray : Newsgroups : povray.newusers : Generating cross-section of a complicated model : Re: Generating cross-section of a complicated model Server Time
28 Jul 2024 12:25:28 EDT (-0400)
  Re: Generating cross-section of a complicated model  
From: Chris B
Date: 20 May 2009 11:49:00
Message: <4a14266c$1@news.povray.org>
"Tomohiro" <nomail@nomail> wrote in message 
news:web.4a13ff1fd9818dbeab6e42900@news.povray.org...
>I built a model of a complicated machine.
> ...
> I would like to generate a cross-section of the model. Usage of 
> "intersection"
> or "difference" with a "plane" does not work well, because the texture of
> the cross-section is determined by the "plane".
>  ....
> How can I achieve my goal without modifying the model as far as possible?
>

I don't think there's a perfect answer to this. There is a 
'cutaway_textures' keyword that works with 'difference' and 'intersection' 
CSG operations, but it's a long way from perfect and seems to be broken in 
the 3.7 Beta 32. On the other hand it does work largely as documented on 
POV-Ray 3.6, so it may help. Here's a very trivial test scene:

camera {location  <0, 1,-3> look_at <0,0,0>}
light_source {< 70, 200, -80> color rgb 0.8}
difference {
  union {
    sphere {0,1 pigment {rgb <2,0,0>}}
    box {-0.9,0.9 pigment {rgb <0,0,2>}}
  }
  plane {z,0}
  cutaway_textures
}

If you render this in 3.6 you'll notice that it works, but of course it 
can't know which of the two colors to use for the overlapping part, so it 
seems to average the two colors. Whether this is of any help to you will 
depend on which version of POV-Ray you're on and upon the specifics of your 
CSG operations. If you've been diligent enough to avoid overlapping parts of 
different colors then you may be ok.

Regards,
Chris B.


Post a reply to this message

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