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 Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by