POV-Ray : Newsgroups : povray.newusers : CSG cutting slices : Re: CSG cutting slices Server Time
28 Jul 2024 20:24:15 EDT (-0400)
  Re: CSG cutting slices  
From: Chris B
Date: 4 Oct 2007 07:28:04
Message: <4704ce44$1@news.povray.org>
"LikeNoOther" <eug### [at] gmailcom> wrote in message 
news:web.4704b40aeb8279c96e4edffd0@news.povray.org...
> Hi. I have previously asked for help cutting a 3D model into slices.
> The solution did unfortunately not always work. Only in simple 3D models.
>
> Here is what I have done:
>
> #declare MinZ = min_extent(_151stan_toon_).y;
> #declare MaxZ = max_extent(_151stan_toon_).y;
> #declare Height = MaxZ - MinZ;
> //==================================================
>
> intersection {
>      object{
>              _151stan_toon_
>              double_illuminate
>      }
>
>      plane{
>       y,MinZ+(frame_number/final_frame)*Height
>
>          pigment{
>            color rgbf <1,1,1,1>
>          }
>
>       }
>   }
>
> The rest of the pov file was generated using poseray.
> The object name is _151stan_toon.
> I want to cut the model into slices similar to ct scans.
> (Vertical slices.)
> As far as I know all I want to do is get the intersection of the model and
> the plane. I made the plane transparent so that I can see the original
> colour of the
> model.
>
> What happens is that it does cut it into slices but for some reason it
> keeps on creating the same slice after a while instead of going further up
> the model.
>
> Any help will be appreciated greatly.
>

Hi Eugene,
You could use the #debug directive to write the values out into the message 
stream so that you can trace the problem.
For example, you could add the following lines to your code to look at the 
result of the height calculation, then home in on parts of the calculation 
to see which bits are causing you trouble.

#debug concat("Frame Number: ",str(frame_number,3,3),"\n")
#debug concat("Final Frame: ",str(final_frame,3,3),"\n")
#debug concat("Height Calculation: 
",str(MinZ+(frame_number/final_frame)*Height,3,3),"\n")

Also, while you want to focus on the message stream you can cut the render 
size right down so that each frame renders quicker.

Regards,
Chris B.


Post a reply to this message

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