compute_stats

giant.ray_tracer.utilities:

giant.ray_tracer.utilities.compute_stats(tris, mass)[source]

Compute statistics on a shape tessellated using Triangles.

The statistics computed include the center of mass, total volume, surface area, Inertia matrix, center of mass relative inertia matrix, moments of inertia, and rotation matrix to the inertia frame. These are only valid for mostly-regular bodies, where the tetrahedrons formed by connecting each face to the center of figure of the shape is contained entirely within the shape.

Parameters:
  • tris (Triangle64 | Triangle32) – The GIANT triangle objects to compute the statistics on

  • mass (Real) – The mass of the object in kg

Returns:

A tuple of the statistics in the order mentioned above

Return type:

Tuple[ndarray, float, float, ndarray, ndarray, ndarray, ndarray]