Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect triangle orientation after triangulation #187

Open
longxiangxu321 opened this issue Jun 25, 2024 · 0 comments
Open

incorrect triangle orientation after triangulation #187

longxiangxu321 opened this issue Jun 25, 2024 · 0 comments

Comments

@longxiangxu321
Copy link

longxiangxu321 commented Jun 25, 2024

Describe the bug
Some of the triangles has wrong normals.

cjio version
cjio v0.9.0

To Reproduce

cjio 9-284-556.city.json lod_filter 2.2 triangulate save tudelft.city.json

with sloppy:

cjio 9-284-556.city.json lod_filter 2.2 triangulate --sloppy save tudelft_sloppy.city.json

Both operation give warning:

\cjio\geom_help.py:42: RuntimeWarning: overflow encountered in scalar multiply
  n[0] += ( (poly[i][1] - poly[ne][1]) * (poly[i][2] + poly[ne][2]) )
\cjio\geom_help.py:44: RuntimeWarning: overflow encountered in scalar multiply
  n[2] += ( (poly[i][0] - poly[ne][0]) * (poly[i][1] + poly[ne][1]) )
\cjio\geom_help.py:43: RuntimeWarning: overflow encountered in scalar multiply
  n[1] += ( (poly[i][2] - poly[ne][2]) * (poly[i][0] + poly[ne][0]) )

Expected behavior
The triangles should have consistent orientation/nomral of corresponding face.

Screenshots
Surface normals of raw cityjson file:
libiary_raw

Surface normals of triangulated file:
library_triangulated

Surface normals of the triangulated(sloppy) file:
library_sloppy

Desktop (please complete the following information):

  • OS: Windows
  • Version 11
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

No branches or pull requests

1 participant