[vtkusers] Problem with vtkDelaunay3D

John Ownsoul mongwarrior at yahoo.com
Fri Dec 14 09:30:25 EST 2007


Dear Fellows,

I want to visualize 3D geographical data with VTK. I use x,y,z resistivity
values. I use vtkDelaunay3D and visualize it, but when zooming into the
object i saw that it is not a solid object. The object is hollow. How can i
visualize a solid object, could you help me. Thanks for everything...


http://www.nabble.com/file/p14336625/1.jpg 
http://www.nabble.com/file/p14336625/2.jpg 



Here is my code:

while (dis.available() != 0)
	    {
	    	qwe++;
	    	temp=dis.readLine();
	    	
	    	processLine(temp);
	    	System.out.println("x : " + x + ", y : " + y + ", z : " + z + ",
resist. : " + r );
	    	id1=points.InsertNextPoint(x,y,z);
	    	//if(r>20 && r<80) r=100;
	    	
	    	if (r>max) max=r;
	    	if (r<min) min=r;
	    	
	    	r=1-r/500;
	    	
	    	values.InsertValue(qwe,r);
	    	ids.InsertNextId(qwe);
	    	cell.InsertNextCell(id1);
	    }
	    fis.close();
	    bis.close();
	    dis.close();
	    System.out.println(qwe);
	    System.out.println("min " + min);
	    System.out.println("max " + max);
	    
	    vtkPolyData polyData = new vtkPolyData();
	    polyData.SetPoints(points);
	    polyData.SetVerts(cell);
	    polyData.GetPointData().SetScalars(values);
        
	    
//==============================================================	    
        vtkDelaunay3D del3D = new vtkDelaunay3D();
        del3D.SetInput(polyData);
        del3D.SetTolerance(0.001);
        del3D.BoundingTriangulationOff();
        
        vtkDataSetMapper dataSetMapper=new vtkDataSetMapper();
        dataSetMapper.SetInput(del3D.GetOutput());
//==============================================================	    
        
        vtkActor actor = new vtkActor();
        actor.SetMapper(dataSetMapper);
        actor.GetProperty().SetColor(1,0,0);
        
        
        
        
        vtkRenderer renderer = new vtkRenderer();
        vtkRenderWindow renderWindow = new vtkRenderWindow();
        renderWindow.AddRenderer(renderer);

        vtkRenderWindowInteractor iren = new
        vtkRenderWindowInteractor();
        iren.SetRenderWindow(renderWindow);
        
        renderer.AddActor(actor);
        renderer.SetBackground(0,0,0);
        
        renderWindow.SetSize(600, 600); 
        renderWindow.Render();
        iren.Initialize();
        renderWindow.Render();
        iren.Start();


====================================================================
Here is my data set:

x            y             z         resistivity value
====    ====      =====    ============
.....
2	1	-0.25	118.741
3	1	-0.25	128.561
4	1	-0.25	99.534
5	1	-0.25	179.084
6	1	-0.25	100.552
7	1	-0.25	60.644
8	1	-0.25	128.533
9	1	-0.25	78.901
.......

====================================================================
-- 
View this message in context: http://www.nabble.com/Problem-with-vtkDelaunay3D-tp14336625p14336625.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list