POV-Ray : Newsgroups : povray.general : sphere_sweep bug workaround needed : Re: sphere_sweep bug workaround needed Server Time
31 Jul 2024 06:11:40 EDT (-0400)
  Re: sphere_sweep bug workaround needed  
From: Tim Attwood
Date: 24 Aug 2007 21:31:16
Message: <46cf8664$1@news.povray.org>
> I'm having a problem with a sphere-sweep that looks like the bounding box 
> is too small: some of it is not shown. It's not related to the tolerance 
> setting or self-shadowing, nor seem it to be a precision problem, as 
> scaling it all larger or smaller makes no difference. I also tried to 
> apply my own larger bounding_box, but it makes no difference. Any pointers 
> what I can do?

Yeah, sphere_sweeps are bugged.  I wish they weren't.
I'd use a macro...

#macro Sweep(SPL, from, to, rez)
 #local eval_to = to;
 #local C = from;
 sphere {<SPL(C).x,SPL(C).y,SPL(C).z>,SPL(C).t}
 #while (C<eval_to-rez)
  cone {<SPL(C).x,SPL(C).y,SPL(C).z>,SPL(C).t,
  <SPL(C+rez).x,SPL(C+rez).y,SPL(C+rez).z>,SPL(C+rez).t}
  sphere {<SPL(C+rez).x,SPL(C+rez).y,SPL(C+rez).z>,
    SPL(C+rez).t}
  #local C=C+rez;
 #end
#end

#declare Foo = spline {
   cubic_spline
   -0.33, <0, -6.0, 0.00, 0.12  >,
    0.00, <0, -6.0, 0.00, 0.12  >,
    0.33, <0, -0.2, 0.07, 0.05  >,
    0.66, <0,  2.1, 0.70, 0.01  >,
    1.00, <0,  2.5, 2.50, 0.0001>,
    1.33, <0,  2.5, 2.50, 0.0001>
};

#declare Bar = union {Sweep(Foo, 0, 1, 0.01)};

#declare FlowerAlignments = array[3]
{1.24*<1,1,1>, <-65,  5,-50>, <8.1,-7.8,30>},

union {
   #declare C = 0;
   #while (C<6)
      object { Bar
         rotate 60*y*C
      }
      #declare C = C+1;
   #end
   pigment {rgb <1.50,0.90,0.00>}
   translate -y
   scale FlowerAlignments[0]
   rotate FlowerAlignments[1]*<0,1,0>
   rotate FlowerAlignments[1]*<1,0,1>
   translate FlowerAlignments[2]
}

camera {
   location -FlowerAlignments[2]
   look_at 0
   angle FlowerAlignments[0].x*5
   translate FlowerAlignments[2]
}
light_source {< 1, 2,-3>*1000, rgb 1.0}
light_source {<-3, 1,-2>*1000, rgb 0.6}
light_source {<-1,-3,-2>*1000, rgb 0.6}


Post a reply to this message

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