Skip to content

PLYLoader fails to parse PLYExporter output #13966

@dbkaplun

Description

@dbkaplun

The error:

    TypeError: Cannot read property 'properties' of undefined
      33 |       .toEqual(plyData.toString('utf8'));
      34 | 
    > 35 |     const plyGeom = new THREE.PLYLoader().parse(plyData);
      36 |     expect(plyGeom.getAttribute('position').count)
      37 |       .toEqual(geom.vertices.length);
      38 |   });
      
      at parseASCII (node_modules/three/examples/js/loaders/PLYLoader.js:273:72)
      at Object.<anonymous>.THREE.PLYLoader.parse (node_modules/three/examples/js/loaders/PLYLoader.js:471:15)
      at _callee2$ (test/VFFLoader.test.js:35:43)

Here's the repro.

    const plyData = await fixture('airway.vff.ply');
    expect(new THREE.PLYExporter().parse(exportMesh))
      .toEqual(plyData.toString('utf8'));

    const plyGeom = new THREE.PLYLoader().parse(plyData); // throws error
    expect(plyGeom.getAttribute('position').count)
      .toEqual(geom.vertices.length);

To test: (sorry for the annoying repro steps)

git clone [email protected]:CustomOrthopaedics/vff-loader.git
cd vff-loader
git checkout 766457
npm install
npm test

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions