[vtkusers] Fwd: Unsure how to use vtkDelaunay3D

David Gobbi david.gobbi at gmail.com
Mon Jun 1 20:52:19 EDT 2015

The documentation for vtkDelaunay3D says that it outputs only tetrahedrons
unless you specifically set the "Alpha" value (I'm not 100% sure what
"Alpha" is for, but since you aren't using it, I don't think you need to
worry about it).

 - David

On Mon, Jun 1, 2015 at 6:19 PM, vtk matt <vtkmatt at gmail.com> wrote:

> Hi David,
> Thanks for the clarification.  I
> ran tets->GetOutput()->GetNumberOfElements(vtkDataObject::CELL) and got a
> value of 18 for my input which would make sense as the number of
> tetrahedrons.  Do you know if I can expect these cells to in fact contain
> tetrahedrons then?
> --Matt
> On Wed, May 27, 2015 at 8:17 PM, David Gobbi <david.gobbi at gmail.com>
> wrote:
>> Hi Matt,
>> You've been misled by VTK's rather terse documentation:
>>   Get the number of elements for a specific attribute type (POINT, CELL,
>> etc.).
>> For a mesh, you can call GetNumberOfElements(vtkDataObject::POINT) or you
>> can call GetNumberOfElements(vtkDataObject::CELL).  Those are the only two
>> choices.  You can't ask for a particular type of cell, all you can do is
>> ask it to return the total number of cells.
>>  - David
>> On Wed, May 27, 2015 at 5:41 PM, vtk matt <vtkmatt at gmail.com> wrote:
>>> Hi all,
>>> I have spent the past few days trying to figure out how to use
>>> vtkDelaunay3D properly and decided I'd better seek out some help.  My goal
>>> is relatively straight-forward:  Given a set of points in 3D, generate a
>>> tetrahedral mesh, and use the results to determine which tetrahedron
>>> contains an arbitrary point.
>>> In its simplest form I am doing the following:
>>> vtkSmartPointer<vtkDelaunay3D> tets =
>>> vtkSmartPointer<vtkDelaunay3D>::New();
>>> tets->SetInput(points);
>>> tets->Update();
>>> printf("Number of tets: %d\n",
>>> tets->GetOutput()->GetNumberOfElements(VTK_TETRA));
>>> The output claims there are zero tetrahedrons.  However if I render an
>>> actor from tets->GetOutput(), I am able to visualize a wireframe surface
>>> mesh, so I know it's doing something.
>>> So I guess my questions are the following:  Why does the output not
>>> contain any tetrahedrons?  Why does the mesh only show surface triangles?
>>> Ultimately what is the proper way to construct a tetrahedral mesh such that
>>> I can query which tetrahedron contains an arbitrary point?
>>> Thanks.
>>> --Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150601/e3ed037e/attachment.html>

More information about the vtkusers mailing list