[vtkusers] How to compute volume of cell

Alex Malyushytskyy alexmalvtk at gmail.com
Tue May 21 13:22:34 EDT 2013


I am not sure vtk provides a dedicated function,
but structured grid made of hexahedron means every cell is hexahedron.

As far as I can recall the simplest way to compute hexahedron volume would
be splitting it in 3 pyramids with quadrilateral base.
Volume of such pyramid is area of the base multiplied by height.

If it is not easy enough you could split it on on tetrahedrons then use
   double<http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159>vtkTetra::
ComputeVolume<http://www.vtk.org/doc/nightly/html/classvtkTetra.html#aa03df80e3eb54d350b953b8cc798cd8b>(
double<http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159>p1[3],
double<http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159>p2[3],
double<http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159>p3[3],
double<http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159>p4[3])
to compute volume of each.

Regards,
    Alex


On Sat, May 18, 2013 at 9:44 PM, Alexandre Boucher <afboucher at gmail.com>wrote:

> Hello,
>
> Does vtk provides an easy way of computing the volume of a vtkCell3D.  I
> have a vtkStructuredGrid (made of hexahedron) and I would like to retrieve
> the volume of any cell within that grid.  How would I proceed?
>
> Thanks,
> Alex
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130521/e3353481/attachment.htm>


More information about the vtkusers mailing list