POV-Ray : Newsgroups : povray.general : Volume of a 3d mesh Server Time
1 Nov 2024 01:26:00 EDT (-0400)
  Volume of a 3d mesh (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Greg M  Johnson
Subject: Volume of a 3d mesh
Date: 9 Dec 1999 17:02:13
Message: <3850262D.E80C2B35@my-dejanews.com>
Is there an automatic way to calculate the volume of a 3d mesh?


Post a reply to this message

From: John VanSickle
Subject: Re: Volume of a 3d mesh
Date: 9 Dec 1999 17:23:12
Message: <38502D2D.3F208819@erols.com>
Greg M. Johnson wrote:
> 
> Is there an automatic way to calculate the volume of a 3d mesh?

For each triangle, take the following matrix:

[A.x  A.y  A.z]
[B.x  B.y  B.z]
[C.x  C.y  C.z]

Where A, B, and C are the vertices of the triangle.  Make sure that
the order from A to B to C goes in the same direction for each triangle
(either clockwise or counter-clockwise) when viewed from the outside
of the mesh.

Take the determinant of this matrix.  Divide it by six.  If the
determinant is negative, leave it that way.

Add up all of the determinants for all of the triangles.  Divide by
six.  If the sum is negative, make it positive.  The result is the
volume of the mesh.

Note that every edge *MUST* be shared by exactly TWO triangles, or the
sum will be entirely meaningless.

Hope this helps,
John
-- 
ICQ: 46085459


Post a reply to this message

From: Bill DeWitt
Subject: Re: Volume of a 3d mesh
Date: 9 Dec 1999 17:45:26
Message: <38503106@news.povray.org>
"John VanSickle" <van### [at] erolscom> wrote :
> Greg M. Johnson wrote:
> >
> > Is there an automatic way to calculate the volume of a 3d mesh?
>
> For each triangle, take the following matrix:
>

    Wait a minute... are you saying that if (for instance) I were to go into
Rhino, make an unusual shape, export it to POV and then do as you describe,
I would get the volume of that unusual shape? Please say yes.... It would
give me an excuse to buy Rhino.


Post a reply to this message

From: Ken
Subject: Re: Volume of a 3d mesh
Date: 9 Dec 1999 17:46:41
Message: <38503129.CAC62247@pcabell.net>
Bill DeWitt wrote:

>     Wait a minute... are you saying that if (for instance) I were to go into
> Rhino, make an unusual shape, export it to POV and then do as you describe,
> I would get the volume of that unusual shape? Please say yes.... It would
> give me an excuse to buy Rhino.

That's the only excuse you need to buy Rhino ?

-- 
Ken Tyler -  1200+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Bill DeWitt
Subject: Re: Volume of a 3d mesh
Date: 9 Dec 1999 18:13:16
Message: <3850378c@news.povray.org>
"Ken" <tyl### [at] pcabellnet> wrote :
>
> That's the only excuse you need to buy Rhino ?
>

    That is the one I need to get it past my Poverty Filter. If I could use
it to even possibly, maybe, someday help my income -somehow-, I could
rationalize the rest.


Post a reply to this message

From: Lance Birch
Subject: Re: Volume of a 3d mesh
Date: 9 Dec 1999 21:35:58
Message: <3850670e@news.povray.org>
Just buy MAX, it'll do that for you and then be able to apply dynamics to
all the objects in your scene :)  Oh, plus it'll find the pivot point
center-of-gravity for any object too, ain't that handy :)

--
Lance.
The Zone - http://come.to/the.zone
Bill DeWitt <the### [at] earthlinknet> wrote in message
news:3850378c@news.povray.org...
>
> "Ken" <tyl### [at] pcabellnet> wrote :
> >
> > That's the only excuse you need to buy Rhino ?
> >
>
>     That is the one I need to get it past my Poverty Filter. If I could
use
> it to even possibly, maybe, someday help my income -somehow-, I could
> rationalize the rest.
>
>


Post a reply to this message

From: Ken
Subject: Re: Volume of a 3d mesh
Date: 9 Dec 1999 21:40:44
Message: <38506803.207AEF7@pcabell.net>
Lance Birch wrote:
> 
> Just buy MAX, it'll do that for you and then be able to apply dynamics to
> all the objects in your scene :)  Oh, plus it'll find the pivot point
> center-of-gravity for any object too, ain't that handy :)

