thinkingmachines / geowrangler

🌏 A python package for wrangling geospatial datasets
https://geowrangler.thinkingmachin.es/
MIT License
47 stars 14 forks source link

update voxel traversal algo using only integer arithmetic #246

Closed joshuacortez closed 1 month ago

joshuacortez commented 1 month ago

This PR uses a more elegant implementation of voxel traversal using integer arithmetic that is not prone to floating point precision errors. It was inspired by the supercover lines implementation in this blog post

A key difference of the new voxel traversal implementation is it doesn't include excessive grid cells as seen in the example below comparing the before and after:

Before: image

After: image

review-notebook-app[bot] commented 1 month ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

joshuacortez commented 1 month ago

curious q re the line of sight case they mention -- does the logic handle this? https://www.redblobgames.com/grids/line-drawing/#line-of-sight

@tm-jc-nacpil I think that's more of a game dev concern! For simulating light that should be blocked by walls or characters that should be blocked. Not a concern for polygon filling

joshuacortez commented 1 month ago

ohhh apparently we also need @butchtm 's review also to merge