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

Extremely long triangles can result in poor tree construction #121

Closed
gkjohnson opened this issue Oct 22, 2019 · 0 comments · Fixed by #127
Closed

Extremely long triangles can result in poor tree construction #121

gkjohnson opened this issue Oct 22, 2019 · 0 comments · Fixed by #127
Labels
bug Something isn't working build performance

Comments

@gkjohnson
Copy link
Owner

gkjohnson commented Oct 22, 2019

If a geometry has extremely long triangles then it can result in nonoptimal bounds tree. Consider a 5 x 5 plane with the middle 3 x 3 vertices being offset by a large number:

0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 X X X 0 0
0 0 X X X 0 0
0 0 X X X 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0

0 is not offset, X is offset by 50 units in z

The current algorithm always uses the longest edge for both CENTER and AVERAGE strategies but in the above case for the first many splits with will almost always be on the Z Axis because even after splitting on z the triangles must be encapsulated by the bounds meaning the bounding box is just as long as the parent and Z will again be selected as the long edge.

It may be more intensive but selecting an edge based on how much resultant bounds overlap there is or which axis has the widest distribution of triangle centroids might be best.

Possible solutions

  • take the axis that has the most spread out centroids
  • take the axis that has on average the thinnest bounds

edit: A flat strip of triangles will illustrate this same behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant