Plotting the iso-surface in a specific range of values

조회 수: 27 (최근 30일)
hamed
hamed 2021년 2월 23일
댓글: hamed 2021년 3월 16일
Hi,
I have a 3D matrix and I want to show the isosurface for a range of values, such as the values greater than 0.2, not for a single value.
Could anybody help me to revise my code?
data = smooth3(porosity_median,'box',5);
p1 = patch(isosurface(data, 0.1 ), 'FaceColor','red','EdgeColor','none');
view(3); axis vis3d tight
camlight; lighting phong

채택된 답변

José M. Requena Plens
José M. Requena Plens 2021년 3월 15일
편집: José M. Requena Plens 2021년 3월 15일
You need ISOCAPS with 'enclose' option.
Using yor code.
To plot values greater than 0.1:
data = smooth3(porosity_median,'box',5);
p1 = patch(isosurface(data, 0.1 ), 'FaceColor','red','EdgeColor','none');
p2 = patch(isocaps(data,0.1,'enclose','above'),'FaceColor','red','EdgeColor','none');
view(3); axis vis3d tight
camlight; lighting phong
To plot values lower than 0.1:
data = smooth3(porosity_median,'box',5);
p1 = patch(isosurface(data, 0.1 ), 'FaceColor','red','EdgeColor','none');
p2 = patch(isocaps(data,0.1,'enclose','below'),'FaceColor','red','EdgeColor','none');
view(3); axis vis3d tight
camlight; lighting phong
And I recommend that you use the ISONORMALS to better graphics.
isonormals(data,p1)
  댓글 수: 5
José M. Requena Plens
José M. Requena Plens 2021년 3월 15일
The value you want to represent must be defined in both patches.
...
p1 = patch(isosurface(data, 0.3 ), 'FaceColor','red','EdgeColor','none');
...
p2 = patch(isocaps(data,0.3,'enclose','above'),'FaceColor','red','EdgeColor','none');
...
hamed
hamed 2021년 3월 16일
Thanks Jose.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

darova
darova 2021년 2월 23일
Use for loop to create several value

카테고리

Help CenterFile Exchange에서 Volume Visualization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by