POV-Ray : Newsgroups : povray.general : Can anyone shorten this sig? Server Time
6 Nov 2024 18:25:42 EST (-0500)
  Can anyone shorten this sig? (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: Tom Melly
Subject: Can anyone shorten this sig?
Date: 18 Jul 2002 10:39:51
Message: <3d36d337$1@news.povray.org>
ideally 4*80 max?

#local T=2;#while(T>-2)#local U=-2;#while(U<2)#local Y=T;#local X=U;#local V=0;
#local W=1;#while(V<9)#local Z=X;#local X=X*X-Y*Y;#local Y=2*Z*Y;#local X=X+U;
#local Y=Y+T;#if(X*X+Y*Y>4)#local W=0;#local V=9;#end#local V=V+1;#end#if(W=1)
#local S=-2;#while(S<3)#if(S!=-1)box{0,.02 pigment{rgb 9}translate<T+S,U+1,6>}
#end#local S=S+1;#end#end#local U=U+.03;#end#local T=T-.05;#end//TM


Post a reply to this message

From: Ron Parker
Subject: Re: Can anyone shorten this sig?
Date: 18 Jul 2002 12:08:05
Message: <slrnajdpva.rj5.ron.parker@fwi.com>
On Thu, 18 Jul 2002 15:39:51 +0100, Tom Melly wrote:
> ideally 4*80 max?

Parse time is slightly worse, because I removed the short-circuit on the inner
(V) loop, but the results are the same...

#local T=-2;#while(T<2)#local U=2;#while(U>-2)#macro M(X,Y,V,W)#while(V<9)#local
Z=X;#local X=X*X-Y*Y+U;#local Y=2*Z*Y+T;#if(X*X+Y*Y>4)#local W=0;#end#local V=V+
1;#end#if(W)#macro L(S)box{0,.02 pigment{rgb 9}translate<T+S,U+1,6>}#end L(-2)L(
0)L(1)L(2)#end#end M(-U,-T,0,1)#local U=U-.03;#end#local T=T+.05;#end//Tom Melly


--
#macro R(L P)sphere{L __}cylinder{L P __}#end#macro P(_1)union{R(z+_ z)R(-z _-z)
R(_-z*3_+z)torus{1__ clipped_by{plane{_ 0}}}translate z+_1}#end#macro S(_)9-(_1-
_)*(_1-_)#end#macro Z(_1 _ __)union{P(_)P(-_)R(y-z-1_)translate.1*_1-y*8pigment{
rgb<S(7)S(5)S(3)>}}#if(_1)Z(_1-__,_,__)#end#end Z(10x*-2,.2)camera{rotate x*90}


Post a reply to this message

From: Tom Melly
Subject: Re: Can anyone shorten this sig?
Date: 18 Jul 2002 12:30:09
Message: <3d36ed11$1@news.povray.org>
"Ron Parker" <ron### [at] povrayorg> wrote in message
news:slr### [at] fwicom...
> On Thu, 18 Jul 2002 15:39:51 +0100, Tom Melly wrote:
> > ideally 4*80 max?
>
> Parse time is slightly worse, because I removed the short-circuit on the inner
> (V) loop, but the results are the same...
>

Ta - btw when are you coming over to the UK again? (v.soon iirc).


Post a reply to this message

From: Ron Parker
Subject: Re: Can anyone shorten this sig?
Date: 18 Jul 2002 12:38:25
Message: <slrnajdro7.rl4.ron.parker@fwi.com>
On Thu, 18 Jul 2002 17:30:09 +0100, Tom Melly wrote:
> "Ron Parker" <ron### [at] povrayorg> wrote in message
> news:slr### [at] fwicom...
>> On Thu, 18 Jul 2002 15:39:51 +0100, Tom Melly wrote:
>> > ideally 4*80 max?
>>
>> Parse time is slightly worse, because I removed the short-circuit on the inner
>> (V) loop, but the results are the same...
>>
> 
> Ta - btw when are you coming over to the UK again? (v.soon iirc).

Actually, I'm not going to make it.  (and I've never actually been there
before, either.)

-- 
plane{-z,-3normal{crackle scale.2#local a=5;#while(a)warp{repeat x flip x}rotate
z*60#local a=a-1;#end translate-9*x}pigment{rgb 1}}light_source{-9red 1rotate 60
*z}light_source{-9rgb y rotate-z*60}light_source{9-z*18rgb z}text{ttf"arial.ttf"
"RP".01,0translate-<.6,.4,.02>pigment{bozo}}light_source{-z*3rgb-.2}//Ron Parker


Post a reply to this message

From: Andrew Wilcox
Subject: Re: Can anyone shorten this sig?
Date: 18 Jul 2002 12:48:52
Message: <3d36f174@news.povray.org>
These are my best two attempts...

#local T=2;#while(T+2)#local U=-2;#while(U<2)#local Y=T;#local X=U;#local
V=0;#
local W=1;#while(V<9)#local Q=Y*Y;#local Y=2*X*Y+T;#local
X=X*X-Q+U;#if(X*X+Q>4
)#local W=0;#local V=9;#end#local V=V+1;#end#if(W=1)#local
S=2;#while(S+3)#if(S
-1)box{0,.02 pigment{rgb 9}translate<T-S,U+1,6>}#end#local
S=S-1;#end#end#local
U=U+.03;#end#local T=T-.05;#end//TM

