hatching a 3d patch object.

7 ビュー (過去 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 Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by