POV-Ray : Newsgroups : povray.general : sig needs shortening : Re: sig needs shortening Server Time
5 Nov 2024 20:18:06 EST (-0500)
  Re: sig needs shortening  
From: Mark Weyer
Date: 17 Feb 2003 06:47:10
Message: <3E50CEAB.1020507@informatik.uni-freiburg.de>
>>#local R=1;light_source{-5R}#macro A(B,V)#while(B-1)#if(V>=B)#local
>>V=V-B;sphere{<3-ln(B)R+R 6>.4pigment{rgb<0R 1>+(x-z)*ln(B)/5}}#end#local
>>B=B/2;#end#end#local Z=seed(20267520);#while(R>0)A(256rand(Z)*600)#local
>>R=R-.4;#end//TMelly
> 
>   The same principles which I used in the previous one can be applied
> to this one as well and save some characters:
> 
> light_source{-5,1}#macro A(B,V,R,Z)#if(B-1)#if(V>=B)#local V=V-B;sphere
> {<3-ln(B)R+R 6>.4pigment{rgb<0R 1>+(x-z)*ln(B)/5}}#end A(B/2V,R,Z)#else
> #if(R>.2)A(256rand(Z)*600R-.4Z)#end#end#end A(1,0,1.4seed(20267520))

And then, allowing some more lossyness in compression:

light_source{-5,1}#macro A(B,V,R,Z)#if(B-1)#if(V>=B)sphere{<3-ln(B)R#local
V=V-B;6>.4pigment{rgb<0R 1>+(x-z)*ln(B)/5}}#end A(B/2V,R,Z)#else#if(R>0)A
(256rand(Z)*600R-.8Z)#end#end#end A(1,0,2seed(20267520))//TMelly

I am unsatisfied however: The break of line 2 is at a place where no
whitespace would have been needed. Hence one wasted character. Here is
a variant with one character less and one line more:

light_source{-5,1}#macro A(B,V,R,Z)#if(B-1)#if(V>=B)sphere{<3-ln(B)R#local
V=V-B;6>.4pigment{rgb<0R 1>+(x-z)*ln(B)/5}}#end
A(B/2V,R,Z)#else#if(R>0)A(256rand(Z)*600R-.8Z)#end#end#end
A(1,0,2seed(20267520))//TMelly



-- 
merge{#local i=-11;#while(i<11)#local
i=i+.1;sphere{<i*(i*i*(.05-i*i*(4e-7*i*i+3e-4))-3)10*sin(i)30>.5}#end
pigment{color.6}interior{media{emission x}}hollow}//  Mark Weyer


Post a reply to this message

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