[vtkusers] vtkPLYWriter and obj_info

Bill Lorensen bill.lorensen at gmail.com
Wed Jul 1 08:33:09 EDT 2015


I think the obj_info has been there a long time… Your fix look good.


On Wed, Jul 1, 2015 at 8:05 AM, Greg Von Kuster <greg at bx.psu.edu> wrote:
> Hi Bill,
>
> Thanks for your response on this.  We’re using the PLYLoader.js library discussed here...
>
> https://github.com/mrdoob/three.js/blob/master/examples/webgl_loader_ply.html
>
> …to load PLY files into a VTK based viewer.
>
> If the obj_info lines are valid, do you know if have they been recently introduced into the PLY format?  If so, perhaps the PLYLoader library needs to be enhanced to handle them.
>
> In my local version of the library, I find myself having to add the following:
>
>         parseHeader: function ( data ) {
>
>                 var patternHeader = /ply([\s\S]*)end_header\s/;
>                 var headerText = "";
>                 var headerLength = 0;
>                 var result = patternHeader.exec( data );
>>                 // Hack to handle obj_info lines generated by vtk.vtkPLYWriter()
>                 case "obj_info”:
>                         header.comments.push(line);
>                         break;
>
> Thanks again!
>
> Greg Von Kuster
>
>
>> On Jun 30, 2015, at 5:05 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>
>> Sounds like a bug in the library you are using. I see lots of
>> references to obj_info in a google search:
>> https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=obj_info%20ply
>>
>> Bill
>>
>>
>> On Tue, Jun 30, 2015 at 4:22 PM, Alex Pletzer <axp5530 at psu.edu> wrote:
>>> All,
>>>
>>> I noticed that vtkPLYWriter writes a "obj_info" field, an example can be
>>> seen below. This is causing some applications, such as the THREE.PLYLoader
>>> method to fail when reading PLY files produced by vtkPLYWriter.
>>>
>>> None of the documents describing the PLY format
>>> (https://en.wikipedia.org/wiki/PLY_%28file_format%29 or
>>> http://paulbourke.net/dataformats/ply/) mentions this field, although it is
>>> present in the bunny file from http://graphics.stanford.edu/data/3Dscanrep/.
>>>
>>> Hence, it would seem that for maximum portability the obj_info line should
>>> be removed. Is there any way one can prevent vtkPLYWriter from writing this
>>> line?
>>>
>>> Thanks in advance.
>>>
>>> --Alex
>>>
>>> Typical header from a PLY file written by VTK:
>>>
>>> ply
>>> format ascii 1.0
>>> comment VTK generated PLY File
>>> obj_info vtkPolyData points and polygons: vtk4.0
>>> element vertex 198
>>> property float x
>>> property float y
>>> property float z
>>> element face 192
>>> property list uchar int vertex_indices
>>> end_header
>>> ....
>>>
>>> ...
>>>
>>> _______________________________________________
>>> 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
>>>
>>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/vtkusers
>>>
>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the vtkusers mailing list