Try to figure out exactly where it crash.<br>Otherwise you can try building your IdList like that<br><br>vtkIdList cell = new vtkIdList();<br>for(int i=0;i&lt;n:i++)<br>    cell.InsertNextId(i);<br><br>polyData.InsertNextCell(2, cell);<br>
<br><br><div class="gmail_quote">On Tue, Jul 6, 2010 at 5:03 AM, Wahyudin Permana <span dir="ltr">&lt;<a href="mailto:gebe_top@yahoo.com">gebe_top@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
Hi Mr. Jourdain,<br><br>I have try your suggestion:<br>vtkIdList cell = new vtkIdList();<br>        cell.SetNumberOfIds(STLPointData.size());<br>        for(i=0;i&lt;STLPointData.size();i++) {<div class="im"><br>            cell.SetId(i,i);<br>
        }<br>        polyData.InsertNextCell(2, cell);<br><br></div>but there are errors message and the program was terminated:<br><br><br>#<br># A fatal error has been detected by the Java Runtime Environment:<br>#<br>#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x03874e6c, pid=3492, tid=3508<br>
#<br># JRE version: 6.0_20-b02<br># Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode, sharing windows-x86 )<br># Problematic frame:<br>#
 C  [vtkFiltering.dll+0x14e6c]<br>#<br># An error report file with more information is saved as:<br># F:\Data2\RP Software Development\Software Development\Gebe\hs_err_pid3492.log<br>#<br># If you would like to submit a bug report, please visit:<br>
#   <a href="http://java.sun.com/webapps/bugreport/crash.jsp" target="_blank">http://java.sun.com/webapps/bugreport/crash.jsp</a><br># The crash happened outside the Java Virtual Machine in native code.<br># See problematic frame for where to report the bug.<br>
#<br>Java Result: 1<br><br>do you have any suggestion?<div class="im"><br>thank you<br><br>============================================================<br>
regards,<br>
Wahyudin Permana<br>
Phone:<br>
Indonesia (Jakarta): +628151871130<br>
Saudi Arabia (Riyadh): +966569143445<br>
============================================================<br><br></div><div class="im">--- On <b>Tue, 7/6/10, Sebastien Jourdain <i>&lt;<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>&gt;</i></b> wrote:<br>
</div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div class="im"><br>From: Sebastien Jourdain &lt;<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>&gt;<br>
Subject: Re: [vtkusers] Can not show points of STL file<br>To: &quot;David E DeMarle&quot; &lt;<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>&gt;<br>Cc: &quot;Wahyudin Permana&quot; &lt;<a href="mailto:gebe_top@yahoo.com" target="_blank">gebe_top@yahoo.com</a>&gt;, <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
Date: Tuesday, July 6, 2010, 12:44 AM<br><br></div><div><div></div><div class="h5"><div>Or create a cell for each point (VTK_VERTEX (=1)) or 1 cell that refer to each point (VTK_POLY_VERTEX (=2)) on the polydata.<br><br>Something like that...<br>
<br>vtkIdList cell = new vtkIdList();<br>cell.SetNumberOfxx(STLPointData.size());<br>
for(int i=0;i&lt;STLPointData.size();i++) cell.SetId(i,i);<br>polyData.InsertNextCell(2,cell); // 2:VTK_POLY_VERTEX<br><br>I do not remember exactly the methods names, but you should be able to figure that out.<br><br>Seb<br>

<br><br><br><div class="gmail_quote">On Mon, Jul 5, 2010 at 11:43 AM, David E DeMarle <span dir="ltr">&lt;<a rel="nofollow" href="http://mc/compose?to=dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
VTK renders cells not points.<br><br>Try using a glyph filter to create 1 VTK_VERTEX cell for every point.<br><br clear="all">David E DeMarle<br>Kitware, Inc.<br>R&amp;D Engineer<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>



Phone: 518-371-3971 x109<br>
<br><br><div class="gmail_quote"><div><div></div><div>On Mon, Jul 5, 2010 at 11:12 AM, Wahyudin Permana <span dir="ltr">&lt;<a rel="nofollow" href="http://mc/compose?to=gebe_top@yahoo.com" target="_blank">gebe_top@yahoo.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>

<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">

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(&quot;Number of points= &quot;+n);<br>        for(i=0;i&lt;n;i++){<br>            double x = 0,y = 0,z = 0;<br>            //for(j=0;j&lt;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(&quot;X= &quot;+x+&quot;, Y= &quot;+y+&quot;, Z= &quot;+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></tbody></table><br>

      <br></div></div>_______________________________________________<br>
Powered by <a rel="nofollow" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a rel="nofollow" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a rel="nofollow" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a rel="nofollow" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>
<br>_______________________________________________<br>
Powered by <a rel="nofollow" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a rel="nofollow" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a rel="nofollow" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a rel="nofollow" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>
</div></div></div></blockquote></td></tr></tbody></table><br>







      </blockquote></div><br>