If MAX is so great why doesn't it offer direct file support for POV-Ray
like Rhino does at a fraction of the cost ?

-- 
Ken Tyler -  1200+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Lance Birch
Subject: Re: Volume of a 3d mesh
Date: 9 Dec 1999 22:30:14
Message: <385073c6@news.povray.org>
Because it's built to export to RenderMan :)  hehehe

--
Lance.
The Zone - http://come.to/the.zone
Ken <tyl### [at] pcabellnet> wrote in message
news:385### [at] pcabellnet...
>
>
> Lance Birch wrote:
> >
> > Just buy MAX, it'll do that for you and then be able to apply dynamics
to
> > all the objects in your scene :)  Oh, plus it'll find the pivot point
> > center-of-gravity for any object too, ain't that handy :)
>
> If MAX is so great why doesn't it offer direct file support for POV-Ray
> like Rhino does at a fraction of the cost ?
>
> --
> Ken Tyler -  1200+ Povray, Graphics, 3D Rendering, and Raytracing Links:
> http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Volume of a 3d mesh
Date: 10 Dec 1999 09:13:00
Message: <385109B2.C7393E5D@my-dejanews.com>
Boy, you are a math whiz!  But I'm slightly confused in your notation, it's
almost as if you wrote three matrices instead of one. By "determinant of
this matrix", you mean:

                        A.x * B.y * C.z  + .....

Will pov or one of your macros do this calc for me?

John VanSickle wrote:

> Greg M. Johnson wrote:
> >
> > Is there an automatic way to calculate the volume of a 3d mesh?
>
> For each triangle, take the following matrix:
>
> [A.x  A.y  A.z]
> [B.x  B.y  B.z]
> [C.x  C.y  C.z]
>
> Where A, B, and C are the vertices of the triangle.  Make sure that
> the order from A to B to C goes in the same direction for each triangle
> (either clockwise or counter-clockwise) when viewed from the outside
> of the mesh.
>
> Take the determinant of this matrix.  Divide it by six.  If the
> determinant is negative, leave it that way.
>
> Add up all of the determinants for all of the triangles.  Divide by
> six.  If the sum is negative, make it positive.  The result is the
> volume of the mesh.
>
> Note that every edge *MUST* be shared by exactly TWO triangles, or the
> sum will be entirely meaningless.
>
> Hope this helps,
> John
> --
> ICQ: 46085459


Post a reply to this message

From: Ron Parker
Subject: Re: Volume of a 3d mesh
Date: 10 Dec 1999 09:18:58
Message: <38510bd2@news.povray.org>
#macro Determinant( A, B, C )
  (A.x * B.y * C.z + A.y * B.z * C.x + A.z * B.x * C.y -
   A.x * B.z * C.x - A.y * B.x * C.z - A.z * B.y * C.x)
#end

On Fri, 10 Dec 1999 09:09:55 -0500, Greg M. Johnson wrote:
>Boy, you are a math whiz!  But I'm slightly confused in your notation, it's
>almost as if you wrote three matrices instead of one. By "determinant of
>this matrix", you mean:
>
>                        A.x * B.y * C.z  + .....
>
>Will pov or one of your macros do this calc for me?
>
>John VanSickle wrote:
>
>> Greg M. Johnson wrote:
>> >
>> > Is there an automatic way to calculate the volume of a 3d mesh?
>>
>> For each triangle, take the following matrix:
>>
>> [A.x  A.y  A.z]
>> [B.x  B.y  B.z]
>> [C.x  C.y  C.z]
>>
>> Where A, B, and C are the vertices of the triangle.  Make sure that
>> the order from A to B to C goes in the same direction for each triangle
>> (either clockwise or counter-clockwise) when viewed from the outside
>> of the mesh.
>>
>> Take the determinant of this matrix.  Divide it by six.  If the
>> determinant is negative, leave it that way.
>>
>> Add up all of the determinants for all of the triangles.  Divide by
>> six.  If the sum is negative, make it positive.  The result is the
>> volume of the mesh.
>>
>> Note that every edge *MUST* be shared by exactly TWO triangles, or the
>> sum will be entirely meaningless.
>>
>> Hope this helps,
>> John
>> --
>> ICQ: 46085459
>
>
>


-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.