For my project, I need to measure the distance between two STL files. I wrote a script that allows reading the files, positioning them in relation to each other in the desired position. Now, in the next step I need to check the distance from one object to the other. Is there a function or script available on a library that allows me to carry out this process? Because then I’m going to want to define metrics like interpenetration area, maximum negative distance etc etc so I need to check first the distance between those objects and see if there is like mesh intersection and mesure that distance. I put the url for the combination of the 2 objects that I want to mesure the distance:
Asked
Active
Viewed 664 times
0
-
Which library are you using to work with STL? `stl`, `numpy-stl`, `pymesh`, `OpenMesh`? – Joe Apr 11 '20 at 17:43
-
https://stackoverflow.com/questions/51476722/intersection-3d-meshes-python – Joe Apr 11 '20 at 17:49
-
How professional do you need your solution to be? How do you define the distance? Closest nodes? Centroid to centroid? – Joe Apr 11 '20 at 17:51
-
Hello Joe. I wrote a script to read ASCII files, separated the information into arrays (normal, vertex 1, vertex 2 and vertex 3 of each triangle) so that I could translate and rotate all points. What I did was "indicate where the sphere should be", such as an assembly process in 3D CAD software (solidworks for example) – Pedro Apr 11 '20 at 21:24
-
Now I need to find a way to check if there is an intersection between meshes (in the position where the sphere is in relation to the other object). This is a job for my thesis in mechanical engineering and I believe it will certainly be through the closest nodes. I have an image (in this url: https://imgur.com/8RBfWaL) that I was sent to the way I should measure .. what I need to determine is that distance between the red dots. Im "new" to coding and im trying to improve day by day. Do you think im capable of making this with some of those libraries? – Pedro Apr 11 '20 at 21:31
-
The orange and blue is a representation of 2 different objects that intersect . This is what they advise me to do (for keep the in the correct way of what I already made): "now start thinking how you determine the distances between the two objects, always from the second in relation to the first (to be objective in the analysis). This way, you will then be able to define various metrics, for example, interpenetration area, maximum negative distance, areas at a given distance". And thank you so much for the attention ! – Pedro Apr 11 '20 at 21:34
-
Perhaps this help: https://stackoverflow.com/a/66717145/7127519 – Rafael Valero Mar 20 '21 at 00:27