Fill 3D array with function values at isosurface

3 views (last 30 days)
First we have isosurface:
x=[-10:0.5:10];
[X Y Z]=meshgrid(x,x,x);
P=X.^2+Y.^2-Z.^2;
isosurface(P,1);
I want to calculate some quantity at isosurface points and then change values in the P array in corresponding points. Is there any way to do it ?
For example
x=[-10:0.5:10];
[X Y Z]=meshgrid(x,x,x);
P=X.^2+Y.^2-Z.^2;
q=isosurface(P,1);
x1=q.vertices(:,1);
x2=q.vertices(:,2);
x3=q.vertices(:,3);
p=patch(q);
in=isonormals(P,p);
n1=in(:,1);
n2=in(:,2);
n3=in(:,3);
quiver3(x1,x2,x3,n1,n2,n3);
Can i create regular 41*41*41 (size of P) array where points corresponding to isosurface will have n1 values and other will be arbitrary or interpolated or zeros. i've tried something like
F = TriScatteredInterp(x1,x2,x3,n1);
L=F(X,Y,Z);
but it doesnt seem to work

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!