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