필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How can I set a value/define a function for the values contained within a patch object?

조회 수: 2 (최근 30일)
sbean320
sbean320 2017년 7월 12일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello,
I've made a cube using patch:
a = .1; % dimension of cube side
vert = [0 0 0; 0 a 0; a a 0; a 0 0; 0 0 a; 0 a a; a a a; a 0 a];
fac = [1 2 3 4; 2 6 7 3; 4 3 7 8; 1 5 8 4; 1 2 6 5; 5 6 7 8];
patch('Vertices', vert, 'Faces', fac, 'FaceColor', 'c');
view(3)
I'd like to set a value or define a function for the area bounded inside this cube and along the edges. Any suggestions would be appreciated!
Thanks! Sbean320
  댓글 수: 2
Steven Lord
Steven Lord 2017년 7월 12일
Can you say a little more about how you would use a value or function that you set on this patch? You could set and query the UserData property of the patch, but there may be another approach that makes whatever you plan to use that data for easier to implement.
sbean320
sbean320 2017년 7월 13일
I was planning to have an incident wave interact with the cube, but I think I've determined a better approach. Thank you.

답변 (1개)

Walter Roberson
Walter Roberson 2017년 7월 13일
Probably you should look at something like the File Exchange contribution inpolyhedron to determine whether any particular point of interest is inside or outside the patch.
For the particular case of convex structures, there may be more efficient ways to do some tasks, such as determining whether a traveling particle is going to bump into the shape.
  댓글 수: 2
sbean320
sbean320 2017년 7월 13일
Thank you for the suggestion, Walter. I'll look into it.
Walter Roberson
Walter Roberson 2017년 7월 13일
For the case of a simple cube aligned with the axis, simple coordinate range checks are probably best.

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by