i am trying to the the same thing but that dont work well
The surface orange is the surface i want to cut with the boundar (represented with blue or orange point)
if i gave nan to the orange point the resulte is the colored surface(blue surface), for that i used the scrip below
How can i remove juts part of surface is outside of blue line?
script: x = DD(nf_p,1) ; y = DD(nf_p,2) ; z = DD(nf_p,3)*(-1) ; x0 = min(x) ; x1 = max(x) ; y0 = min(y) ; y1 = max(y) ; N = 100; xl = linspace(x0,x1,N) ; yl = linspace(y0,y1,N) ; [X,Y] = meshgrid(xl,yl) ;
P0 = [x,y] ; V = z ; DF=[DD(fronteira,1) DD(fronteira,2)];s=size(DF); na=nan(s(1),1); P0=[P0;DF];V=[V;na];
F = scatteredInterpolant(P0,V,'natural','none') ; pq = [X(:),Y(:)] ; vq = F(pq) ; Z = vq ; Z = reshape(Z,size(X)) ;