Do you have the addressing to get the areas of the faces? If so you
could do use Gauss' theorem.

Take a vector

       U=(x, 0, 0)

Then

       div(U)=1

and

       V = volume_integrate(1)

       = volume_integrate(div(U))

       = surface_integrate(U . N)

(with N the outwards pointing normal (Nx, Ny, Nz))

       = surface_integrate(x * Nx)

Since your faces are flat and directed along the coordinates axes the
surface integration becomes a multiplication of the surface area with +-
the x-component of the faces that are perpendicular to the x-axis.

To get the surface area you can do the same in 2D (i.e. convert a
surface integral into a line integral) in each face. That way you only
need the addressing to walk along edges.

There might actually be a better way based upon sorting (like in
scan-line conversion) since your thickness is constant but above method
should work and is quite general.

Regards,

Mattijs

A. Murat Tanyer wrote:
 Hi all,

I have a Shape3D something like the attached file. I known the (x,y,z)
coordinates of all the vertices. All the angles are 90 and the thickness
is constant.

Is there a way to find the volume of shapes in JAVA3D?

I can divide the shape into small rectangles and find the areas but I
don't want this because some shapes have too many vertices. So it is not
an efficient way for me.

Thanks for any help.
Ali

------------------------------------------------------------------------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to