[vtkusers] Voxels

Dominik Szczerba dominik at itis.ethz.ch
Tue Jul 5 10:38:33 EDT 2011


You need to cover your surface with oversized regular/image grid, then
test all its points for inside/outside.
Having a line/triangle intersection is not enough though. First, it
has to handle malicious cases (intersection with triangle's edge or
point), then you do not want to test all the triangles for the
possible intersections but use a bounding box tree to first locate
possible candidates.

Dominik

On Tue, Jul 5, 2011 at 4:23 PM, Jothy <jothybasu at gmail.com> wrote:
> 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.
>
> Jothy
>
> On Tue, Jul 5, 2011 at 3:11 PM, Alex Southern <mrapsouthern at gmail.com>
> wrote:
>>
>> Thanks for your reply,
>>
>> 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.
>>
>> I have this in MATLAB it works great, Im happy to share it with anyone.
>>
>> After an initial attempt, I am not sure of the best way to use this
>> algorithim to make a robust voxelization.
>>
>> Thanks
>> Alex
>>
>>
>> On 5.7.2011 16:57, Dominik Szczerba wrote:
>>>
>>> You will basically need a test routine to tell you if a given point
>>> lies inside your triangular surface or outside. There is such a test
>>> in VTK, but should you want to write your own one again, this is about
>>> shooting rays and counting intersections. Sounds simple, but it is not
>>> so to do efficiently and robustly.
>>>
>>> Dominik
>>>
>>> On Tue, Jul 5, 2011 at 3:47 PM, Alex Southern<mrapsouthern at gmail.com>
>>>  wrote:
>>>>
>>>> Hi,
>>>>
>>>> I have a closed triangular surface mesh, that I would like to represent
>>>> as a
>>>> volume of identically sized cubes. I understand this is known as
>>>> voxelization where a single cube is referred to as a voxel.
>>>>
>>>> I am aware that VTK will probably do this for me. Though, for various
>>>> reasons, I would like to implement this algorithm myself, can anyone
>>>> give me
>>>> a clue as to how to tackle this problem from the ground up? References
>>>> would
>>>> be great.
>>>>
>>>> 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
>>>>
>>>>
>>
>> _______________________________________________
>> 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
>
>
> _______________________________________________
> 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
>
>



More information about the vtkusers mailing list