The macro didn't help, although I thought it would...

#local T=2;#while(T+2)#local U=-2;#while(U<2)#local Y=T;#local X=U;#local
V=0;#
local W=1;#macro A(B,C)#local B=C;#end##while(V<9)#local
Q=Y*Y;A(Y,2*X*Y+T);A(X
,X*X-Q+U);#if(X*X+Q>4)A(W,0);A(V,9);#end A(V,V+1);#end#if(W=1)#local
S=2;#while
(S+3)#if(S-1)box{0,.02 pigment{rgb 9}translate<T-S,U+1,6>}#end
A(S,S-1);#end#end
A(U,U+.03);#end A(T,T-.05);#end//TM

Andrew


"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3d36d337$1@news.povray.org...
> ideally 4*80 max?
>
> #local T=2;#while(T>-2)#local U=-2;#while(U<2)#local Y=T;#local X=U;#local
V=0;
> #local W=1;#while(V<9)#local Z=X;#local X=X*X-Y*Y;#local Y=2*Z*Y;#local
X=X+U;
> #local Y=Y+T;#if(X*X+Y*Y>4)#local W=0;#local V=9;#end#local
V=V+1;#end#if(W=1)
> #local S=-2;#while(S<3)#if(S!=-1)box{0,.02 pigment{rgb
9}translate<T+S,U+1,6>}
> #end#local S=S+1;#end#end#local U=U+.03;#end#local T=T-.05;#end//TM
>
>
>


Post a reply to this message

From: Warp
Subject: Re: Can anyone shorten this sig?
Date: 18 Jul 2002 13:23:46
Message: <3d36f9a2@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:
> #local T=-2;#while(T<2)#local U=2;#while(U>-2)#macro M(X,Y,V,W)#while(V<9)#local
> Z=X;#local X=X*X-Y*Y+U;#local Y=2*Z*Y+T;#if(X*X+Y*Y>4)#local W=0;#end#local V=V+
> 1;#end#if(W)#macro L(S)box{0,.02 pigment{rgb 9}translate<T+S,U+1,6>}#end L(-2)L(
> 0)L(1)L(2)#end#end M(-U,-T,0,1)#local U=U-.03;#end#local T=T+.05;#end//Tom Melly

  Of course you could do it this way. Besides being shorter, it's quite
faster:

#macro L(S)box{0,.02pigment{rgb 9}translate<T+S,U+1,6>}#end#local M=function
{pattern{mandel 9}}#local T=-2;#while(T<2)#local U=2;#while(U>-2)#if(M(U,T,0
)=1)L(-2)L(0)L(1)L(2)#end#local U=U-.03;#end#local T=T+.05;#end//Tom Melly


-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Tom Melly
Subject: Re: Can anyone shorten this sig?
Date: 18 Jul 2002 17:37:50
Message: <3d37352e@news.povray.org>
"Ron Parker" <ron### [at] povrayorg> wrote in message
news:slr### [at] fwicom...

> Parse time is slightly worse, because I removed the short-circuit on the
inner
> (V) loop, but the results are the same...
>
> #local T=-2;#while(T<2)#local U=2;#while(U>-2)#macro
M(X,Y,V,W)#while(V<9)#local
> Z=X;#local X=X*X-Y*Y+U;#local Y=2*Z*Y+T;#if(X*X+Y*Y>4)#local
W=0;#end#local V=V+
> 1;#end#if(W)#macro L(S)box{0,.02 pigment{rgb 9}translate<T+S,U+1,6>}#end
L(-2)L(
> 0)L(1)L(2)#end#end M(-U,-T,0,1)#local U=U-.03;#end#local T=T+.05;#end//Tom
Melly
>

Looking at this in detail, the use of a constant passed to a macro puzzled
me, until I realised it saves on #locals. It makes sense if you can save on
2 or more of 'em.


Post a reply to this message

From: Tom Melly
Subject: Re: Can anyone shorten this sig?
Date: 18 Jul 2002 17:38:54
Message: <3d37356e$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3d36f9a2@news.povray.org...
>
>   Of course you could do it this way. Besides being shorter, it's quite
> faster:

<snip>

cheater....


Post a reply to this message

From: Warp
Subject: Re: Can anyone shorten this sig?
Date: 18 Jul 2002 17:56:16
Message: <3d37397e@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
> cheater....

  Why using a builtin function is cheating?-)

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Tom Melly
Subject: Re: Can anyone shorten this sig?
Date: 19 Jul 2002 04:49:30
Message: <3d37d29a$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:3d37397e@news.povray.org...
> Tom Melly <tom### [at] tomandlucouk> wrote:
> > cheater....
>
>   Why using a builtin function is cheating?-)
>

It's like using a bottom double.


Post a reply to this message

Goto Latest 10 Messages Next 6 Messages >>>

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