<div dir="ltr"><div><div><div><div><div><div>I am not sure vtk provides a dedicated function, <br></div>but structured grid made of hexahedron means every cell is hexahedron.<br><br>As far as I can recall the simplest way to compute hexahedron volume would be splitting it in 3 pyramids with quadrilateral base.<br>
</div>Volume of such pyramid is area of the base multiplied by height.<br><br></div>If it is not easy enough you could split it on on tetrahedrons then use <br> <a class="" href="http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159">double</a> vtkTetra::<a class="" href="http://www.vtk.org/doc/nightly/html/classvtkTetra.html#aa03df80e3eb54d350b953b8cc798cd8b">ComputeVolume</a> (<a class="" href="http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159">double</a> p1[3], <a class="" href="http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159">double</a> p2[3], <a class="" href="http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159">double</a> p3[3], <a class="" href="http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159">double</a> p4[3])<br>
</div>to compute volume of each.<br><br></div>Regards,<br></div> Alex<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 18, 2013 at 9:44 PM, Alexandre Boucher <span dir="ltr"><<a href="mailto:afboucher@gmail.com" target="_blank">afboucher@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>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?</div>
<div><br></div><div>Thanks,</div><div>Alex</div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>