[vtkusers] vtkOBJReader not reading the whole mesh

Bill Lorensen bill.lorensen at gmail.com
Wed Dec 13 15:35:43 EST 2017


There must be a bug in the OBJImporter. It reports 4 actors, but only
one has polygons. The others report 0 polygons.

I'll take a look.


On Wed, Dec 13, 2017 at 2:07 PM, Tony Yuan <tonyuanac at gmail.com> wrote:
> Hi Sebastien,
>
> The js loader works fine, but I couldn’t get the same behavior in C++. I
> tried to see if the reader has multiple outputs, but
> objReader.getNumberOfOutputPorts() returns 1.
>
> I am interested in getting the mesh as a vtkPolyData, is there a way I can
> do that with OBJImporter? There seems to be no GetOutput function like
> OBJReader.
>
> Tony
>
> On Dec 13, 2017, at 12:25 PM, Sebastien Jourdain
> <sebastien.jourdain at kitware.com> wrote:
>
> The file you sent have several materials and I think that the vtkOBJReader
> just read the first one as it is focusing on the mesh only.
>
> Your file is correct and I've tried it with vtk.js with success here:
> https://kitware.github.io/vtk-js/examples/OBJViewer.html
>
> But you may have more luck with the importer which could also process the
> mtl file that should come along. That way all the pieces that compose that
> object will be loaded.
>
> Seb
>
> On Wed, Dec 13, 2017 at 9:40 AM, Tony Yuan <tonyuanac at gmail.com> wrote:
>>
>> Hi,
>>
>> I have a problem reading Blender OBJ files using VTK. The vtkOBJReader
>> seems to only read part of the mesh. When I render the data being read it
>> looks like this:
>>
>>
>>
>> However, when I import the OBJ file in Meshlab it looks fine. Mac’s
>> Preview is also able to open the complete mesh.
>>
>>
>>
>> I attached the OBJ file and my code below. I am not very familiar with the
>> OBJ format and how vtkOBJReader is implemented. If someone could point me to
>> the problem and possible fixes, that would be great.
>>
>>
>>
>> Thanks,
>> Tony
>>
>>
>> _______________________________________________
>> 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
>>
>
>
>
> _______________________________________________
> 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


More information about the vtkusers mailing list