[vtkusers] Visualize with vtkPolyData

alex Dowson alexdowson at hotmail.com
Sat Apr 14 00:31:41 EDT 2012


Hi

Similar to this ?

        //add random points (and vertices) to the file
	vtkSmartPointer<vtkPoints> Points = vtkSmartPointer<vtkPoints>::New();
	vtkSmartPointer<vtkCellArray> Vertices = vtkSmartPointer<vtkCellArray>::New();
	for ( unsigned int i = 0; i < 4; ++i )
	{
		vtkIdType pid[1];
		pid[0] = Points->InsertNextPoint(drand48(), drand48(), drand48());
		Vertices->InsertNextCell(1,pid);
	}   vtkSmartPointer<vtkPolyData> pdata = vtkSmartPointer<vtkPolyData>::New();   //add the points to the dataset
	pdata->SetPoints(Points);
	pdata->SetVerts(Vertices);     
From: Tanweer Rashid 
Sent: Friday, April 13, 2012 10:31 PM
To: vtkusers at vtk.org 
Subject: [vtkusers] Visualize with vtkPolyData

Hi everyone, 

I am trying to visualize an arbitrary 3D structure using vtkPolyData. The structure has cells that are defined by the points of the structure. I know the points/vertices of the structure and I can use the setPoints() function to set these points in the vtkPolyData object. I know the points that make up the different cells of the structure, but how do I set up the cells in the vtkPolyData object??

Thanks very much,
Tanweer Rashid



--------------------------------------------------------------------------------
_______________________________________________
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120414/25b0b617/attachment.htm>


More information about the vtkusers mailing list