So basically there will be two paths.
1) The Non-manifold mesh creator will more than likely not be creating a 3D 
print.  Will be okay with the current algorithm.
2) The 3D print modeller will be creating a manifold object and so Origin to 
Center of Mass (volume) should do the improved algorithm.

And I don't think there needs to be a check box or flag indicating which method 
was used.  Non-manifold mesh creators for rigging should be okay with the 
current CoM formula.
As long as the explanation is in the wiki it should be okay.

So something like this:

if (ismanifold(selected.object))
{    origin(selected.object) == new_algorithm_center_of_mass(selected.object);
}
else
      origin(selected.object) == old_algorithm_center_of_mass(selected.object);

return;





________________________________
 From: Brecht Van Lommel <[email protected]>
To: bf-blender developers <[email protected]> 
Sent: Saturday, June 15, 2013 11:38 PM
Subject: Re: [Bf-committers] Blender Center of Mass - Voxel data better 
algorithm?
 

Indeed, you can compute the exact volume of a closed triangle mesh by
summing signed volumes of tetrahedra. The tessellation doesn't even
need to be any good, you can just use one tetrahedron for each
triangle, constructed from the triangle vertices and one other fixed
point (typically the origin).
http://stackoverflow.com/questions/1406029/how-to-calculate-the-volume-of-a-3d-mesh-object-the-surface-of-which-is-made-up

By summing the centers of mass of these tetrahedra, weighted by the
signed volume, then I guess you get the center of mass of the whole
mesh too? I didn't check the math but intuitively it makes sense to
me.

This algorithm does require the mesh to be closed. For non-closed
meshes the fixed point could perhaps be the center of mass as computed
now, that might give a reasonable approximation.

On Sun, Jun 16, 2013 at 5:07 AM, panjz <[email protected]> wrote:
> How about tetrahedron tessellation algorithm? IMO it will produce *exact* 
> result (no mathematical proof because I think it's trivially true ;) Correct 
> me if I'm wrong ) if the density of material is constant. If we only need to 
> calculate center of mass we can allow 'negative' tetrahedron in tessellation, 
> i.e. tetrahedron with negative orientation, hence negative mass. You can look 
> at 2D case, it should be much simpler (triangle tessellation with 'negative' 
> triangle allowed) and the whole idea is same.
>
>> Date: Sat, 15 Jun 2013 23:26:43 +0100
>> From: [email protected]
>> To: [email protected]; [email protected]
>> Subject: Re: [Bf-committers] Blender Center of Mass - Voxel data better      
>>  algorithm?
>>
>> Is the problem different vertex density?
>> I don't know how it is currently implemented, but, if vertex density is the
>> problem, the face's area can weight in with no need for voxel dataset.
>>
>> --
>> Inês Almeida
>> _______________________________________________
>> Bf-committers mailing list
>> [email protected]
>> http://lists.blender.org/mailman/listinfo/bf-committers
>
> _______________________________________________
> Bf-committers mailing list
> [email protected]
> http://lists.blender.org/mailman/listinfo/bf-committers
_______________________________________________
Bf-committers mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-committers
_______________________________________________
Bf-committers mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-committers

Reply via email to