PLYLoader fails to parse PLYExporter output
See original GitHub issueThe 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 git@github.com:CustomOrthopaedics/vff-loader.git
cd vff-loader
git checkout 766457
npm install
npm test
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
PLYExporter – three.js docs
Instantiate an exporter const exporter = new PLYExporter(); // Parse the input and generate the ply output const data = exporter.parse( scene, ...
Read more >three.js - threejs r82 plyloader with PointsMaterial and Points
I got it working again. All I needed to do was convert the geometry before creating the points. var geo = new THREE.Geometry()....
Read more >Ply file reader - ALCA Profumerie
Select File, then Export Scans and choose plyVC in Scans output ... to define 3D polygonal models. ply:1: parse error After saving the ......
Read more >Assimp: material.h File Reference
If the model format does not define this, it is left to the application to decide ... For very common texture types, such...
Read more >threejs-ply-loader - npm
Node.js wrapper for three.js PLYLoader. Latest version: 2.0.2, last published: a year ago. Start using threejs-ply-loader in your project by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @dbkaplun! It sounds like VFF is a point cloud format, which the ply exporter doesn’t currently handle. I’d be happy to help with updating the exporter so it does, though.
I’m not able to run the repro steps at the moment, but it looks like the error on import might be because the face count is exported as a fractional number, which is obviously bad (and should probably throw an error when exporting).
Ultimately the exporter should be updated to handle point data export by omitting the element and face property fields in the header. I think the right solution would be to exclude the face list completely when exporting geometry with no index array, but that gets a bit more complicated when exporting an Object3D hierarchy with multiple meshes of different types. At the very least I can add that to the list of limitations of the exporter.
I’ll have to think about how to handle multiple meshes a bit more and look into what the PLY format offers to support that. I’ll add a couple issues in the PLY exporter repo when I get a chance, as well.
Thanks! Garrett
Another option would be GLTFExporter -> GLTFLoader, both of which do support point data.