<div dir="ltr">You could use vtkCutter to cut the mesh to get its outer coordinates, then use your method to determine the voxel is inside or our.<br><br>Jothy<br><br><div class="gmail_quote">On Tue, Jul 5, 2011 at 3:11 PM, Alex Southern <span dir="ltr">&lt;<a href="mailto:mrapsouthern@gmail.com">mrapsouthern@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks for your reply,<br>
<br>
Yes I understand the basic idea, I already have an efficient method to identify if an infinite line in any direction will first intersect the plane of an arbitrary triangle in 3D space, if so it then projects the triangle onto one of the 3 co-ordinate planes, then determines if the point of intersection with the plane lies inside the triangle.<br>

<br>
I have this in MATLAB it works great, Im happy to share it with anyone.<br>
<br>
After an initial attempt, I am not sure of the best way to use this algorithim to make a robust voxelization.<br>
<br>
Thanks<br><font color="#888888">
Alex</font><div><div></div><div class="h5"><br>
<br>
<br>
On 5.7.2011 16:57, Dominik Szczerba wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You will basically need a test routine to tell you if a given point<br>
lies inside your triangular surface or outside. There is such a test<br>
in VTK, but should you want to write your own one again, this is about<br>
shooting rays and counting intersections. Sounds simple, but it is not<br>
so to do efficiently and robustly.<br>
<br>
Dominik<br>
<br>
On Tue, Jul 5, 2011 at 3:47 PM, Alex Southern&lt;<a href="mailto:mrapsouthern@gmail.com" target="_blank">mrapsouthern@gmail.<u></u>com</a>&gt;  wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I have a closed triangular surface mesh, that I would like to represent as a<br>
volume of identically sized cubes. I understand this is known as<br>
voxelization where a single cube is referred to as a voxel.<br>
<br>
I am aware that VTK will probably do this for me. Though, for various<br>
reasons, I would like to implement this algorithm myself, can anyone give me<br>
a clue as to how to tackle this problem from the ground up? References would<br>
be great.<br>
<br>
Thanks<br>
Alex<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at:<br>
<a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_<u></u>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/<u></u>listinfo/vtkusers</a><br>
<br>
<br>
</blockquote></blockquote>
<br>
______________________________<u></u>_________________<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/<u></u>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_<u></u>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/<u></u>listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>