Skip to content

Conversation

@yann-lty
Copy link
Member

@yann-lty yann-lty commented Jul 10, 2019

Description

This PR adds vertex color data in Mesh class, with OBJ file format IO support. Regarding software, vertex colors are written in Meshing step's output OBJ file and correctly preserved during MeshFiltering.

Features list

  • [mesh] IO: read/write vertex colors from/to OBJ files
  • [software] Meshing: write vertex colors in output OBJ file
  • [mesh] preserve vertex color data in MeshClean::cleanMesh
  • [software] MeshFiltering: clear free points from mesh after cleaning operations
  • Make mesh output coloring optional

Implementation remarks

Vertex colors are written as 3 additional floats per vertex line in OBJ files. It is not part of the official OBJ file format description but it is supported by several software.

From: https://en.wikipedia.org/wiki/Wavefront_.obj_file#Geometric_vertex

A vertex can be specified in a line starting with the letter v. That is followed by (x,y,z[,w]) coordinates. W is optional and defaults to 1.0. Some applications support vertex colors, by putting red, green and blue values after x y and z. The color values range from 0 to 1.

yann-lty added 5 commits July 10, 2019 16:23
avoid confusions with 'colors' member variable that will be introduced in next commits
* IO: read/write colors from/to OBJ file format
* clean: remove unused transformGlobal member variable
* simplify addMesh method code
* copy colors data from input mesh if any
remap vertex colors to reflect changes in mesh topology after the cleaning operation
yann-lty added 3 commits July 10, 2019 17:42
Previous version was mostly to keep things close to legacy code, but it seems better to write new code as we intend to.
Make the colorization of output dense point cloud and mesh optional.
@yann-lty yann-lty requested review from cvere and fabiencastan July 12, 2019 08:03
@yann-lty yann-lty added this to the 2019.2 milestone Jul 12, 2019
* split `exportPointCloud` into createDenseSfMData / `removeLandmarksWithoutObservations`
* colorize mesh before landmark filtering to avoid having indices mapping
* factorize output result writing code for all methods
@fabiencastan fabiencastan merged commit 8cfb63b into develop Jul 16, 2019
@fabiencastan fabiencastan deleted the dev/coloredMesh branch July 16, 2019 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants