Print warning and default to computing mesh inertia from convex hull if volume is negative (malformed mesh).

PiperOrigin-RevId: 526053615
Change-Id: I3974b3433da513f869b1bdab5e98232e215f6509
This commit is contained in:
Alessio Quaglino
2023-04-21 09:00:43 -07:00
committed by Copybara-Service
parent a2a1ac9fc2
commit 3db483c248
3 changed files with 47 additions and 22 deletions
+4
View File
@@ -523,6 +523,10 @@ class mjCMesh: public mjCBase {
void RemoveRepeated(void); // remove repeated vertices
void CheckMesh(void); // check if the mesh is valid
// compute the volume and center-of-mass of the mesh given the face center
void ComputeVolume(double CoM[3], mjtMeshType type, const double facecen[3],
bool exactmeshinertia);
// mesh properties that indicate a well-formed mesh
std::pair<int, int> invalidorientation; // indices of invalid edge; -1 if none
bool validarea; // false if the area is too small