POV-Ray : Newsgroups : povray.beta-test : Major bug in SOR : Re: Major bug in SOR Server Time
31 Jul 2024 08:29:14 EDT (-0400)
  Re: Major bug in SOR  
From: Anders K 
Date: 6 Sep 2001 20:35:03
Message: <3b981637$1@news.povray.org>
I wrote this little macro to temporarily work around the bug:

#macro SorFix (P)
  #local n = dimension_size(P, 1); #local i = 0;
  intersection {
    sor { n+2 P[0] #while (i < n) P[i] #local i = i+1; #end P[n-1] }
    plane { -y, -P[1].v } plane { y, P[n-2].v }
  }
#end

camera { location <10, 15, 15> look_at <0, 1, 0> angle 15 }
light_source { <2, 15, 5> color rgb <1, 1, 1> }
plane { +y, 0 pigment { rgb <1, 1, 1> } }
// sor { 4, <2, -1> <2, 0> <2, 2> <2, 3> pigment { checker } }
object {
  SorFix ( array[4] { <2, -1>, <2, 0>, <2, 2>, <2, 3> } )
  pigment { checker }
}

Anders

P.S. Yeah, I know, it's too late for feature requests, but why do I have to
explicitly specify the number of elements in an array? Why can't I just
write something like
  array { <2, -1>, <2, 0>, <2, 2>, <2, 3> }
without worrying about counting the number of elements I put in? That would
make it much, much easier to maintain large arrays with elements being added
and deleted often.


Post a reply to this message

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