[vtkusers] Empty mesh from Delaunay3D

David Doria daviddoria+vtk at gmail.com
Wed Mar 10 09:56:52 EST 2010


On Wed, Mar 10, 2010 at 3:46 AM, superzz <jxdw_zlf at yahoo.com.cn> wrote:

>
> Hello
> I get an empty mesh from Delaunay3D. vtkPoints is used as source data. Am I
> using Delaunay3D in a wrong way?
>
> Thanks!
>
> superZZ
>
> vtkPoints pts = new vtkPoints();
>
> //points x-y-z
> pts.InsertPoint(0, 188, 377, 1);
> pts.InsertPoint(1, 195, 385, 1);
> pts.InsertPoint(2, 207, 393, 1);
> pts.InsertPoint(3, 221, 395, 1);
> pts.InsertPoint(4, 230, 396, 1);
> pts.InsertPoint(5, 241, 396, 1);
> pts.InsertPoint(6, 211, 399, 1);
> pts.InsertPoint(7, 223, 399, 1);
> pts.InsertPoint(8, 201, 392, 1);
> pts.InsertPoint(9, 248, 394, 1);
> pts.InsertPoint(10, 264, 394, 1);
> pts.InsertPoint(11, 269, 385, 1);
> pts.InsertPoint(12, 256, 390, 1);
> pts.InsertPoint(13, 245, 399, 1);
> pts.InsertPoint(14, 225, 399, 1);
> pts.InsertPoint(15, 251, 393, 1);
> pts.InsertPoint(16, 274, 376, 1);
> pts.InsertPoint(17, 288, 365, 1);
> pts.InsertPoint(18, 269, 375, 1);
> pts.InsertPoint(19, 244, 393, 1);
> pts.InsertPoint(20, 176, 367, 1);
> pts.InsertPoint(21, 176, 352, 1);
> pts.InsertPoint(22, 193, 248, 1);
> pts.InsertPoint(23, 191, 223, 1);
> pts.InsertPoint(24, 209, 219, 1);
> pts.InsertPoint(25, 210, 243, 1);
> pts.InsertPoint(26, 210, 245, 1);
> pts.InsertPoint(27, 233, 242, 1);
> pts.InsertPoint(28, 228, 208, 1);
> pts.InsertPoint(29, 228, 206, 1);
> pts.InsertPoint(30, 223, 223, 1);
> pts.InsertPoint(31, 223, 228, 1);
> pts.InsertPoint(32, 245, 387, 1);
>
> vtkUnstructuredGrid profile = new vtkUnstructuredGrid();
> profile.SetPoints(pts);
>
> vtkDelaunay3D delny = new vtkDelaunay3D();
> delny.SetInput(profile);
> delny.Update();
>
> vtkDataSetMapper delnyDataSetMapper = new vtkDataSetMapper();
> delnyDataSetMapper.SetInputConnection(delny.GetOutputPort());
>
>
> vtkActor delnyActor = new vtkActor();
> delnyActor.SetMapper(delnyDataSetMapper);
>
>
I'm not sure which language you are using, but I had to change the syntax of
the point insertion to:
pts->InsertNextPoint(23, 191, 223);

and then it worked fine for me.

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100310/1e2cbe82/attachment.htm>


More information about the vtkusers mailing list