vedo_mesh_collisions module

Define functions to study collisions with a Mesh from vedo package.

For that we use the vedo built-in methods.

part_mesh_intersections(origin_segment, end_segment, structure, eps=1e-06)[source]

Get all intersections between particles and complete mesh.

Parameters:
  • structure (vedo.Mesh) – An object with triangular cells.

  • eps (float, optional) – Tolerance, optional. The default is 1e-6.

  • origin_segment (ndarray)

  • end_segment (ndarray)

Return type:

tuple[ndarray, ndarray, ndarray]

Returns:

  • all_collisions (np.ndarray[bool](n, m)) – Indicates where there was collisions.

  • all_distances (np.ndarray(n, m)) – Indicates distances between collisions and origins.

  • impact_angles (np.ndarray(n, m)) – Impact angle of every particle with every mesh cell (is np.nan if there was no collision).