Out of curiosity, I did some more google searches, and learned more.
CVolume2 by Max calculates the volume of 3D objects, and their center of mass, assuming uniform density.
(I'll assume that the calculation is correct, but this should be verified for critical situations.)
So CVolume2 would be used once for material1, and again for material2.
Given materia1 has density 1 unit, the relative density for material2 would be needed, to adjust the volume of material2 up or down by the mass ratio.
material2 can then be replaced by a solid, say a cube of the adjusted volume, centered on its cg.
material1 can stay the same, or be replaced by a cube of the same initial volume1.
Then run CVolume2 on the two new cubes, to find the combined cg.
----------
Centroids can be calculated by geometric decomposition.
A hole or void or missing 3D triangle, say of the edge taper, is considered to have negative mass.
Choose x-axis, y-axis, and z-axis, so the origin of the frame may as well be located at the desired cg.
The cg formula can be decomposed into x, y, and z formulas. Vectors can be used for the distances, and each distance could be either positive or negative.
The goal is to have the distance R from the desired cg be zero.
0 = R = (1/(total mass)) * Sum from 1 to n of (mass(i) * rDistance(i))
If R does not equal zero, grind off mass, or add mass, until R = 0.
A list of some good references:
http://www.splung.com/content/sid/2/page/centre_of_mass
https://en.wikipedia.org/wiki/Center_of_mass
https://en.wikipedia.org/wiki/Centroid
https://en.wikipedia.org/wiki/List_of_centroids
http://www.simscrane.com/how-determine-center-gravity-any-load/
http://ruina.tam.cornell.edu/Book/COMRuinaPratap.pdf
http://ims.co.il/download/How%20to%20calculate%20the%20Center%20of%20Gravity.pdf
Throwing also yields some interesting information.
Maybe CVolume2 could be changed to adjusting the mass of different objects...
- Brian