[vtkusers] How to insert points to construct a 3d object
Melissa Goh
melissagoh27 at gmail.com
Tue Mar 6 09:45:15 EST 2012
Hi David,
I have attached a screenshot of the 3d object. Below is my code snippets:
*vtkPolyData strip = new vtkPolyData();
vtkPoints points = new vtkPoints();
for (int i=0; i<xyz.length; i++){
points.InsertNextPoint(xyz[i][0], xyz[i][1], xyz[i][2]);
}
strip.SetPoints(points);
vtkSurfaceReconstructionFilter surface = new
vtkSurfaceReconstructionFilter();
surface.SetInput(strip);
vtkContourFilter cf = new vtkContourFilter();
cf.SetInputConnection(surface.GetOutputPort());
cf.SetValue(0,0.0);
vtkReverseSense reverse = new vtkReverseSense();
reverse.SetInputConnection(cf.GetOutputPort());
reverse.ReverseCellsOn();
reverse.ReverseNormalsOn();
reverse.Update();
vtkPolyDataMapper map = new vtkPolyDataMapper();
map.SetInput(reverse.GetOutput());
map.ScalarVisibilityOff();
*
Appreciate your help! :)
Thanks,
Melissa
On Tue, Mar 6, 2012 at 8:22 PM, David Doria <daviddoria at gmail.com> wrote:
> On Mon, Mar 5, 2012 at 11:05 PM, Melissa Goh <melissagoh27 at gmail.com>
> wrote:
> > Hi David,
> >
> > I am using vtkPolyData to create a 3d nucleus surface based on the set of
> > data points. The structure doesn't seems right. I am not sure of how to
> > insert the points in correct order.
> >
> > Melissa
>
> You'll have to give us more information. *Why* does it not seem right?
> What is wrong with the order you are using? Can you provide some
> screenshots? Or the data? Or your code?
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120306/f44e6634/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: training pattern.jpg
Type: image/jpeg
Size: 39155 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120306/f44e6634/attachment.jpg>
More information about the vtkusers
mailing list