![find center of mass in solidworks with respect to a point find center of mass in solidworks with respect to a point](https://i.ytimg.com/vi/QNTehl6wOsU/maxresdefault.jpg)
- #Find center of mass in solidworks with respect to a point how to
- #Find center of mass in solidworks with respect to a point plus
If the vector is pointing away from the reference point, it is then positive volume or inside the part. If the normal created by the triangle (following the right hand rule going from point 1, 2, 3) points towards our common reference point, that volume will be calculated as not part of our overall solid, or negative volume (by pointing towards, i mean the vector created by the triangle's normal is pointing loosely towards the same side as a normal plane created by the vector from our reference point to the centroid of the tetrahedron). The fourth point would be our common origin.
![find center of mass in solidworks with respect to a point find center of mass in solidworks with respect to a point](https://www.codestack.net/solidworks-api/document/assembly/components/get-cog/mass-property.png)
Using the determine method to calculate the volume, the first three coordinate points will represent the three points of our triangle. we can use this to our advantage by allowing us to have a consistent convention in which to determine if a volume of the tetrahedron should be added or subtracted from our net part (this is because the reference point we chose may not necessarily be inside the part and the overall part is not necessarily convex, it is, however a closed object). The trick here is that due to the way the STL file is created, the triangles have a normal that point outwards from the part surface, following the right hand rule of the 3 verticies used to create the triangle. The centroids of each of the tetrahedrons is simply the average of the 4 points. We calculate volumes using the determinate method shown here (equation 32): We sum the moments and divide by total volume to get our overall centroid. We calculate the volumes and centres of masses and multiply them by each other to get our moments.
#Find center of mass in solidworks with respect to a point how to
The problem with this is that I don't know how to convert a surface representation of triangles into a volume representation of tetrahedrons (I'm assuming its a fairly non trivial task).ĭose anyone know of any methods or can think up of any methods that I could try? Or maybe even any reference material that talks about this?įor more information about STL files (only the first 2 sections are important, everything else is useless): Īfter a lot of thinking and experimentation I have the answer!įirst we add a 4th point to each triangle in to make them into tetrahedrons with a volume centroid.
![find center of mass in solidworks with respect to a point find center of mass in solidworks with respect to a point](https://www.cati.com/wp-content/uploads/2017/03/SOLIDWORKS-1488403786983-3.png)
Form that I could calculate the centre of mass of each tetrahedron, its volume, and resulting moment and thus calculate the overall centre of mass from the sum of all tetrahedrons. This would work but its far from elegant and extremely slow.Īnother method would be to convert the boundary representation into a number of packed tetrahedron solids. One simple approach would be to divide a volume (in this case, a box) into millions of elements and determine if each element is inside the object defined in the STL file or not, then sum up the moments and calculate the centre of mass. There is nothing that links each triangle to one another, it is assumed that the object is closed.
![find center of mass in solidworks with respect to a point find center of mass in solidworks with respect to a point](http://3.bp.blogspot.com/-YYakw8l_8rM/UQFZFHV1I4I/AAAAAAAAAqo/uFW_Tndmsxg/s1600/mass3.jpg)
#Find center of mass in solidworks with respect to a point plus
The triangles themselves are not necessarily in any order, the file is simply the coordinates 3 vertices of each triangle floating in 3D space plus a normal vector to the triangle (the normal should be disregarded as it is not always done properly). The STL file contains a closed object (or objects) defined by a boundary made of triangles. I am trying to calculate the centre of mass (x,y,z) coordinates of an object defined in an STL file (stereo lithography, not to be confused with the standard template library).