## spline interpolation of surface in 3D

### spline interpolation of surface in 3D

Hello,

I am trying to model a closed surface in usual xyz space.
Data are given by x,y and z. x and y are gridded, and z
gives the third coordinate: z(x(i),y(j)) is eighter zero or
double valued, i.e. the surface is not defined over all
the rectangular region.
The problem with using simply the splines toolbox function

csape({x,y},z,'periodic')

is that this function needs an equal number of z components
over the whole rectangular (x,y) region.

Is there a workaround?
How can I interpolate the whole surface?

Thanks for help

Stefan

--
Stefan Stoll                Fon (1) 632 61 39
Physical Chemistry Lab      Fax (1) 632 10 21

hi

i need to create a bivariate cubic Bspline interpolation to a
_topologically_ rectangular grid of data, being control polygon points of
a CAD patch which is highly 3D, and not _geometrically_ rectangular.

(.mat file has data as 3 matrices - xcoords mtx, ycoords mty, zcoords mtz)

however the demo TSPDEM.m only details this for _geometrically_
rectangular data, which in addition has (x,y) mapped to the unit square.

i can't work out the solution - some of the problems i have are as
follows:

a)      the bivariate interpolation

SPAPI({KNOTS1,...,KNOTSm},{X1,...,Xm},Y)

seems to assume that X1,Xm are geometrically perpendicular. how do
i account for the fact that my surface parametric directions are not
aligned with (x,y)?

b)      to obtain the 2 knot vectors, i have to use chord-wise normalised
parameterisation on each line of u=const, v=const points. i then take as
the u or v knot sequence the average of the knot sequences for u=const &
v=const.

for i=1:nu,

coefv(:,:,:,i) = [mtx(i,:);mty(i,:);mtz(i,:)];
ddv = diff(coefv(:,:,:,i)')'
tv(i,:) = cumsum([0,sqrt([1 1 1]*(ddv.*ddv))])
tv(i,:) = tv(i,:)/tv(i,nv)
lt = length(tv(i,:));

kv = kv + [0,0,0,(optknt(tv(i,:),3)),1,1,1]

end

knotsv = kv/nu

spv(i) = spapi(knotsv,tv(i,:),mtz)

%similar for u-direction

if i try and use the subsequent knotsu,knotsv vectors in SPAPI
with {X1..Xm} = {coefu,coefv} and Y = mtz, i get [any number of] errors.

c)      if i try and use SPCOL to gain the collocation matrix and then
construct the bivariate spline values 'by hand', i have problems with TAU
since my KNOTS are chord-wise normalised vectors but my data TAU isn't.

i would greatly appreciate some ideas.

regards

will kellar

+-------------------------------------------------------------------------+
Mr William P Kellar                        Tel:   +44 1223 3 32869 (day)
Div. A                                            +44 1223 367459  (eve)

Cambridge University Engineering Department
Trumpington Street, Cambridge CB2 1PZ, UK
+-------------------------------------------------------------------------+