2 pièce(s) jointe(s)
Patch isosurface - comportement étrange
Bonjour,
Je travaille sur une figure contenant un patch isosurface.
Le résultat obtenu est assez étrange suivant les différentes manières de créer l'isosurface.
Le volume que je veux représenter est construit comme suit:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
X = min(tempx):0.05:max(tempx);
Y = min(tempy):0.05:max(tempy);
[y,x] = meshgrid(Y,X);
level = 0:99;
DAT = NaN*zeros(length(X), length(Y),length(level));
warning off
for i=1:length(X)
for j=1:length(Y)
k = Z(i,j);
if isfinite(k)==1
DAT(i,j,1:k+1) = rand(1);
end
end
end
DAT = permute(DAT,[2 1 3]);
ind = find(isnan(DAT)==1);
DAT(ind) = 2;
DAT(:,:,1) = 2;
LONG = DAT./DAT;
LAT = DAT./DAT;
DEPTH = DAT./DAT;
LONG = repmat(x,[1 1 length(level)]);
LONG = permute(LONG,[2 1 3]);
LAT = repmat(y,[1 1 length(level)]);
LAT = permute(LAT,[2 1 3]);
DEPTH = repmat(level',[1 size(x,1) size(x,2)]);
DEPTH = permute(DEPTH,[3 2 1]); |
Avec
Code:
1 2
|
p = patch(isosurface(DAT,ISO)); |
J'obtiens la figure testfigure
Avec
Code:
1 2
|
p = patch(isosurface(LONG,LAT,DEPTH,DAT,ISO)); |
J'obtiens la figure testfigure2.
Je ne comprends pas le pourquoi du bug en utilisant LONG,LAT,DEPTH !