# generate a plane that has the coordinates of a 3D matrix as its boundary

2 visualizzazioni (ultimi 30 giorni)
Alberto Acri il 2 Ott 2023
Commentato: Alberto Acri il 2 Ott 2023
Hi. I have coordinates of nodes in space ('C'). I would like to generate a plane that has the coordinates of 'C' as an outline.
I am using this code but, as you can see in the figure, the generated 'V_new' plane does not follow the 'C' coordinates exactly. Any suggestions for improving the code?
[~,poly] = freeBoundary(delaunayTriangulation(C(:,1:2)));
[~,loc] = ismember(poly,C(:,1:2),'rows');
V = num2cell([poly,C(loc,3)],1);
V_new = [V{1,1}, V{1,2}, V{1,3}];
figure
patch(V_new(:,1), V_new(:,2),V_new(:,3),'k');
hold on
plot3(C(:,1),C(:,2),C(:,3),'g.','Markersize',20);
axis equal
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Bruno Luong il 2 Ott 2023
Spostato: Bruno Luong il 2 Ott 2023
Why don't you do the very obvious?
patch(C(:,1),C(:,2),C(:,3),'k')
hold on
plot3(C(:,1),C(:,2),C(:,3),'g.','Markersize',20);
axis equal
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Alberto Acri il 2 Ott 2023
I agree with you!

Accedi per commentare.

### Categorie

Scopri di più su Delaunay Triangulation in Help Center e File Exchange

R2021b

### Community Treasure Hunt

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

Start Hunting!

Translated by