cityjson / cjio

CityJSON/io: Python CLI to process and manipulate CityJSON files
MIT License
119 stars 31 forks source link

Flipped surfaces after triangulating a city model #139

Closed robinjo78 closed 1 year ago

robinjo78 commented 2 years ago

Describe the bug After using the triangulation function on a tile from the 3D BAG dataset, I found out that some surfaces of some of the buildings in the tile are flipped. It appears as a 'hole' when visualising in Ninja.

cjio version Version 0.7.3

To Reproduce Download this tile. Then upgrade the CiytJSON file to version 1.1 and triangulate it. The commands are: cjio 3dbag_v210908_fd2cee53_5910.json upgrade save 3dbag_5910_v11.city.json cjio 3dbag_5910_v11.city.json triangulate save 3dbag_5910_v11_triangulated.city.json Visualise the last cityjson file in Ninja.

Expected behavior Some surfaces of some buildings are expected to be flipped in orientation. This appears as a hole in the building.

Screenshots image

Desktop:

hugoledoux commented 2 years ago
  1. Which branch did you use?
  2. Did you use triangulate --sloppy?
  3. And are they flipped or simply not present?
  4. Can you isolate it to one building please?
robinjo78 commented 2 years ago
  1. I just used the cjio version I get when I installed it with pip install. It is version 0.7.3., so I guess it is just the main branch.
  2. No. See command in the issue.
  3. I guess they are flipped. See image: image
  4. See image. I took a subset of the json file by taking the building with the id shown in the image.
hugoledoux commented 2 years ago

I cannot reproduce your bug.

So I isolated one building that goes bad for you in the image you sent, get it there: https://hugoledoux.stackstorage.com/s/H4wsx4wVYXuZ2nKr

if you triangulate that one, with and without --sloppy, you get errors?

And ninja does the same?