<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Dear All,<br><br>I want to show points of STL file, but it doesn.t work, no error, but the points were not appear. <br>any suggestion?<br><br>Code:<br> STLPointData = new STLReading();<br> STLPointData.readSTL(name); // IMPORTANT: ONLYREAD STL ASCII FILE<br><br> vtkPoints points = new vtkPoints();<br> vtkPolyData polyData = new vtkPolyData();<br> vtkUnstructuredGrid unstructuredGrid = new vtkUnstructuredGrid();<br><br> int i = 0, j = 0, k = 0;<br> int n;<br> n = STLPointData.size();<br>
points.SetNumberOfPoints(n);<br> System.out.println("Number of points= "+n);<br> for(i=0;i<n;i++){<br> double x = 0,y = 0,z = 0;<br> //for(j=0;j<3;j++){<br> //}<br> x=(Double)((Vector)STLPointData.get(i)).get(0);<br> y=(Double)((Vector)STLPointData.get(i)).get(1);<br> z=(Double)((Vector)STLPointData.get(i)).get(2);<br> points.InsertPoint(i, x, y,
x);<br> System.out.println("X= "+x+", Y= "+y+", Z= "+z);<br> }<br><br> vtkConeSource cone = new vtkConeSource();<br><br> polyData.SetPoints(points);<br> polyData.Squeeze();<br> vtkPolyDataMapper mapper = new vtkPolyDataMapper();<br> mapper.SetInput(polyData);<br> //mapper.SetInput(cone.GetOutput());<br><br> //unstructuredGrid.SetPoints(points);<br> //vtkDataSetMapper dataMapper = new vtkDataSetMapper();<br>
//dataMapper.SetInput(unstructuredGrid);<br> //dataMapper.SetInput(polyData);<br><br> vtkActor stlActor = new vtkActor();<br> vtkProperty property = new vtkProperty();<br> property.SetColor(0.3, 0.8, 0.3);<br> stlActor.SetMapper(mapper);<br> //stlActor.SetMapper(dataMapper);<br> stlActor.SetProperty(property);<br><br> vtkRenderer ren2; //= new vtkRenderer();<br> ren2 = renWin2.GetRenderer();<br> ren2.AddActor(stlActor);<br> ren2.SetBackground(0.1, 0.1,
0.8);<br> <br> ren2.ResetCameraClippingRange();<br> ren2.ResetCamera();<br><br> ren2.Render();<br><br><br>thank you<br><br>============================================================<br>
regards,<br>
Wahyudin Permana<br>
Phone:<br>
Indonesia (Jakarta): +628151871130<br>
Saudi Arabia (Riyadh): +966569143445<br>
============================================================</td></tr></table><br>