unibas-gravis / scalismo-faces

Scalable Image Analysis and Shape Modelling: Module to work with 2d images, with a focus on face images
Apache License 2.0
118 stars 27 forks source link

OptionalColorNormalMesh writes no color when normals are missing (PLY-Format) #100

Closed Andreas-Forster closed 6 years ago

Andreas-Forster commented 6 years ago

When an OptionalColorNormalMesh is passed to scalismo.faces.MeshIO.write without having normals then only the shape is written to the file.

  val shape: TriangleMesh3D = ???
  val color: Option[TextureMappedProperty[RGBA]] = ???
  val mesh = OptionalColorNormalMesh3D(shape,color,None)
  MeshIO.write(mesh, new File("/tmp/a.ply"))

However, it would be easily possible to calculate normals from the shape and use them. As a user, it is not obvious that the color/texture is not written just because there are the normals missing. I consider this a bug, otherwise, we should not expose the interface taking an OptionalColorNormalMesh.