![untitled.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/210338/untitled.jpeg)
Problem using boundary and trisurf functions to create a mesh with three points
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Elena Martín
am 25 Mär. 2019
Beantwortet: John D'Errico
am 25 Mär. 2019
Hi, I am having some difficulties using these functions. I have three points and I would like to create a mesh with them, if I have four points these work perfectly but when I only insert three points boundary returns and empty matrix. I would like to know whats wrong and if there is anyway I can fix it. What I want is to create a surface between those three points, maybe there is another way to do it but I cant figure it out. Thanks!
p(1,1) = -26,9030200000000;
p(1,2) = 74,5056900000000;
p(1,3) = 1,76957800000000
p(2,1) = -31,3498700000000;
p(2,2) = 71,4396500000000;
p(2,3)= 26,4499500000000;
p(3,1) = 26,9030200000000;
p(3,2) = 74,5056900000000
p(3,3) = 1,76957800000000;
k = boundary(p)
hold on
trisurf(k,p(:,1),p:,2),p(:,3),'Facecolor','red','FaceAlpha',1)
%'EdgeColor', 'none')
grid off
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 25 Mär. 2019
You have THREE points, in a 3 dimensional space.
How many points determine a volume in 3-d? 4. Essentially, a tetrahedron in 3 dimensions is as simple as you can get. So if you have only 3 points, they determine a triangle. But they are not sufficient to determine a tetrahedron. And you certainly will not create a boundary surface in 3-d.
If your goal is as simple as creating a surface that spans those 3 points, then this is simple. Just use patch.
patch(p(:,1),p(:,2),p(:,3),'r')
box on
grid on
![untitled.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/210338/untitled.jpeg)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!