|
![](/i/fill.gif) |
POV 3.5 b 9.icl on PII 233 128 MB with NT 4 Sp 6
documentation says about spline specification
#declare IDENTIFIER =spline { [SPLINE_IDENTIFIER] [SPLINE_TYPE] ...
So identifier and type are both optional but can be together.
I checked that when spline S1 is declared and I declare spline S2 as "child" of
S1 but with different type then type declaration is parsed ok but do nothing.
But is is parsed ok so I don't know what is wrong parser, documentation or
engine. Conversion is definetly possible becouse when I force type in spline
calculation instead of definition then it is changed ok.
Below is test scene. Working with it I noticed another bug. I can't pass spline
calculation as macro parameter. To check it uncomment debug line. Works fine
when there is parenthesis around spline in call of VStr().
Playing with it I found also small feature request. I'll send it to p.general.
#version 3.5;
#include "stdinc"
global_settings {
assumed_gamma 1.0
}
camera {
location <0,.5,-4>
direction 1.5*z
right x*image_width/image_height
look_at 0
}
light_source {30*<-1,1,-1> color rgb 1}
background{1}
#declare Points=10;
#declare Radius=.1;
#declare Step=.1;
#macro Force()
#if(force_cubic)
,cubic_spline
#end
#end
#macro Draw(Spline,T,force_cubic) // let's draw spline
union{
#local c=1;
#while (c<=(Points-Step))
// #debug concat(Str(c)," - ",VStr(Spline(c)),"\n")
sphere{Spline(c Force()) Radius}
cylinder{Spline(c Force()),Spline(c+Step Force()),Radius}
#local c=c+Step;
#end
sphere{Spline(Points Force()) Radius}
pigment{color rgb 1}
scale .2
translate T*<.7,.5,1>
}
#end
#macro List() // makes list of points for spline
#local G=seed(0);
#local c=1;
#while (c<=Points)
c,2*<rand(G),rand(G),rand(G)>-1
#local c=c+1;
#end
#end
#local S1=spline{linear_spline List()} // works as expected
#local S2=spline{cubic_spline List()} // works as expected
#local S1a=spline{S1 cubic_spline List()} // type do nothing
#local S2a=spline{S2 linear_spline List()} // type do nothing
#local S1b=spline{S1 cubic_spline } // type do nothing
#local S2b=spline{S2 linear_spline} // type do nothing
#local S1c=spline{S1 3,2*y} // works as expected
#local S2c=spline{S2 3,2*y} // works as expected
Draw( S1 ,-2*x+y , no )
Draw( S2 ,-2*x-y , no )
Draw( S1a , -x+y , no )
Draw( S2a , -x-y , no )
Draw( S1b , 0+y , no )
Draw( S2b , 0-y , no )
Draw( S1c , x+y , no )
Draw( S2c , x-y , no )
Draw( S1c , 2*x+y , yes)
Draw( S2c , 2*x-y , yes)
// ABX
Post a reply to this message
|
![](/i/fill.gif) |