|
![](/i/fill.gif) |
Hi,
so i try to convert a spline to an array 1 dimension
heres is the macro i write and use for it, maybe it'll better for other multiple
dimension...
// convert_spline_array.mcr
// eg:
// #include "convert_spline_array.mcr"
//
//
Convert_spline_array(Traject_Spline,0,141,"circuit_array.inc","Traject_array")
//
//That's it ! It's always a little step ...
#macro Convert_spline_array(spline_name, first_pt, last_pt, output_file_name,
output_array_name)
#declare Nbr_de_points =(last_pt-first_pt)+1;
#fopen Data output_file_name write
#write (Data,"\n\n")
#write (Data,"// ",output_file_name," \n\n")
#write (Data, "// A convert Spline() to array [] made with
convert_spline_array.mcr\n")
#write (Data, "// Author : Albun //Date: 13/01/2012 \n\n\n")
#write (Data, "// \n")
#write (Data, "// \n\n\n")
#write (Data,"#declare ",output_array_name," = array[",Nbr_de_points,"]
{\n") //array initialization
#declare V=first_pt;
#while (V<= last_pt)
#write (Data,spline_name(V)) // array pts
#write (Data,", // ",V,"\n") // nbr of the spline pt
#if (mod(V,4)=0 ) #write (Data, "\n") #end // write 4 pts by 4 pts
#declare V=V+1;
#end
#write (Data,"}\n")
#fclose Data
#end //of macro convert_spline_array.mcr
Bye !
Post a reply to this message
|
![](/i/fill.gif) |