CesiumGS/3d-tiles-tools

Consider a command to fix certain alignment errors

javagl opened this issue · 1 comments

This is a spin-off from #5 : The requirements for Padding in 3D Tiles - specifically, certain alignment requirements for tile content files like B3DM - have made their way into the specification relatively late. And there are still many B3DM files out there that do not meet these requirements. These files will be declared to be 'invalid' by the 3D Tiles Validator.

(In fact, even the spec files for CesiumJS did not meet these alignment requirements, and have been fixed only recently...)

While CesiumJS can process these files even when they do not meet these requirements, there is a huge potential for inconsistencies and fragmentation: Implementors should not be "forced" to be able to read "invalid" files.

Many of these alignment issues could be fixed relatively easily: The 3D Tiles Tools already offer the functionality to

The latter will already ensure most (all?) of the common alignment requirements.

So fixing the alignment could be a one-liner...
fs.writeFileSync("out", createTileDataBuffer(readTileData(fs.readFileSync("in")))
which should unfold only into "a few" real lines of code, with input/output type checks, 'overwrite' checks, and a proper command line command.

Fixed via #136