|
|||||||
![]() |
|
|
Thread Tools |
|
||||
|
I have made a little utility from GreyBeard's script, to generate a quantities bill for a project of mine:
http://yorik.orgfree.com/scripts/quantitiesbill.py.txt The scripts calculates length, area or volume of selected objects, depending if they are wire, open or closed meshes, and generates a new text in the text window, in tab-separated format, which you can save and import in a spreadsheet program. I made it for my own use, so maybe it doesn't behave like everyone would like. Also, you need to be very careful when modeling (normals pointing outside, well closed faces, etc), otherwise volumes aren't calculated correctly...
............................................
http://yorik.uncreated.net Last edited by yorik; 05-Jan-07 at 23:01. |
||||
|
#21
|
||||
|
|
|
||||
|
Thanks for sharing this script with us yorik. I've tested it a bit and it works fine with areas and lengths, but i couldn't get it to calculate the volume of any mesh, not even the default cube. According to the script, and from the measure units, the cube should have a volume of 1 cubic meter. But when the script is processing the cube it doesn't recognise it as a closed non-manifold mesh and calculates an area of 8 m. The cube has only one material, (the defautl one) and i do apply size and rotation before running the script...
What do you say? Am i doing something wrong? Am i missing somethig? Thanks again for sharing... EDIT: I was wrong, the script is working just fine. See, the default cube has a side of 2 units, so it has a volume of 8 m^3... But the formatting of the output of the script is wrong - it displays the value of the volume under the area column so it confused me... I also thought that the default cube has a side of 1 unit... My bad... Sorry... Thanks again.... Last edited by Zazu; 06-Jan-07 at 15:09. |
||||
|
#22
|
|
||||
|
Area would normally be thought of as surface area, which should be 24 bu (2x2 for each side, times 6 sides of a cube). Of course, you could think of area as the space inside. Dont ya just love english?
............................................
i<3 Blender, and vandalizing the wiki. My creative website, my public website (in progress), my book, my complete learning Blender video series. and my Vimeo compositing video series. |
||||
|
#23
|
|
||||
|
Zazu: Actually i'm not 100% sure about the volume calculation function, neither is greybeard who wrote the routine... I am still testing, but until now i found that when you have a correctly modeled mesh, the volume function works very well (youŕe right, it's 8 cubic meters). I tried with quite complicated forms, removing pieces, etc... and the volumes are until now always right.
For the tabulation problem, I made it mostly for exporting in a spreadsheet... so each "column" of the text is separated by only one tab. So in your spreadsheet it maps correctly, each value type forms a column. Unfortunately, in the blender text editor, it looks quite strange. Honestly I couldn't find a better idea... The area of that cube is well 24 sq. meters, but if it is closed, the script will calculate its volume and not the area, because it is the behaviour I wanted... Actually I made the script for a bridge project, where most pieces are metallic, and I wanted their volume. Only in certain cases, where volume was not useful, I wanted the area. So I have a way to model according to what kind of use I'll make of the object: "solid" objects I modeled carefully (beams, connection pieces, etc), so I know their exact volume ( and therefore their weight), and more "high-level" objects, like plates, wooden decks, grids, ... are just plane meshes, so I would just get their total area, which is what you need to calculate their prices. And longitudinal objects, like cables, railings, etc... where you want the total length, you just draw the edges, no faces, so you get the total length. It is made for a special type of project, maybe if I begin to use it more often, I'll put more functions in it... In the meantime, if anyone has suggestions, they are welcome...
............................................
http://yorik.uncreated.net |
||||
|
#24
|
|
||||
|
Quote:
![]() GreyBeard |
||||
|
#25
|
|
||||
|
That's a very elegant solution. It's clever and understandable. Good job GreyBeard.
|
||||
|
#26
|
|
|||
|
Thank you ever so much, this is awesome,
but I am a little confused, I do not understand how it deals with meshes that are not "watertight". It can still calculate a volume for a shape that is not totally sealed up, with normals facing out? My specific dilemma is that I am printing (with a 3d printer) my model and could really use a script that calculates the volume of plastic that will be used when the object is printed. In addition, because I am studying architecture and using Blender for architectural models, calculating volume is extremely helpful for material quantity estimations, environmental calculations(heating, etc.). |
|||
|
#27
|
|
|||
|
hm on my two wheeled trash bin i got 82 000 BU so as treated as cm it is like the assumed Volumen of a 80 liter bin (Wheels included) but on my girl model i got something like 38 liters (38 000 BU) which is in contast to her original mass of around 65 to 70 Kilogramms. Maybe eyesockets and mouth opening are the problem or organic models are suffering on mathematical rounding problems (subsurf?).
............................................
Athlon 64 X2 3800+, 4 GB DDR2 800, Nvidia 8400, XP and OpenSUSE 64 11.0 |
|||
|
#28
|
|
||||
|
lexi, maybe I'm butting in wrongly, but litres is a unit of volume (size) while kilogrammes is a unit for mass or weight- I suppose that the script calculates volume, since there are no "materials" in blender, there is no way to calculate a real weight from the volume.
|
||||
|
#29
|
|
||||
|
Quote:
The human body has a density of approximately one kilogram per litre. So what Lexi is saying is that if the person had a mass of 65 to 70 kilograms, the mesh should calculate the volume as 65 to 70 litres. |
||||
|
#30
|
|
|||
|
Quote:
Normal volume calculation, including things with PI in it yes, but not that.
............................................
Athlon 64 X2 3800+, 4 GB DDR2 800, Nvidia 8400, XP and OpenSUSE 64 11.0 |
|||
|
#31
|
|
|||
|
Sorry to drag this back up again. (The volume script is very helpful, I might add.
)Is there a way to calculate the center of mass for closed objects, assuming uniform density? From what I know, you'd need to take the volume of small slices along a line. Is there an easier way to do this in python without using booleans? I don't need anything accurate, and this is more for curiosity purposes. Still, any help would be nice.
|
|||
|
#32
|
|
||||
|
Hello,
If the script is working fine, thats great and you can probably ignore my post. I've looked at using Blender and 3D printing last year and came so close to going through with it, but it was a price issue for an art student... Anyway, http://www.jcadcam.com/ with the program JewelCad has a trial version that lasts until December 31 of the year you install it. Amongst other things, it gives volume, weight in different metals/materials, centre of gravity, etc. I used Blender for my modelling and it could save/export to whatever files JewelCad wanted, which meant it was full compatible with the printing software too. Not sure what price JewelCad is, but it gives really good readings on volume etc. in the free (long) trial. Hope that helps someone. Ben |
||||
|
#33
|
|
||||
|
Quote:
I think i've found your problem. The script does not handle scaled objects very well. Try this: insert a new cube. duplicate it, and scale (not in edit mode) the new one. They will have, according to the script, the same volume. It seems scaling in edit mode will gives decent values though. Still, thanks for the script!
............................................
Only jellyfish flow with the stream |
||||
|
#34
|
|
||||
|
Well, one thing led to another so i fixed the script myself.
!!-Transforms the mesh coordinates to world coordinates to allow scaling of objects -Added support for no material download: http://hiower.orgfree.com/quantitiesbill.py /hiower
............................................
Only jellyfish flow with the stream |
||||
|
#35
|
|
||||
|
Cool to see this script being used and extended (and bugs corrected.. :/). Well thought, thanks hiower.
New orgfree user, i see...
............................................
http://yorik.uncreated.net |
||||
|
#36
|
|
|||
|
interesting! could someone explain me how that calculation will deliver the volume of a mesh? i don't understand how any conclusions about the volume can be made from a series of two dimensional triangles.
does this only work with convex meshes?
Last edited by kakapo; 11-May-07 at 08:36. |
|||
|
#37
|
|
||||
|
I must admit... what does it do? The volume of a mesh? hmm..
............................................
My Animationmentor rig are not available anymore becuse of request from Animationmentor. Rigs rigs everywhere Blenderartist threadwww.lasserb.dk |
||||
|
#38
|
|
|||
|
Maybe it would be a good idea to see if Macouno would be interested in adding it to the "Measure Mesh" script on alienhelpdesk. The script already has a suitable UI and measures mesh areas (but not volumes...)
See the script here. By the way, great job GreyBeard. I love to see/use this type of stuff (comes in very handy designing small boat hulls...) |
|||
|
#39
|
|
|||
|
Hello all!
I use Blender 2.45 (on Ubuntu 8.04 AMD64), and when I run quantitiesbill.py on the standard cube I get the following console message: Quantity Bill Script -------------------- Processing Cube ... closed Is the script obsolete with this version of Blender? Or am I running it incorrectly? |
|||
|
#40
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|