That requires some thinking because it means the calculation has to be run every time the model updates. In assemblies this is especially expensive. So we're thinking through some approaches here.
Surely the Centre of Mass is something that can be calculated on each part (only when it changes), the subsequent assembly just needs to use that pre-calculated data for each part and update based on the parts position and orientation within the assembly, as at the assembly level the parts C of M origin has not changed. The parts mass has not changed (unless you change the material). There is quite a bit of data that doesn't need to be re-calculated
every time you want to see the C of M, if your smart about it, that's already been cached/calculated when the part is saved (for instance) or modified.
As an example, I fly aircraft, I don't calculated the whole C of G before every flight. The empty aircraft already provides me with that pre-calculated (weighed) figure/location. I add fuel, I add passengers, I add baggage. The C of G with me in the pilot seat is already added to the empty weight as my baseline C of G (it has already been calculated once and unless I notice a drastic weight change, I use what I already have).
The point is, I don't have to re-calculate the whole aircraft and all it's constituent parts every time ... they haven't changed!!
Alibre Design needs to do the same with parts and sub-assemblies and use the 'pre-compiled (in developer speak!)' data. Only update
IF it changes and ideally at save time so anything that is dependant on it gets flagged and the re-calculation ripples down the dependency chain ... in the same way a software compiler does.
The only calculation the assembly then needs to sum of all the C of M vectors based and display it!
So the only events that need to trigger re-calculation would be:
- Assembly at load time to see if any part or sub-assembly has been modified.
- When a part or sub-assemblies location/orientation is moved within an assembly.
- When a modified part is saved (captures geometry change, material changes).
- When the user requests a complete re-calculation