Volume calculator

General discussion about the development of the open source Blender

Moderators: jesterKing, stiv

Post Reply
Antares
Posts: 0
Joined: Fri Nov 14, 2003 4:04 pm

Volume calculator

Post by Antares »

If just finished the first version of a volume calculator, which uses VRML files.
Perhaps you want to test it:

http://www.silentthunder.de/files/svcalc.exe

The next days i will include a surface calulation as well, but currenlty i am just too tired icon_frown.gif

Some notes on this programm:
1.Usage: PROGRAMM VRMLFILE STEP
where step is a floating point unit and is meant for the size of cubes which will "fill" the mesh
2.The programm is designed for konvex meshes
3.I havent done any optimisations yet, thus only LOW POLY models < 5000 faces should be used.
4.Extremley low poly models give wrong values, especially if they have sharp edges.
5.Export only meshes (no materials, no lamps, ...). I havent included a lot options in my parser yet :(
6.ALL NORMALS HAVE TO POINT OUTSIDE !!!

Perhaps somebody will find it usefull. I've done some testing and with the right settings (step+mesh) it is about 98% accurat. Enough for a general volume information i guess.

z3r0_d
Posts: 289
Joined: Wed Oct 16, 2002 2:38 am
Contact:

Post by z3r0_d »

umm, I hope this doesn't disappoint you

but there is a very nice generic technique [for closed meshes, they don't have to be convex] where you pretty much sum the prisms of each triangle and the origin [which end up negative if the verts go a different way].

a search didn't reveal that particular thread though

I did find http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html

iirc it was the determinant of the 3 points

ah, here we go:
http://www.gamedev.net/community/forums ... _id=279606
[see last post]

Antares
Posts: 0
Joined: Fri Nov 14, 2003 4:04 pm

Post by Antares »

Thanx for those links
It's no problem :) This programm was mainly meant for practice and i wanted to share it, that's all.

I tested one of my own idea how to calculate the volume, but of there are better ones, then i should use those ^^

EDIT:
i just implemented what that guy in the last post (link) suggested and it works great
Thanx again :)

EDIT 2:
i am so proud :lol: (preview):
Image

Post Reply