I have 2 models of an object which were taken by 4 months diffrence.
I did alignment by points. Now I am looking for a way to calculate the wear between each section on models.
Can anybody help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The max, min & RMS distance values are reported in the log window in the lower right (make sure that the layer dialog is turned on). The filter also creates vertex quality values, which are the computed distance values.
If you are trying to access the raw distance values, I think you would need to save the mesh in ply format, with the vq values, and extract these from the file with another program, such as plyfile. It all depends on what you are trying to do with the data.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
we have 2 models of teeth taken with 4 months period.
I should calculate on each tooth each section how much wear in microns are there.
am I on the right path?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I'm understanding correctly, you just want to compute the distance over a portion of the mesh, not the entire mesh, correct?
Here's one possible way you could accomplish this with MeshLab:
Write a selection function to select vertices in your section of interest, i.e. select any vertices that are within certain x, y & z values.
Invert the selection & delete. Essentially you are cutting out your section of interest.
Repeat on the second mesh.
Compute the Hausdorff distance between the meshes and record the distances.
Repeat for any other sections of interest.
This would be extremely tedious to perform by hand; I would recommend scripting it using Python and MLX (disclaimer: I'm the author).
Another way to accomplish this would be to run the Hausdorff distance filter on the whole mesh and save the result as a PLY file, including vertex quality. Read the file using your software of choice (such as plyfile) and process it to read the quality (distance) values for certain x, y & z values, and compute the max, min, etc. distances yourself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
in fact I have problem in this section " process it to read the quality (distance) values for certain x, y & z values, and compute the max, min, etc. distances yourself."
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately I can't think of any other options other than the two I mentioned: either section the models and measure each section separately, or measure the entire model and section the results afterwards.
It sounds like you wish to pursue the second option, which entails extracting the geometry and quality values from a ply file. There are other libraries that can read ply files, such as PyMesh for Python, and others for different languages, however I'm not sure that they will all read MeshLab's per-vertex Quality values. I believe that plyfile can read these values, however I haven't actually used plyfile myself yet. Plyfile will load the mesh into numpy arrays, which I'm also not that familiar with yet.
Once you have your mesh loaded into an array, you would need to iterate through every vertex, and for ones that fall within your desired x, y, z section, read the quality (distance) value. You can then take these values for each section and find the max, min, etc. If you write it correctly, I think you should only need to iterate through the mesh once. Hope that's clear.
I would probably perform this using the first method, since I'm much more familiar with MeshLab & MLX. However, I'd need to write a parsing function to read the Hausdorff distance values from the log in order to make this a practical solution. That's already on my to-do list; if this is something you think you'd use I could try to incorporate it sooner rather than later.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I will try to squeeze it in if I can, but honestly I'm completely swamped at the moment.
If you know Python (and you must, in order to use MLX) then you could write a parsing function yourself. That's the beauty of open source, right? If it helps, you can look at how I currently parse the geometry and topology info in compute.py.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have 2 models of an object which were taken by 4 months diffrence.
I did alignment by points. Now I am looking for a way to calculate the wear between each section on models.
Can anybody help?
Sounds like you are looking for "Hausdorff Distance" under "Sampling".
yes.but how to get the values out of it?
the hausdorrf distance just shows like a heat map. I need the values.
The max, min & RMS distance values are reported in the log window in the lower right (make sure that the layer dialog is turned on). The filter also creates vertex quality values, which are the computed distance values.
If you haven't already, you may want to review this article: http://meshlabstuff.blogspot.com/2010/01/measuring-difference-between-two-meshes.html
If you are trying to access the raw distance values, I think you would need to save the mesh in ply format, with the vq values, and extract these from the file with another program, such as plyfile. It all depends on what you are trying to do with the data.
we have 2 models of teeth taken with 4 months period.
I should calculate on each tooth each section how much wear in microns are there.
am I on the right path?
If I'm understanding correctly, you just want to compute the distance over a portion of the mesh, not the entire mesh, correct?
Here's one possible way you could accomplish this with MeshLab:
This would be extremely tedious to perform by hand; I would recommend scripting it using Python and MLX (disclaimer: I'm the author).
Another way to accomplish this would be to run the Hausdorff distance filter on the whole mesh and save the result as a PLY file, including vertex quality. Read the file using your software of choice (such as plyfile) and process it to read the quality (distance) values for certain x, y & z values, and compute the max, min, etc. distances yourself.
Thank you Tim.
Any better options? i can not even install plyfile on python to use it.
Mohammad,
Unfortunately I can't think of any other options other than the two I mentioned: either section the models and measure each section separately, or measure the entire model and section the results afterwards.
It sounds like you wish to pursue the second option, which entails extracting the geometry and quality values from a ply file. There are other libraries that can read ply files, such as PyMesh for Python, and others for different languages, however I'm not sure that they will all read MeshLab's per-vertex Quality values. I believe that plyfile can read these values, however I haven't actually used plyfile myself yet. Plyfile will load the mesh into numpy arrays, which I'm also not that familiar with yet.
Once you have your mesh loaded into an array, you would need to iterate through every vertex, and for ones that fall within your desired x, y, z section, read the quality (distance) value. You can then take these values for each section and find the max, min, etc. If you write it correctly, I think you should only need to iterate through the mesh once. Hope that's clear.
I would probably perform this using the first method, since I'm much more familiar with MeshLab & MLX. However, I'd need to write a parsing function to read the Hausdorff distance values from the log in order to make this a practical solution. That's already on my to-do list; if this is something you think you'd use I could try to incorporate it sooner rather than later.
Could you please incorporate it sooner?
when?
I will try to squeeze it in if I can, but honestly I'm completely swamped at the moment.
If you know Python (and you must, in order to use MLX) then you could write a parsing function yourself. That's the beauty of open source, right? If it helps, you can look at how I currently parse the geometry and topology info in compute.py.
I am not that advanced in python. where can i look at how you parse the geometry?
In the compute.py module, see the functions parse_geometry & parse_topology.