Azzera filtri
Azzera filtri

Find Face for Vertex Meshes: Index in position 2 exceeds array bounds (must not exceed 1).

2 visualizzazioni (ultimi 30 giorni)
Capture.JPG
Let's say i must find the face that contain v0 in the vertex list, i already written the algorithm to find the face by find the vertex location on the face list
but the problem, i don't know how to do loop for v1,v2,v3,etc. I don't know because i am not sure how big the data face on the vertex.
Example, let see vertex list first, on v0-v7 it has 7 faces each, but for v8-v9 it has only 4 data
So i was trying write this code, it can be find the face value, but i can not find v1-v9 because the data size keep changing
%Vertex List
[u1,v1] = size(vertex); %size vertex
[loopendX,loopendY] = size(p); %size of face in the vertex list
FaceList = cell(1,loopendX); %i want to draw the array here, but i know here the the array will not same for each loop, this part i confuse)
for ii=1:loopend
for iy=1:u1
[p,s] = find(face==ii); %this one my way to find the face by find the vertex location on the face list
FaceList(ii:1) = mat2cell(p(:,1)); %i am trying to rewrite the face on the vertex list
end
end
VertexList = [vertex(:,1) vertex(:,2) vertex(:,3) FaceList];
Error:
Index in position 2 exceeds array bounds (must not exceed 1).
Error in InputRankRGB (line 81)
FaceList = cel(1,loopendX);
How to fix this? thanks

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by