How to Calculate Volume & Surface Area of a loaded OBJ model ?
thanks for your time
How to Calculate Volume & Surface Area ? [Solved]Software: Away3D 4.x |
||
Jackal, Newbie
Posted: 08 January 2013 10:50 PM Total Posts: 10 How to Calculate Volume & Surface Area of a loaded OBJ model ? thanks for your time |
||
Rasterizer, Member
Posted: 09 January 2013 09:56 AM Total Posts: 69 [ # 1 ] Surface area is the sum of surface areas of all triangles. How to calculate a triangle’s area can easily be looked up. Volume is a completely different beast and I don’t think you will calculate it anytime soon without using university-level maths. BUT for extra awesomeness, this works for 3DS MAX: 1, import object into 3DS MAX I’m sure other 3D packages provide their own measurement info as well.
|
||
Jackal, Newbie
Posted: 10 January 2013 12:05 AM Total Posts: 10 [ # 2 ] Thanks for your reply I am trying to get such data at runtime in Away3d because of specific need for a 3d printing costs estimation application As far as i know i need to access raw mesh faces data (coordinates) to calculate the surface area (it should be easy as OBJ files are triangulated) but i don’t know how to reach such raw data As for the volume i am clueless
|
||
Rasterizer, Member
Posted: 10 January 2013 09:35 AM Total Posts: 69 [ # 3 ] After some googling, I was able to find a few examples of how to access vertices. As for the volume, I can’t help at all as I’m not a maths wiz, but maybe some helpful soul at Autodesk would share their solution with you for free or if your project has corporate character you could buy the solution from them. As I said, volume of an irregular object is nothing us mere mortals fiddle with. Even in physics they just use water to calculate it.
|
||
John Brookes, Moderator
Posted: 10 January 2013 01:42 PM Total Posts: 732 [ # 4 ] This will give you the volume of a closed mesh.
//eg
|
||
Rasterizer, Member
Posted: 10 January 2013 01:52 PM Total Posts: 69 [ # 5 ] John, when you say “closed” do you by any chance mean “convex” ?
|
||
John Brookes, Moderator
Posted: 10 January 2013 02:16 PM Total Posts: 732 [ # 6 ] Closed as in you cant get inside the mesh. concave, convex doesnt matter. Should also point out that above is for away 4.0 and assumes only 1 subgeometry.
|
||
Rasterizer, Member
Posted: 10 January 2013 02:51 PM Total Posts: 69 [ # 7 ] That code looks really light for all the possibilities out there. Can’t imagine my (really complex concave) character’s volume to be calculated like this. I really do think this only works for special cases, i.e. convex meshes and with the origin within the mesh, but I will leave the actual proof to someone with better understanding of spatial maths.
|
||
|
||
Rasterizer, Member
Posted: 11 January 2013 11:17 AM Total Posts: 69 [ # 9 ] Jackal, can you confirm that code gives accurate results for complex concave meshes ? Did you test the results against physical measurements ?
|
||
Jackal, Newbie
Posted: 11 January 2013 01:51 PM Total Posts: 10 [ # 10 ] I ve tested a few models, check the included model. 3ds max volume : 27537756.1 Away3d 4 volume : 27537883.74721294 i am not sure if it will behave well with highly complex models. so far it seems accurate enough or at leaset comparable to 3ds max results as long as the mesh is closed and connected and with proper normals. File Attachments test.obj (File Size: 215KB - Downloads: 185) |
||
Rasterizer, Member
Posted: 11 January 2013 02:53 PM Total Posts: 69 [ # 11 ] That’s good news, maybe they both use the same algorithm. However I don’t seem to be able to download that file, clicking on it brings me to a blank page and Save As wants to download a webpage. Maybe you could post an image instead ?
|
||
|
||
Rasterizer, Member
Posted: 11 January 2013 03:40 PM Total Posts: 69 [ # 13 ] Got it, thank you! Sorry to be this inquisitive, but I’m interested in this subject myself.
|
||
Jackal, Newbie
Posted: 12 January 2013 03:33 AM Total Posts: 10 [ # 14 ]
Not at all we are all here to collaborate and help each other i ve sent you a mail with the 3d printer software you can use it to get accurate measurements Most of the time the model volume is lower (10%~35%) without the support material volume, i think it depends on many factors like printing resolution, the filling being solid or sparse ..etc
|
||
|