function p = spline_solid(c,tau1,tau2,tau3,t1,t2,t3) 
% SPLINE_SOLID: evaluation of a spline solid
% p = spline_solid(c,tau1,tau2,tau3,t1,t2,t3) 
% points p(j1,j2,j3) of a spline with control points c(k1,k2,k3,1:3)
% and knots tau1, tau2, and tau3 at points (t1(j1),t2(j2),t3(j3)) 

[lc1,lc2,lc3,dim] = size(c);
lt1 = length(t1); lt2 = length(t2); lt3 = length(t3);

% evaluate with respect to first parameter
c = reshape(c,[lc1,lc2*lc3*dim]);
c = spline_curve(c,tau1(:),t1(:));
% reorganize c
c = reshape(c,[lt1,lc2,lc3,dim]);
c = shiftdim(c,1);

% evaluate with respect to second parameter
c = reshape(c,[lc2,lc3*dim*lt1]);
c = spline_curve(c,tau2(:),t2(:));
% reorganize c
c = reshape(c,[lt2,lc3,dim,lt1]);
c = shiftdim(c,1);

% evaluate with respect to third parameter
c = reshape(c,[lc3,dim*lt1*lt2]);
c = spline_curve(c,tau3(:),t3(:));
% reorganize c
c = reshape(c,[lt3,dim,lt1,lt2]);
p = shiftdim(c,2);

