#macro _ikn_spline (_ikn_sv) // macro that calculates spline positions +pow(1-_ikn_sv,3)*_ikn_2 +pow( _ikn_sv,3)*_ikn_3 +pow(1-_ikn_sv,2)*3* (_ikn_sv )*(2*_ikn_2-_ikn_1) + (1-_ikn_sv )*3*pow(_ikn_sv,2)*(2*_ikn_3-_ikn_4) #end #declare _ikn_length = vlength(ikn_p1-ikn_p2); // the length between the startpoint and the endpoint #declare _ikn_linklength = ikn_length/ikn_links; // the length of each "link" #declare _ikn_1 = vnormalize(ikn_v1)*_ikn_length/2+ikn_p1; // startnormal is made non-relative to startpoint. #declare _ikn_2 = ikn_p1; #declare _ikn_3 = ikn_p2; #declare _ikn_4 = vnormalize(ikn_v2)*_ikn_length/2+ikn_p2; // endnormal is made non-relative to endpoint. // Creates an array with link positions based on a spline. #declare _ikn_spos = array[ikn_links] #declare _ikn_x = 0; // counter for the #while loop just below. #while (_ikn_x}} #declare _ikn_x = _ikn_x+1; #end #declare _ikn_cpos = array[ikn_links] // array that stores the changes between the calculations. #declare _ikn_opos = _ikn_spos // array that stores the updated points after each calculation. // Optimizes the link positions. #declare _ikn_x = 0; // counter for the #while loop just below. #while (_ikn_x}} #declare _ikn_x = _ikn_x+1; #end