Create a 3D patch faces matrix from vertices matrix
Mostrar comentarios más antiguos
Hello,
im trying to convert 2D patches to 3D patches (extrude the 2D poligon) . for that purpose i already have a vertices matrix but im trying to build the faces matrix as said in the MATLAB documentation, but i cant follow the logic for 'n' lines polygon, (for example a star shape) . im looking for a function that gets the left matrix and returnes the right matrix. many thanks to the helpers

4 comentarios
KSSV
el 17 de Jun. de 2020
Attach/ copy the data .... image snippet will not help us to help you.
Guy Trakht
el 17 de Jun. de 2020
KSSV
el 17 de Jun. de 2020
Where are the connections?
Guy Trakht
el 17 de Jun. de 2020
Respuesta aceptada
Más respuestas (1)
KSSV
el 17 de Jun. de 2020
Are you looking for something like this?
data = [-0.293 -0.404 0;
-0.475 0.154 0;
0 0.5 0;
0.475 0.154 0;
0.293 -0.404 0;
-0.293 -0.404 1;
-0.475 0.154 1;
0 0.5 1;
0.475 0.154 1;
0.293 -0.404 1]
%% the first 5 rows are the bottom vertices , the last 5 are the upper
x = data(:,1) ; y = data(:,2) ; z = data(:,3) ;
yi = linspace(min(y),max(y),10) ;
zi = linspace(min(z),max(z),10) ;
[Y,Z] = meshgrid(yi,zi);
X = griddata(y,z,x,Y,Z) ;
surf(X,Y,Z)
1 comentario
Guy Trakht
el 17 de Jun. de 2020
Categorías
Más información sobre Polygons en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!