It works by reading the XML, extracting buildings (only buildings for now), converting coordinates of the geometric primitives, and then writing a single batched 3DTiles file.
The code for writing 3DTiles is based on the 3D Tiles Samples Generator (https://github.com/AnalyticalGraphicsInc/3d-tiles-tools/tree/master/samples-generator).
If you want to try it out, make sure you have a recent version of NodeJS with ESM module support (I'm using v9.9).
To convert the "3dified" CityGML of Delft:
Very useful tool! I have tried it on my own dataset, and it seems to work very well. I have noticed one small thing though: concave shapes are not always rendered correctly (example from the Delft dataset: https://imgur.com/a/eBBxA). I would love to contribute and fix it, but unfortunately I am not sufficiently familiar with node.js. If you would be able to have a look at it, could you please let me know?
Thanks for the feedback Jelle!
Indeed the triangulation for concave "linear rings" was completely wrong.
I'm now using a library to do that (libtess.js), and it works much better:
I've released a new version v0.0.4.
Awesome, works perfectly!
Hello I want work with citygml-to-3dtiles, but when I try with example Delft I get ERRor
Can you help me
@Denis the image you wanted to upload doesn't show up.
Feel free to open a ticket on Github if it's easier:
I would like to seek for your assitance regarding to the issue I faced.
Currently only a few predefined projections are available.
I've added the projection you mentioned to the list of predefined projections:
When using the project as a NodeJS library you *can* configure
It should be easy enough to allow passing additional projections from
a command line argument. Unfortunately I currently don't have the time
to implement it. If you do, I will be happy to accept a pull request.
Hope that helps.
found your tool, but got problems with bug datasets - indexBuffer value out of bounds, if you use indexBuffer.writeUInt16LE - it is bounded to 65535.
Unfortunately I haven't seen that error message before, and therefore
cannot help you with a solution.
I'm not actively using/maintaining "citygml-to-3dtiles" (it was more
of a personal experiment). I hope you find a way to solve the problem!