How to get corresponding coordinates of vertices in a 3D volume after voxelisation?

4 Ansichten (letzte 30 Tage)
I use Mesh Voxelisation to voxelise a triangular-polygon mesh. The mesh contains faces and the coordinates of vertices. My question is after voxelisation, how to find the corresponding coordinates of the vertices in the volume?
For example, if the original coordinate of the vertex is (-0.4,-0.26,0.5), how can I get the corresponding coordinate (16,69,196) in the volume. I tried to locate the original coordinates in the output gridX, gridY and gridZ, but the corresponding values in the gridOUTPUT are not always equal to 1.

Akzeptierte Antwort

Matt J
Matt J am 7 Apr. 2023
Bearbeitet: Matt J am 7 Apr. 2023
Perhaps as follows,
fcn=(z,g)interp1(g,1:numel(g),z);
i=fcn(v(1),gridCOx); %v is vertex coordinate in the original space
j=fcn(v(2),gridCOy);
k=fcn(v(3),gridCOz);
  6 Kommentare
Huahua
Huahua am 7 Apr. 2023
I got it. Thank you very much. One of my research scenarios is to describe local surface on a volume using descriptors with invariant properties. After rotating the object and regenerating the volume, I would have liked to experiment with the vertices before and after the rotation, but I cannot now guarantee that the value of the vertex in gridOUTPUT is always equal to 1, and probably not for the other surface points either. I wonder if you have a suggestion.
Matt J
Matt J am 8 Apr. 2023
Bearbeitet: Matt J am 8 Apr. 2023
I got it. Thank you very much.
You're welcome, but please Accept-click the answer if your question has been addressed.
After rotating the object and regenerating the volume, I would have liked to experiment with the vertices before and after the rotation
It's not clear to me why you need a voxelization for that. It should be clear what happens to the vertices after a rotation of the volume. The vertices should move to new locations that should be easily predictable with a 3x3 rotation matrix. It would probably be better to elaborate on what you are doing in a new post.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by