前往isosurface
。藉助等值面,您將能夠提取包含。如果您還想顯示整個盒子,我建議您執行以下操作:創建一個小盒子(因此在轉換爲等值面時它的面孔很少),然後將其縮放到盒子的實際大小。您可以在下面的代碼中看到這一點:
anomaly = zeros(100,100,100); % The anomaly
an2=zeros(100/10+2,100/10+2,100/10+2); % For plotting pourposes
an2(2:10,2:10,2:10)=1; % Create a 10x10x10 box
for j = 40:60
for jj = 40:60
for jjj=40:60
anomaly(j,jj,jjj)=10;
end
end
end
iso=isosurface(anomaly,5); % Extract surface of inclusion
iso2=isosurface(an2,0.5); % create a box
iso2.vertices=(iso2.vertices-1)*10; % offset(so its in 1-10 range)
% and scaling to be 100x100x100
patch(iso,'facecolor','r','edgecolor','none')
patch(iso2,'facecolor','none');
% this last ones are for having a nicer plot
camlight
axis off
axis equal
表面可以是透明的?我想看看內在的包容。 – sabaaa 2014-10-28 09:38:15
@sabaaa這實際上是內在包容。讓我編輯答案。 – 2014-10-28 09:59:06
@sabaaa現在呢?它正在爲你的數據工作? – 2014-10-28 16:32:46