[vtkusers] 3d scattered points to 3d grid

Ajit Rajwade ajit_v_r at hotmail.com
Fri Sep 19 10:26:32 EDT 2003


Thanks for reply. Unfortunately I am facing some problems with 
vtkshepardmethod. Part of the problem is that I have a very large model of 
20,000 irregularly spaced points.


	 // Create points
    	vtkPoints *meanPoints = vtkPoints::New();

	// Inserting the points one by one
	for (i=0;i<SIZE;i++)
	{

		meanPoints->InsertNextPoint(point);
	}

    	// Create a data set. Load the starting points
	vtkPolyData *inputDataSet = vtkPolyData::New();
	inputDataSet->SetPoints(meanPoints);

	vtkScalars *scalars = vtkScalars::New();
	scalars->SetNumberOfComponents (SIZE);
	float one = 1.0;
	for (i=0;i<SIZE;i++)
		scalars->InsertNextScalar(one);
   	(inputDataSet->GetPointData())->SetScalars(scalars);

	vtkShepardMethod *shep = vtkShepardMethod::New ();
	shep->SetInput (inputDataSet);
	shep->SetModelBounds (XMIN,XMAX,YMIN,YMAX,ZMIN,ZMAX);
	shep->SetMaximumDistance (1);
	shep->SetSampleDimensions (50,50,50);
	shep->Update ();
	printf("\nSHEPARD UPDATED...");
	fflush (stdout);






>
>I would take a look at the vtkShepardMethod class in Vtk. It will accept
>your unstructured 3D points and inject them into a structured grid. The
>documentation for this class is here:
>
>http://www.vtk.org/doc/release/4.2/html/classvtkShepardMethod.html
>
>Tom C.
>
>
>
>-----Original Message-----
>From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org]On Behalf Of
>Ajit Rajwade
>Sent: Tuesday, September 16, 2003 3:48 PM
>To: vtkusers at vtk.org
>Subject: [vtkusers] 3d scattered points to 3d grid
>
>
>Hello,
>
>I have an array of irregularly spaced 3D points. The X,Y,Z coordinates of
>each point is known. Associated with each point is a certain data item D.
>Thus D can be treated as a function of X,Y,Z. I want to convert these 
>points
>into a 3D grid with discretized x,y,z values. Is there any way to do this 
>in
>VTK? Code snippets would be highly appreciated.
>
>Thanks,
>==ajit
>
>_________________________________________________________________
>MSN Search, le moteur de recherche qui pense comme vous !
>http://search.msn.fr/worldwide.asp
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers

_________________________________________________________________
MSN Search, le moteur de recherche qui pense comme vous ! 
http://search.msn.fr/worldwide.asp




More information about the vtkusers mailing list