[vtkusers] Problem of writing vtp file

Chenxi Zhang chenxizhang at fudan.edu.cn
Thu Aug 15 22:29:07 EDT 2013


HI,
 
   my result vtp file is as following:



<?xml version="1.0"?>
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor">
  <PolyData>
    <Piece NumberOfPoints="9617"                 NumberOfVerts="0"                    NumberOfLines="0"                    NumberOfStrips="0"                    NumberOfPolys="0"                   >
      <PointData>
      </PointData>
      <CellData>
      </CellData>
      <Points>
        <DataArray type="Float32" Name="Points" NumberOfComponents="3" format="appended" RangeMin="63.129833223"         RangeMax="85.854495209"         offset="0"                   />
      </Points>
      <Verts>
        <DataArray type="Int32" Name="connectivity" format="appended" RangeMin=""                     RangeMax=""                     offset="27368"               />
        <DataArray type="Int32" Name="offsets" format="appended" RangeMin=""                     RangeMax=""                     offset="27384"               />
      </Verts>
      <Lines>
        <DataArray type="Int32" Name="connectivity" format="appended" RangeMin=""                     RangeMax=""                     offset="27400"               />
        <DataArray type="Int32" Name="offsets" format="appended" RangeMin=""                     RangeMax=""                     offset="27416"               />
      </Lines>
      <Strips>
        <DataArray type="Int32" Name="connectivity" format="appended" RangeMin=""                     RangeMax=""                     offset="27432"               />
        <DataArray type="Int32" Name="offsets" format="appended" RangeMin=""                     RangeMax=""                     offset="27448"               />
      </Strips>
      <Polys>
        <DataArray type="Int32" Name="connectivity" format="appended" RangeMin=""                     RangeMax=""                     offset="27464"               />
        <DataArray type="Int32" Name="offsets" format="appended" RangeMin=""                     RangeMax=""                     offset="27480"               />
      </Polys>
    </Piece>
  </PolyData>
  <AppendedData encoding="base64">


my vtp file missed the information:
 
        <PointData Normals="Normals">
        <DataArray type="Float32" Name="Normals" NumberOfComponents="3" format="appended" RangeMin="0.9999999539"         RangeMax="1.0000000487"         offset="0"                   />
        <DataArray type="Int32" Name="vtkOriginalPointIds" format="appended" RangeMin="0"                    RangeMax="128448"               offset="1541392"             />
      


   How can I add the normal information?  In the example http://vtk.org/Wiki/VTK/Examples/Cxx/IO/WriteVTP, the method for adding normal is not mentioned. 


    Thanks


Chenxi
       





-----原始邮件-----
发件人: "Bill Lorensen" <bill.lorensen at gmail.com>
发送时间: 2013年8月16日 星期五
收件人: "Chenxi Zhang" <chenxizhang at fudan.edu.cn>
抄送: "VTK Users" <vtkusers at vtk.org>
主题: Re: [vtkusers] Problem of writing vtp file


What is wrong with the file create?





On Thu, Aug 15, 2013 at 12:43 PM, Chenxi Zhang <chenxizhang at fudan.edu.cn> wrote:
HI

   I have a set of points.I want to creat a vtp file like that:

 <VTKFile type="PolyData" version="0.1" byte_order="LittleEndian">
  <PolyData>
    <Piece NumberOfPoints="128449"               NumberOfVerts="128449"               NumberOfLines="0"                    NumberOfStrips="0"                    NumberOfPolys="0"                   >
      <PointData Normals="Normals">
        <DataArray type="Float32" Name="Normals" NumberOfComponents="3" format="appended" RangeMin="0.9999999539"         RangeMax="1.0000000487"         offset="0"                   />
        <DataArray type="Int32" Name="vtkOriginalPointIds" format="appended" RangeMin="0"                    RangeMax="128448"               offset="1541392"             />
      </PointData>
      <CellData>
      </CellData>
      <Points>
        <DataArray type="Float32" Name="Points" NumberOfComponents="3" format="appended" RangeMin="0.0080462906331"      RangeMax="0.11603941536"        offset="2055192"             />
      </Points>
      <Verts>
        <DataArray type="Int32" Name="connectivity" format="appended" RangeMin=""                     RangeMax=""                     offset="3596584"             />
        <DataArray type="Int32" Name="offsets" format="appended" RangeMin=""                     RangeMax=""                     offset="4110384"             />
      </Verts>
      <Lines>
        <DataArray type="Int32" Name="connectivity" format="appended" RangeMin=""                     RangeMax=""                     offset="4624184"             />
        <DataArray type="Int32" Name="offsets" format="appended" RangeMin=""                     RangeMax=""                     offset="4624188"             />
      </Lines>
      <Strips>
        <DataArray type="Int32" Name="connectivity" format="appended" RangeMin=""                     RangeMax=""                     offset="4624192"             />
        <DataArray type="Int32" Name="offsets" format="appended" RangeMin=""                     RangeMax=""                     offset="4624196"             />
      </Strips>
      <Polys>
        <DataArray type="Int32" Name="connectivity" format="appended" RangeMin=""                     RangeMax=""                     offset="4624200"             />
        <DataArray type="Int32" Name="offsets" format="appended" RangeMin=""                     RangeMax=""                     offset="4624204"             />
      </Polys>
    </Piece>
  </PolyData>
  <AppendedData encoding="raw">
    
   I followed the example:
   http://vtk.org/Wiki/VTK/Examples/Cxx/IO/WriteVTP,
   but I can't creat the vtp like the above.

   Could you please tell me what went wrong?

   Thanks a lot.

Chenxi



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 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

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers





-- 
Unpaid intern in BillsBasement at noware dot com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130816/90a81761/attachment.htm>


More information about the vtkusers mailing list