draco icon indicating copy to clipboard operation
draco copied to clipboard

encoder error: Failed loading the input mesh

Open llin55 opened this issue 9 years ago • 9 comments

I'm getting errors encoding some meshes - here is a sample mesh exported to obj and ply button.zip

encoding the mesh exported without normals:

$ draco_encoder -i button.obj -o o.drc
Failed loading the input mesh.

I found that the same mesh when exported to PLY with normals gives another error message:

$ draco_encoder -i button_normals.ply -o o.drc
Encoder options:
  Compression level = 7
  Positions: Quantization = 14 bits
  Normals: Quantization = 10 bits

terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 223) >= this->size() (which is 114)
Aborted (core dumped)

I have a project with >1000 meshes and ~5% of them fail to encode with draco while they all encode properly with CTM or corto

if you need anything else to investigate the problem please let me know.

llin55 avatar Aug 31 '17 18:08 llin55

@llin55 Thanks for the report. I'll investigate it

ondys avatar Sep 06 '17 22:09 ondys

@llin55 The problem is that the input files contain non-triangular polygons that are currently not supported by Draco. To be more specific Draco automatically triangulates quad polygons into two triangles but the linked .obj has a 20-side polygonal face that Draco currently cannot process.

While in future releases we may add support for general polygons, for now I would recommend to triangulate your models before they are send to draco (that can be done for example by Meshlab).

ondys avatar Sep 06 '17 23:09 ondys

@ondys Has the problem been solved?

jamesXG avatar Nov 25 '19 05:11 jamesXG

Has it?

zainjer avatar Jun 04 '20 06:06 zainjer

any news?

rachellimaa avatar Dec 29 '20 17:12 rachellimaa

yes, mesh triangulation solves the problem

llin55 avatar Dec 29 '20 18:12 llin55

yes, mesh triangulation solves the problem

what does mesh triangulation mean

herrdu avatar Aug 02 '21 08:08 herrdu

Hi, What about mesh that are not supposed to be triangulated? (Points or curves) I supposed that we have to use PointCloud encoder but can we mix mesh buffer and point cloud buffer in the same draco buffer?

Is there a way to uniformise them to mesh?

jeremyDiota avatar Feb 01 '22 11:02 jeremyDiota

This error can also happen if you have degenerate indices (if a tri is specified by indices i0,i1,i2 and i0 == i1 || i0 == i2 || i1 == i2). If you prune these indices, make sure that the indices count is > 0 otherwise you will get a different error ("Could not convert indices")

Kh4n avatar Jul 05 '22 22:07 Kh4n