GJK error in interpolation between non matching second ordered 3D meshes

With the mesh above, I can reduce the problem to:

import numpy as np


p0 = np.array([44.2919, 39.7508, 18.8208, ]).reshape(-1, 3)
p1 = np.array([46.0659, 38.6251, 16.3637, 50.0992, 42.2408, 19.9752, 44.2764, 42.3867, 18.239, 50.0397, 38.4649, 19.9843, 47.1963, 40.4563, 19.1057, 50.0017, 40.354, 19.9947, 47.1886, 42.3193, 19.1362, 48.0266, 38.5593, 18.2475, 45.1735, 40.495, 17.3336, 48.0415, 40.4456, 18.1963, ]).reshape(-1, 3)
import dolfinx
from dolfinx.geometry import compute_distance_gjk
compute_distance_gjk(p0, p1)

which yields this plot:

import matplotlib.pyplot as plt
import matplotlib
fig = plt.figure(figsize=(8, 8))
ax = fig.add_subplot(projection='3d')
ax.scatter(p0[:,0], p0[:,1], p0[:,2], c='r', marker='s')
ax.scatter(p1[:,0], p1[:,1], p1[:,2], c='b', marker='o')
# 
plt.show()

This makes it very weird that the algorithm fail. I’ll debug further.

1 Like