<div dir="auto">Can you share your data? Could be a bug in GeometryFilter.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 20, 2018, 6:57 AM Nguyen, Giang Hoang <<a href="mailto:ghnguyen@wpi.edu">ghnguyen@wpi.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div id="m_-128719761561180493divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi, </p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks for the quick reply Kenichiro. I could see that the GeometryFilter does support quadratic tetra grids now. Still I have the issue with my large mesh. I'm reading from a file and this is the snippet to read that
 file:</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>----</div>
<div>reader = vtkUnstructuredGridReader()</div>
<div>reader.SetFileName(file_name)</div>
<div>reader.Update()</div>
<div>print reader.GetOutput()</div>
----
<p></p>
<p style="margin-top:0;margin-bottom:0">which prints out this to terminal: </p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>vtkUnstructuredGrid (0000000006521F50)</div>
<div>  Debug: Off</div>
<div>  Modified Time: 184</div>
<div>  Reference Count: 2</div>
<div>  Registered Events: (none)</div>
<div>  Information: 00000000025B0F10</div>
<div>  Data Released: False</div>
<div>  Global Release Data: Off</div>
<div>  UpdateTime: 189</div>
<div>  Field Data:</div>
<div>    Debug: Off</div>
<div>    Modified Time: 161</div>
<div>    Reference Count: 1</div>
<div>    Registered Events: (none)</div>
<div>    Number Of Arrays: 0</div>
<div>    Number Of Components: 0</div>
<div>    Number Of Tuples: 0</div>
<div>  Number Of Points: 343399</div>
<div>  Number Of Cells: 250935</div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0">I suppose this means the reader was able to read the unstructured grid correctly and I have data integrity (which is also confirmed by Paraview, which was able to generate this UnstructuredGrid mesh). What I'm looking
 for is this snippet to work: </p>
<p style="margin-top:0;margin-bottom:0">----</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>geoFilter = vtkGeometryFilter()</div>
<div>geoFilter.SetInputConnection(reader.GetOutputPort())</div>
<div>geoFilter.Update()</div>
----
<p></p>
<p style="margin-top:0;margin-bottom:0">Unfortunately, the line geoFilter.Update() always makes vtkpython quit without any warning/error even with try catch surrounding. I'm not sure what the problem now is.</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_-128719761561180493divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> kenichiro yoshimi <<a href="mailto:rccm.kyoshimi@gmail.com" target="_blank" rel="noreferrer">rccm.kyoshimi@gmail.com</a>><br>
<b>Sent:</b> Friday, August 17, 2018 11:04:27 PM<br>
<b>To:</b> Nguyen, Giang Hoang<br>
<b>Cc:</b> <a href="mailto:vtkusers@public.kitware.com" target="_blank" rel="noreferrer">vtkusers@public.kitware.com</a><br>
<b>Subject:</b> Re: [vtkusers] vtkGeometryFilter for quadratic tetra grids</font>
<div> </div>
</div>
<div class="m_-128719761561180493BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="m_-128719761561180493PlainText">Hi,<br>
<br>
Could you provide some more information on what happens in applying<br>
vtkGeometryFilter to quadratic tetra grids. At least, the following<br>
simple code works without any problem using vtk 7.1.1.<br>
<br>
---<br>
import vtk<br>
<br>
def main():<br>
<br>
  points = vtk.vtkPoints()<br>
  points.InsertNextPoint(0, 0, 0)<br>
  points.InsertNextPoint(1, 0, 0)<br>
  points.InsertNextPoint(1, 1, 0)<br>
  points.InsertNextPoint(0.5, 0.5, 0.5)<br>
  points.InsertNextPoint(0.5, 0, 0)<br>
  points.InsertNextPoint(1, 0.5, 0)<br>
  points.InsertNextPoint(0.5, 0.5, 0)<br>
  points.InsertNextPoint(0.25, 0.25, 0.25)<br>
  points.InsertNextPoint(0.75, 0.25, 0.25)<br>
  points.InsertNextPoint(0.75, 0.75, 0.25)<br>
