patchm vertex ordering?

2 次查看(过去 30 天)
William
William 2012-4-23
Here I have two triangles with vertices resting on the unit sphere, specified in clockwise order looking at the outer surface of the sphere. Plotting vgood with patchm gives the expected result, a triangle in the projected map. However, vbad is interpreted as the inverse, a polygon covering the entire globe, leaving the triangle as a hole.
Given that both triangles have the same vertex ordering, I would expect them to have the same behavior. What's the problem here?
vbad = [ ...
-0.6375993113323332 -0.20403949778403738 -0.7428559763053484; ...
-0.8500194502416963 0.09199320574455130 -0.5186561330088028; ...
-0.8113166555881062 -0.28694517808882358 -0.5093405041196936];
vgood = [ ...
-0.6375993113323332 -0.20403949778403738 -0.7428559763053484; ...
-0.6518705906365251 0.19086859353491015 -0.7339168298010295; ...
-0.8500194502416963 0.09199320574455130 -0.5186561330088028];
% convert to lat/long
llbad = [-acos(vbad(:,3)) atan2(vbad(:,2),vbad(:,1))]*(360/(2*pi));
llbad(:,1) = llbad(:,1)+90;
llgood = [-acos(vgood(:,3)) atan2(vgood(:,2),vgood(:,1))]*(360/(2*pi));
llgood(:,1) = llgood(:,1)+90;
axesm pcarree;
patchm(llbad(:,1), llbad(:,2), 'FaceColor', 'r', 'EdgeColor', 'k');
patchm(llgood(:,1), llgood(:,2), 'FaceColor', 'g', 'EdgeColor', 'k');
  1 个评论
William
William 2012-4-24
Looks like this is a bug, there is a bug report on this same issue that is claimed to be fixed in 2010b, however I'm using 2011a and I am having the same problems.
http://www.mathworks.com/support/bugreports/641390

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by