Draw contourslice on patch surface

조회 수: 9 (최근 30일)
Nathaniel H Werner
Nathaniel H Werner 2019년 8월 2일
댓글: Nathaniel H Werner 2019년 8월 6일
I am trying to get the XData and YData on a contourslice in matlab. I want this contourline to be on a patch that I have already made in 3D. The patch corresponds to a rectangular plane orthogonal to the -x axis rotated about the y axis from -x by some angle dphi. I have provided some of my code below with images.
AoAd = 45;
Ty = 1/2*cosd(AoAd); % wing position in y
Tz = 1/2*sind(AoAd); % wing position in z
yslice = [Ty, Ty, -Ty, -Ty]+[1/2, 1/2, -1/2, -1/2];
zslice = [-Tz, Tz, Tz, -Tz]+[-1/2, 1/2, 1/2, -1/2];
xslice = -.15;
S = [xslice*ones(size(yslice));
yslice;
zslice];
dphi = 7.5; % degrees
MR = [[cosd(dphi) 0 -sind(dphi) 0];...
[0 1 0 0];...
[sind(dphi) 0 cosd(dphi) 0];...
[0 0 0 1]];
S_prime = MR*[S,[0,0,0]';
[0,0,0,0],1];
x = S_prime(1,1:4);
y = S_prime(2,1:4);
z = S_prime(3,1:4);
figure
hold on
patch(x,y,z,'r')
cc = contourslice(Xw,Yw,Zw,D_ta,z,y,x,[-3,-3],'linear');
Now, I expect the there two be a single iso-line on the red patch. But instead I get several iso-lines that look orthogonal to the red patch. Can I get some help figuring out what I'm doing wrong here.
It seems to me that the smaller region is at least on a parallel plane but I don't know why the others aren't.
Addendum:
I also tried using the XYZ data from patch and this was the result. Still not on the plane, and there are some slices on different planes.
figure
hold on
p = patch(x,y,z,'r');
xp = p.XData;
yp = p.YData;
zp = p.ZData;
cc = contourslice(Xw,Yw,Zw,D_ta,xp,yp,zp,[-3,-3],'linear');
  댓글 수: 2
darova
darova 2019년 8월 3일
Just to clarify: you want to project your data onto red plane?
Nathaniel H Werner
Nathaniel H Werner 2019년 8월 3일
편집: Nathaniel H Werner 2019년 8월 3일
Yes, I am trying to get a volume slice of the data on the red patch. If you can't run the code try using the built in flow or peaks.

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

채택된 답변

darova
darova 2019년 8월 3일
Try to refine mesh of your plane
I attached a simple example (help example modified)
Can you attach your data
  댓글 수: 16
darova
darova 2019년 8월 6일
Maybe you wanted slice of XZ plane? I like it more
img2.png img3.png
Nathaniel H Werner
Nathaniel H Werner 2019년 8월 6일
The right image looks exactly like what I need, the red planes are XY or YZ planes rotated around the Y axis. Does the new Untitled3 script make that figure?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by