libigl-python-bindings icon indicating copy to clipboard operation
libigl-python-bindings copied to clipboard

igl.point_mesh_squared_distance produces Error: Numerical issue. Error: invalid solver type

Open kesdogan opened this issue 4 years ago • 0 comments

Hello all,

I am trying to use igl.point_mesh_squared_distance to calculate distances of my mesh points to polylines that I created beforehand. My code works for certain polylines but for others it inexplicably does not work.

_, closest_faces, closest_points = igl.point_mesh_squared_distance(polylines[i], pts, faces)

This is how I use the function.

My arguments are:

polylines[i] = Mx3 numpy array, with each point saved in a numpy array of length 3 and encoded as 3 float values pts = Nx3 numpy array, with each point of the mesh saved in a numpy array of length 3 and encoded as 3 float values faces = Ex3 numpy array with each edge encoded as 3 integers referring to the points that make up one triangle

For some polylines, I get good results, such as below:

Screen Shot 2022-03-09 at 15 25 36

For others however, there Numerical issue and invalid solver type is raised. The results are as follows: Screen Shot 2022-03-09 at 15 25 46

There is no real difference between the two polylines. They both lie on the surface of the mesh.

When I apply a transformation on the points as in the above image, such as this:

points_simple[:,0] *= 1.4, occasionally, no error is raised. However, I still do not get the result I want, as the resulting array for the distances is simply filled with NaNs.

What am I doing wrong, or is the code simply not working?

kesdogan avatar Mar 09 '22 14:03 kesdogan