[vtkusers] Polyhedron pvtu

Feng Xing snakexf at gmail.com
Wed May 6 09:46:43 EDT 2015


Hello Hervé,

Thank you much for your replying! But my problem is about writing the file .pvtu. I have two files: p1.vtu and p2.vtu which contain the polyhedrons. They are written by two MPI procs separately. Paraview could display them well. I used the writer vtkXMLPUnstructuredGridWriter to generate the file p.pvtu, but Paraview display nothing by reading p.pvtu. 

The file p.pvtu is like this. It works for pixel, polygon etc.. But not for Polyhedron.

<?xml version="1.0"?>
<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor">
  <PUnstructuredGrid GhostLevel="0">
    <PPoints>
      <PDataArray type="Float32" Name="Points" NumberOfComponents="3"/>
    </PPoints>
    <Piece Source="p0.vtu"/>
    <Piece Source="p1.vtu"/>
  </PUnstructuredGrid>
</VTKFile>

Regards,
Feng



> On 06 May 2015, at 15:31, Hervé Gross <hgross at ar2tech.com> wrote:
> 
> Hi Feng,
> 
> This link is useful:
> http://www.simpleitk.org/Wiki/VTK/Polyhedron_Support <http://www.simpleitk.org/Wiki/VTK/Polyhedron_Support>
> 
> It explains the concept of facestream, necessary to write/read a polyhedron. Also, here is a simple example with a tetrahedron written as a polyhedron:
> 
> <?xml version="1.0"?>
> <VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
> <UnstructuredGrid>
> <Piece NumberOfPoints="4" NumberOfCells="1">
> <PointData>
> </PointData>
> <CellData>
> <DataArray type="Float64" Name="volume" Format="ascii">
> .169
> </DataArray>
> </CellData>
> <Points>
> <DataArray type="Float64" Name="Points" NumberOfComponents="3" format="ascii" RangeMin="0" RangeMax="1">
> 0 0 0
> 1 0 0
> .5 1 0
> .5 .5 1
> </DataArray>
> </Points>
> <Cells>
> <DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="0" RangeMax="3">
> 0 1 2 3
> </DataArray>
> <DataArray type="Int64" Name="offsets" format="ascii" RangeMin="4" RangeMax="4">
> 4
> </DataArray>
> <DataArray type="UInt8" Name="types" format="ascii" RangeMin="42" RangeMax="42">
> 42
> </DataArray>
> <DataArray type="Int64" Name="faces" format="ascii" RangeMin="0" RangeMax="4">
> 4 3 0 1 2
> 3 0 1 3
> 3 1 2 3
> 3 0 2 3
> </DataArray>
> <DataArray type="Int64" Name="faceoffsets" format="ascii" RangeMin="17" RangeMax="17">
> 17
> </DataArray>
> </Cells>
> </Piece>
> </UnstructuredGrid>
> </VTKFile>
> 
> Hope this helps,
> 
> Herve
> 
> 
> 
> 
> Herve Gross, PhD
> 
> ADVANCED RESOURCES AND RISK TECHNOLOGIES
> www.ar2tech.com <http://www.ar2tech.com/>
> 
> On Wed, May 6, 2015 at 4:36 AM, Feng Xing <snakexf at gmail.com <mailto:snakexf at gmail.com>> wrote:
> Dear everyone, 
> 
> I would like to write a .pvtu file for Polyhedron mesh. I tried to use vtkXMLPUnstructuredGridWriter, it seems that it does not work. Paraview display nothing by reading the file .pvtu. However,  the visu is successful by reading the .vtu files. I found in google someone said there is a bug some years ago : http://public.kitware.com/pipermail/vtk-developers/2013-January/028078.html <http://public.kitware.com/pipermail/vtk-developers/2013-January/028078.html>.
> 
> Another way I would like to try is that I write the file .pvtu by myself, but I didn’t find the doc for Polyhedron. Thank you very much for help.
> 
> Feng Xing
> Postdoc INRIA France
> 
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com/>
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html <http://www.kitware.com/opensource/opensource.html>
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ <http://www.vtk.org/Wiki/VTK_FAQ>
> 
> Search the list archives at: http://markmail.org/search/?q=vtkusers <http://markmail.org/search/?q=vtkusers>
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers <http://public.kitware.com/mailman/listinfo/vtkusers>
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150506/191269e1/attachment.html>


More information about the vtkusers mailing list