Kubotek Forum

KeyCreator & KeyCreator Viewer Technical discussion of CAD/CAM and integrated partner products
Subscribe to post
User avatar
Ram - (3/14/2021 9:15:29 PM)
RE:Verify Mass Properties
Hi Soli,

The function takes in an array of bodies and thus returns an array of mass property values.

pause "%d " , adMasses
should be pause "%d " , adMasses[0]


Extract of KXL used in one of our regression tests:

HEntity aBodies[1] = { 6092 } // Array of bodies - only 1 in this case

Double adVolumes[1] // Array of volumes (for each body)
Double adMasses[1] // Array of masses (for each body)
Double adSurfAreas[1] // Array of surface areas (for each body)
Double adCentersOfMass[3] // Total center of mass

VerifyMassProperties aBodies, , , , , 1, adVolumes, adMasses, adSurfAreas, , adCentersOfMass
NoteState

// Volumes
Double adCorrectVolumes[1] = { 2078906.17456 }
AssertArrayEqual adVolumes, adCorrectVolumes, 0.1, "Volumes don't match"

// Masses
Double adCorrectMasses[1] = { 5613.0466713 }
AssertArrayEqual adMasses, adCorrectMasses, 0.001, "Mass doesn't match"


// Areas
Double adCorrectAreas[1] = { 219523.956038 }
AssertArrayEqual adSurfAreas, adCorrectAreas, 0.01, "Surface Areas don't match"

// Centers of Mass
Double adCorrectCM[3] = { -0.000139, 0.000018, 61.570152 }
AssertArrayEqual adCentersOfMass, adCorrectCM, 0.001, "CM does not match"


Login