hatching a 3d patch object.

3 次查看(过去 30 天)
Leo Simon
Leo Simon 2017-1-4
评论: Leo Simon 2017-1-4
I'm wondering if anybody has built code for adding cross-hatches to a 3D patch object? I see that this task is on Kesh Ikuma's todo list for hatchfill2 but have been unable to find anything on the web that actually does it. I tried to make it work with Neil Tandon's hatchfill but was unsuccessful. Thanks!

回答(1 个)

Jan
Jan 2017-1-4
The hatching is defined in 2D usually. E.g. the pattern is determined by the angle between the X-axis and the lines. How do you want to expand this for the 3D case? What about using the texturemap method of a surface instead of a patch?
  1 个评论
Leo Simon
Leo Simon 2017-1-4
Thanks very much for the suggestion, Jan. Unfortunately, my patches are vertical, as in:
x = [ 1 , 2 , 2, 1 ];
y = [ 2 , 1 , 1, 2 ];
z = [ 0 , 0 , 1 , 1 ];
hPatch = patch(x,y,z,'b');
hPatch.FaceAlpha = 0.2;
grid on
view(3)
So I don't believe I can use a surface plot. I googled around for texturemap, but it doesn't look as though it applies to patches, and, besides, matlab's examples are so far from minimal that it's really hard to understand what's going on with the option setting.
'FaceColor','texturemap'
Can you suggest another way? It doesn't have to be hatching, in particular, I just need something other than a solid color to identify the patch, so that, when I'm talking about my figure in the text, I can refer in to "the something vertical strip" and obviously, color won't work for print copies.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Polygons 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by