[vtkusers] How do i maintain a similar cell relationship when i create a new surface from an existing one

kashyap ksatyananda at gmail.com
Fri May 6 13:26:53 EDT 2011


Hi, 
I have an already existing model which is represented by vtkpolydata. Now
most of the model does not contain useful information that i need to work
with. Therefore I am choosing only those points on which the scalar values
are non zero. 

I am using this condition to choose those points to create the new surface.
That works fine. I visualized it on paraview and it looks ok. But the
problem is when I try to associated the new points with creating cells in
the new vtkpolydata.

I want to do it in a way such that the triangluar meshes created have more
or less a similar association of points as the original model. I know that
not all of those points would be considered but maybe the next available one
or something like that. I am not able to figure out how to do it. As of now
all i get is one big association of the poly surface which for which the
mesh representation does not even make sense. 
The required code fragment looks something as follows: 

		//Get the number of points which are non zero on the surface. 
			for (int j =0; j<numP; j++){
				if(scalars1->GetValue(j) != 0) {
					points->InsertPoint(count_point,cartShape[i]->GetPoint(j));
				//	points->InsertPoint(j,cartShape[i]->GetPoint(j));
					count_point++;
				}
			}
		//Cell associated with the new set of points
			int numPts = points->GetNumberOfPoints();
			cells->InsertNextCell(numPts);
			for (int j=0; j<numPts; j++){
				cells->InsertCellPoint(j);
			}
			thickSurface->SetPoints(points);
			thickSurface->SetStrips(cells);
I have attached both the wire fram represntation of the desired surface and
the point representation. 

Any help would be appreciated. 
Thanks, 
Kashyap  http://vtk.1045678.n5.nabble.com/file/n4376608/wiremesh.png 
http://vtk.1045678.n5.nabble.com/file/n4376608/points.png 

--
View this message in context: http://vtk.1045678.n5.nabble.com/How-do-i-maintain-a-similar-cell-relationship-when-i-create-a-new-surface-from-an-existing-one-tp4376608p4376608.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list