<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Python Script: Calculating the Volume of Objects</title>
	<atom:link href="http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/</link>
	<description>Fresh Blender News, Every Day</description>
	<pubDate>Mon, 01 Dec 2008 18:25:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: FunkyWyrm</title>
		<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-403683</link>
		<dc:creator>FunkyWyrm</dc:creator>
		<pubDate>Tue, 11 Nov 2008 19:31:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-403683</guid>
		<description>Excellent script, thanks to all who contributed to it :-)

Various versions of the script can be found in the Blenderartists thread linked in the main article.</description>
		<content:encoded><![CDATA[<p>Excellent script, thanks to all who contributed to it :-)</p>
<p>Various versions of the script can be found in the Blenderartists thread linked in the main article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miq</title>
		<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-354731</link>
		<dc:creator>miq</dc:creator>
		<pubDate>Fri, 18 Jul 2008 13:38:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-354731</guid>
		<description>where is sctipt?</description>
		<content:encoded><![CDATA[<p>where is sctipt?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bart</title>
		<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-335537</link>
		<dc:creator>Bart</dc:creator>
		<pubDate>Fri, 06 Jun 2008 09:33:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-335537</guid>
		<description>Sheesh, I needed a Blender volume calculation script today, googled, and what was at the top of the search results: this post that I wrote myself one year ago!

*celebrates google and a bad memory*</description>
		<content:encoded><![CDATA[<p>Sheesh, I needed a Blender volume calculation script today, googled, and what was at the top of the search results: this post that I wrote myself one year ago!</p>
<p>*celebrates google and a bad memory*</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Quantum Anomaly</title>
		<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-225750</link>
		<dc:creator>Quantum Anomaly</dc:creator>
		<pubDate>Sat, 29 Dec 2007 07:21:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-225750</guid>
		<description>I wonder how accurately this will calculate sphere volumes? If I could use a NURBS sphere that would be ideal, but maybe it would be close enough if the sphere is high-poly.</description>
		<content:encoded><![CDATA[<p>I wonder how accurately this will calculate sphere volumes? If I could use a NURBS sphere that would be ideal, but maybe it would be close enough if the sphere is high-poly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niko Suni</title>
		<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101943</link>
		<dc:creator>Niko Suni</dc:creator>
		<pubDate>Fri, 11 May 2007 12:46:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101943</guid>
		<description>Yea, I followed you on the "tetrahedrons" but pyramid is the correct primitive here :)

You're right about the convex/concave issue; I didn't take into account the consideration of signed values.</description>
		<content:encoded><![CDATA[<p>Yea, I followed you on the &#034;tetrahedrons&#034; but pyramid is the correct primitive here :)</p>
<p>You&#039;re right about the convex/concave issue; I didn&#039;t take into account the consideration of signed values.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yorik</title>
		<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101939</link>
		<dc:creator>Yorik</dc:creator>
		<pubDate>Fri, 11 May 2007 12:30:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101939</guid>
		<description>Wow, great advertising for that script! I also didn't know mesh volume calculation could be that simple. Greybeard, who made the script, says it is a method widely used in engineering. In what I've read too, it looks like it is a very standard way of calculating volume in the 3D world. I guess the complication is with all those "accidents" in meshes, like inverted normals, etc... Probably to make the script very, very accurate, one should make routines that check and fix all those possible bad modelling, errors, distorsions and accidents.

If you follow down the blenderartists thread, you'll see that Hiower worked a bit more on the script and already solved a couple of things, it handles scaled meshes correctly now (you don't need to apply scale anymore)...</description>
		<content:encoded><![CDATA[<p>Wow, great advertising for that script! I also didn&#039;t know mesh volume calculation could be that simple. Greybeard, who made the script, says it is a method widely used in engineering. In what I&#039;ve read too, it looks like it is a very standard way of calculating volume in the 3D world. I guess the complication is with all those &#034;accidents&#034; in meshes, like inverted normals, etc&#8230; Probably to make the script very, very accurate, one should make routines that check and fix all those possible bad modelling, errors, distorsions and accidents.</p>
<p>If you follow down the blenderartists thread, you&#039;ll see that Hiower worked a bit more on the script and already solved a couple of things, it handles scaled meshes correctly now (you don&#039;t need to apply scale anymore)&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Schardt</title>
		<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101932</link>
		<dc:creator>Michael Schardt</dc:creator>
		<pubDate>Fri, 11 May 2007 12:22:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101932</guid>
		<description>Not sure about the convexity thing since i'm summing signed values - result was correct for a torus for example.
Well  - i used a "square torus" for testing - something that looks like this:
-------
&#124; --- &#124;
&#124; &#124; &#124; &#124;
&#124; --- &#124;
-------

... easy check - simply count boxes...

One little thing though: i'm not summing tetrahedrons (wrong expression) but triangle pyramids.</description>
		<content:encoded><![CDATA[<p>Not sure about the convexity thing since i&#039;m summing signed values - result was correct for a torus for example.<br />
Well  - i used a &#034;square torus&#034; for testing - something that looks like this:<br />
&#8212;&#8212;-<br />
| &#8212; |<br />
| | | |<br />
| &#8212; |<br />
&#8212;&#8212;-</p>
<p>&#8230; easy check - simply count boxes&#8230;</p>
<p>One little thing though: i&#039;m not summing tetrahedrons (wrong expression) but triangle pyramids.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niko Suni</title>
		<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101928</link>
		<dc:creator>Niko Suni</dc:creator>
		<pubDate>Fri, 11 May 2007 12:05:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101928</guid>
		<description>@Michael: Your method only works if the mesh is a convex manifold with regard to its center - that is, each and every triangle is unobstructed from the center by any other triangle. In the case of concave manifold (like Suzanne), parts of some of the tetrahedrons may end up outside the mesh - causing the inaccuracy.</description>
		<content:encoded><![CDATA[<p>@Michael: Your method only works if the mesh is a convex manifold with regard to its center - that is, each and every triangle is unobstructed from the center by any other triangle. In the case of concave manifold (like Suzanne), parts of some of the tetrahedrons may end up outside the mesh - causing the inaccuracy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Schardt</title>
		<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101925</link>
		<dc:creator>Michael Schardt</dc:creator>
		<pubDate>Fri, 11 May 2007 11:56:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101925</guid>
		<description>Sorry - tabs got lost.
The three codelines under "def Volume(mesh):" should be intended of course.</description>
		<content:encoded><![CDATA[<p>Sorry - tabs got lost.<br />
The three codelines under &#034;def Volume(mesh):&#034; should be intended of course.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Schardt</title>
		<link>http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101921</link>
		<dc:creator>Michael Schardt</dc:creator>
		<pubDate>Fri, 11 May 2007 11:43:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.blendernation.com/2007/05/11/python-script-calculating-the-volume-of-objects/#comment-101921</guid>
		<description>Not sure if it's identical, but this is what i used for one of my scripts:

import Blender; from Blender import *

def Volume(mesh):
	volume = 0.0
	for face in mesh.faces: volume += face.area * (face.cent * face.no)
	return volume / 3.0

mesh = Object.GetSelected()[0].getData(0, 1)
print Volume(mesh)

Idea is to sum the signed volumes of tetrahedrons (each formed by a triangle and the origin)
The signed volume is 1/3 * tiranglearea * signed distance of the triangle hyperplane to the origin.
= 1/3 * face.area * dotvecs(facecenter, facenormal)
The division is just delayed  until the summation is done.
The mesh must be converted to triangles also, normals pointing outside.
It gives the same values as the script posted above in most cases.
Only for a susanne model (converted to triangles) it gives slightly different values - I don't know if this is just a floating point rounding issue. I'll need to figure out how the script does the calculation (understand what's going on geometrically) to see...</description>
		<content:encoded><![CDATA[<p>Not sure if it&#039;s identical, but this is what i used for one of my scripts:</p>
<p>import Blender; from Blender import *</p>
<p>def Volume(mesh):<br />
	volume = 0.0<br />
	for face in mesh.faces: volume += face.area * (face.cent * face.no)<br />
	return volume / 3.0</p>
<p>mesh = Object.GetSelected()[0].getData(0, 1)<br />
print Volume(mesh)</p>
<p>Idea is to sum the signed volumes of tetrahedrons (each formed by a triangle and the origin)<br />
The signed volume is 1/3 * tiranglearea * signed distance of the triangle hyperplane to the origin.<br />
= 1/3 * face.area * dotvecs(facecenter, facenormal)<br />
The division is just delayed  until the summation is done.<br />
The mesh must be converted to triangles also, normals pointing outside.<br />
It gives the same values as the script posted above in most cases.<br />
Only for a susanne model (converted to triangles) it gives slightly different values - I don&#039;t know if this is just a floating point rounding issue. I&#039;ll need to figure out how the script does the calculation (understand what&#039;s going on geometrically) to see&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.111 seconds -->
