Draw contourslice on patch surface
9 次查看(过去 30 天)
显示 更早的评论
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
2019-8-3
Try to refine mesh of your plane
I attached a simple example (help example modified)
Can you attach your data
16 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!