|
|
"waggy" <hon### [at] handbasketorg> schreef in bericht
news:web.4c27982b751c630af99d05c80@news.povray.org...
> Jaap Frank wrote:
>>[snip]
>> Because of this a request to Christof Lipka or Thorsten Froehlich;
>> Is it possible to raise the poly shape to power eight?
>> Power seven is just one power to low. If you mesh around with
>> these equations, then it always ends up with power four, eight or even
>> sixteen.
>>
> A power 8 poly works fine in 3.7beta35. (I don't have 3.6 installed in a
> convenient computer right now.)
>
> Beautiful work!
>
> ~waggy
>
> #local a=1;
> #local b=1;
> #local A=4; // Major radius of the swept elipse
> #local B=2; // Minor radius of the swept elipse
> #local tratio=a/b;
>
> #local c21= pow(tratio,4);//ok
> #local c20= 2*pow(tratio,2)*(B*B-a*a);//ok
> #local c19= pow(B*B-a*a,2);//ok
> #local c18= 2*pow(tratio,6) ;//ok
> #local c17= 2*pow(tratio,4);//ok
> #local c16=-2*pow(tratio,4)*( A*A+B*B -3*(B*B-a*a) );//ok
> #local c15=-2*pow(tratio,2)*( A*A-a*a +B*B-a*a -4*(A*B-a*a) );//ok
> #local c14= 2*pow(tratio,2)*( pow(B*B-a*a,2) -2*(B*B-a*a)*(A*A+a*a) );//ok
> #local c13= 2*( (A*A-a*a) * (B*B-a*a) +2*pow(A-B,2)*a*a ) ;//ok?
> unclear
> where closing paren goes
> #local c12=-2*pow(B*B-a*a,2)*(A*A+a*a);//ok
> #local c11= pow(tratio,8);//ok
> #local c10= 2*pow(tratio,6);//ok
> #local c9 = 2*pow(tratio,6)*((A*A-a*a)+(B*B-a*a));//ok
> #local c8 = pow(tratio,4) ;//ok
> #local c7 =-2*pow(tratio,4)*( (A*A+B*B)-3*(A*A-a*a) );//ok
> #local c6 = pow(tratio,4)*( pow((A*A-a*a),2) +pow((B*B-a*a),2)
> +4*(A*A-a*a)*(B*B-a*a) );//ok
> #local c5 = 2*pow(tratio,2)*(A*A-a*a);//ok
> #local c4 = 2*pow(tratio,2)*( pow(A*A-a*a,2) +2*(A*A-a*a)*(B*B+a*a) );//ok
> #local c3 = 2*pow(tratio,2)*( pow(A*A-a*a,2)*(B*B-a*a) +
> (A*A-a*a)*pow(B*B-a*a,2) );//ok
> #local c2 = pow(A*A-a*a ,2);//ok
> #local c1 =-2*pow(A*A-a*a,2)*(B*B+a*a);//ok
> #local c0 = pow(B*B-a*a,2)*pow(A*A-a*a,2) ;//ok
>
> //powers check out ok.
> #declare oval_oval_torus = function(x,y,z) {
> c21* pow(x,4)*pow(y,4)
> +c20* pow(x,4)*pow(y,2)
> +c19* pow(x,4)
> +c18* pow(x,2)*pow(y,6)
> +c17* pow(x,2)*pow(y,4)*pow(z,2)
> +c16* pow(x,2)*pow(y,4)
> +c15* pow(x,2)*pow(y,2)*pow(z,2)
> +c14* pow(x,2)*pow(y,2)
> +c13* pow(x,2)*pow(z,2)
> +c12* pow(x,2)
> +c11* pow(y,8)
> +c10* pow(y,6)*pow(z,2)
> +c9 * pow(y,6)
> +c8 * pow(y,4)*pow(z,4)
> +c7 * pow(y,4)*pow(z,2)
> +c6 * pow(y,4)
> +c5 * pow(y,2)*pow(z,4)
> +c4 * pow(y,2)*pow(z,2)
> +c3 * pow(y,2)
> +c2 * pow(z,4)
> +c1 * pow(z,2)
> +c0
> }
> poly {8,
> <0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> c21,0, 0, 0, 0, c20, 0, 0, 0,
> 0, 0, 0, 0, 0, c19, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, c18, 0,
> 0, c17, 0, c16, 0, 0, 0, 0, 0, 0,
> c15,0, c14, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, c13, 0, c12, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c11,
> 0, 0, c10, 0, c9, 0, 0, 0, 0, c8, 0,
> c7, 0, c6, 0, 0, 0, 0, 0, 0, 0, 0,
> c5, 0, c4, 0, c3, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, c2, 0, c1, 0, c0>
> sturm // Using strum isn't that much slower, and seems nicer.
> texture {
> pigment {
> color rgb <0.8,0.8,1.0>
> }
> finish{
> diffuse 0.3
> ambient 0.0
> specular 0.6
> reflection { 0.8 metallic }
> conserve_energy
> }
> }
> //rotate 90*x
> //translate y*((A+B+a+b)/2 +0.5)
> }
>
>
Wow, I didn.t try it in the beta's. That is excellent!
Now I can go further with things from the nineties!
Jaap Frank
Post a reply to this message
|
|