<br>
  unstructuredGrid = vtk.vtkUnstructuredGrid()<br>
  unstructuredGrid.SetPoints(points)<br>
<br>
  quadraticTetra = vtk.vtkQuadraticTetra()<br>
<br>
  for i in range(10):<br>
    quadraticTetra.GetPointIds().SetId(i, i)<br>
<br>
  cellArray = vtk.vtkCellArray()<br>
  cellArray.InsertNextCell(quadraticTetra)<br>
<br>
  unstructuredGrid.SetCells(vtk.VTK_QUADRATIC_TETRA, cellArray)<br>
<br>
  print('quadraticTetra: ')<br>
  print(' cell number: {}'.format(unstructuredGrid.GetNumberOfCells()))<br>
  print(' point number: {}\n'.format(unstructuredGrid.GetNumberOfPoints()))<br>
<br>
  geometryFilter = vtk.vtkGeometryFilter()<br>
  geometryFilter.SetInputData(unstructuredGrid)<br>
  geometryFilter.Update()<br>
<br>
  print('extracted surface: ')<br>
  print(' cell number:<br>
{}'.format(geometryFilter.GetOutput().GetNumberOfCells()))<br>
  print(' point number:<br>
{}'.format(geometryFilter.GetOutput().GetNumberOfPoints()))<br>
<br>
  mapper = vtk.vtkPolyDataMapper()<br>
  mapper.SetInputConnection(geometryFilter.GetOutputPort())<br>
<br>
  actor = vtk.vtkActor()<br>
  actor.SetMapper(mapper)<br>
  actor.GetProperty().EdgeVisibilityOn()<br>
<br>
  renderer = vtk.vtkRenderer()<br>
  renderer.AddActor(actor)<br>
<br>
  renderer.ResetCamera()<br>
  renderer.GetActiveCamera().Azimuth(210)<br>
  renderer.GetActiveCamera().Elevation(30)<br>
<br>
  renderWindow = vtk.vtkRenderWindow()<br>
  renderWindow.SetSize(640, 480)<br>
  renderWindow.AddRenderer(renderer)<br>
<br>
  renderWindowInteractor = vtk.vtkRenderWindowInteractor()<br>
  renderWindowInteractor.SetRenderWindow(renderWindow)<br>
<br>
  renderWindowInteractor.Start()<br>
<br>
<br>
if __name__ == '__main__':<br>
    main()<br>
---<br>
<br>
Regards,<br>
2018年8月18日(土) 4:17 Nguyen, Giang Hoang <<a href="mailto:ghnguyen@wpi.edu" target="_blank" rel="noreferrer">ghnguyen@wpi.edu</a>>:<br>
><br>
> Hi,<br>
><br>
><br>
> I would like to confirm here if vtkGeometryFilter doesn't work for unstructured grids that are quadratic tetra (10 nodes per cell). I was using it to convert an unstructured grid to polydata, using vtkpython in conda environment. The exact code works fine
 for unstructured grids with triangle cells. I looked at the cxx source for vtkGeometryFilter at
<a href="https://github.com/Kitware/VTK/blob/master/Filters/Geometry/vtkGeometryFilter.cxx" target="_blank" rel="noreferrer">
https://github.com/Kitware/VTK/blob/master/Filters/Geometry/vtkGeometryFilter.cxx</a> and it seems like the quadratic cells are not supported? In that case, what other approaches should I look into? Thanks in advance.<br>
><br>
><br>
> Best,<br>
><br>
> Giang<br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank" rel="noreferrer">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank" rel="noreferrer">
http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" rel="noreferrer">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank" rel="noreferrer">http://markmail.org/search/?q=vtkusers</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="https://public.kitware.com/mailman/listinfo/vtkusers" target="_blank" rel="noreferrer">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</div>
</span></font></div>
</div>

_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div>