How to plot a surface in 3D space from 4 points

Hello, I would like to plot a flat, vertical, surface in Matlab that is passing through the points A=(3.5,0,0), B=(0,8.59,0), C=(3.5,0,100), D=(0,8.59,100). Could you please help me with this? Thank you, K.

 채택된 답변

KSSV
KSSV 2017년 8월 7일
편집: KSSV 2017년 8월 8일

1 개 추천

A=[3.5,0,0] ;
B=[0,8.59,0] ;
C =[3.5,0,100] ;
D = [0,8.59,100] ;
coor = [A ; B; D; C ] ;
fill3(coor(:,1),coor(:,2),coor(:,3),'r', 'FaceAlpha', 0.5)

댓글 수: 4

Hello, Thanks, it works. I would just like to ask something additional. Is there a way to make this surface transparent? I tried the 'FaceAlpha','0.5', but it does not work.
Thanks
KSSV
KSSV 2017년 8월 7일
doc alpha...
This works fine under R2016b:
fill3(coor(:,1),coor(:,2),coor(:,3),'r', 'FaceAlpha', 0.5)
Please explain, what "does not work" mean.
Thanks. It works. Probably I was applying it in a wrong way and it was showing me an error.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

John BG
John BG 2017년 8월 7일

2 개 추천

Hi Katerina
while
A=[3.5,0,0]
B=[0,8.59,0]
C=[3.5,0,100]
D=[0,8.59,100]
P=[A;B;C;D]
X=P(:,1);Y=P(:,2);Z=P(:,3);
h1=patch('XData',X,'YData',Y,'ZData',Z,'EdgeColor','green','FaceColor',[.2 .8 .2],'LineWidth',2)
.
delivers a bow tie .
.
if you swap points order, B with A .
P=[B;A;C;D]
.
.
then one gets the sought flat vertical surface.
if you find this answer useful would you please be so kind to consider marking my answer as Accepted Answer?
To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote link
thanks in advance
John BG

댓글 수: 3

Adam
Adam 2017년 8월 8일
Comment from Katerina F, originally in a flag:
'this answer shows the width of lines too'
Please add comments in the comments box, not as a flag. Flags are for reporting spam or other problems for forum editors or Mathworks staff to look at and resolve.
John BG
John BG 2017년 8월 8일
so what was the comment?
Adam
Adam 2017년 8월 9일
It is in bold in my comment.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

질문:

2017년 8월 7일

댓글:

2017년 8월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by