PotreeConverter: repaired bounding boxes rounding problem?
PotreeConverter_2.1_x64_windows doesn’t like the bounding boxes of LAZ files that have been repaired with LAStools-2021-07-20/lasinfo -repair_bb that appear to be due to rounding values…
ERROR(chunker_countsort_laszip.cpp:237): encountered point outside bounding box.
box.min: -10.192, -14.1157, -1.7038
box.max: 17.855499999999999, 13.931799999999999, 26.343699999999998
point: 7.3163, 13.931800000000001, -1.649
file: whatever.laz
PotreeConverter requires a valid bounding box to operate.
Please try to repair the bounding box, e.g. using lasinfo with the -repair_bb argument.
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 17
Commits related to this issue
- fix bounding box issue see https://github.com/potree/PotreeConverter/issues/535#issuecomment-1826801830 — committed to exxlr/PotreeConverter by deleted user 2 years ago
- fix bounding box issue see https://github.com/potree/PotreeConverter/issues/535#issuecomment-1826801830 — committed to exxlr/PotreeConverter by deleted user 2 years ago
- las: Do bounding box check comparison with floating point epsilon. Hopefully works around encountered point outside bounding box error. Inspired by: https://github.com/potree/PotreeConverter/i... — committed to nh2/PotreeConverter by nh2 3 years ago
- las: Do bounding box check comparison with floating point epsilon. Hopefully works around encountered point outside bounding box error. Inspired by: https://github.com/potree/PotreeConverter/i... — committed to nh2/PotreeConverter by nh2 3 years ago
- chunker_countsort_laszip: Debug logs for epsilon comparison failure See: https://github.com/potree/PotreeConverter/issues/535#issuecomment-2692336475 — committed to nh2/PotreeConverter by nh2 2 years ago
- las: Fix double->int->double forward-backward epsilon comparison failure See: https://github.com/potree/PotreeConverter/issues/535#issuecomment-2692336475 I found some inputs for which ux = ux:... — committed to nh2/PotreeConverter by nh2 2 years ago
For me, the following patch solved the issue:
@m-schuetz What is the purpose of these added computations in your commit?
https://github.com/potree/PotreeConverter/commit/5307150e84f1335e645e6561bee6c5a2078135bc#diff-1fc6aa609a43bfd39fe0cc841ebc85b43f4c9c2da48d3414d218d06156784114R198-R210
https://github.com/potree/PotreeConverter/blob/5307150e84f1335e645e6561bee6c5a2078135bc/Converter/src/chunker_countsort_laszip.cpp#L199-L210
The expression
double(X) * posScale.x + posOffset.xshould just bex.Proof:
So I think the code was better as was before your commit, namely:
By going via
int32_t X(computing back to integers, just to immediately convert back to float the inverse way), the only thing that seems to be achieved is loss-of-floating-point-precision, and thus the<=comparison errors in this ticket.Am I missing something?
My understanding is that the main fix to the problem #426 was the addition of (
computeScaleOffset()) which “Compute suitable scale and offset based on scale, offset and bounding box of all input files” as #426 suggested.Why also these forward-and-backward conversions?
I modified the code and is to be found here: https://github.com/ykhedar/PotreeConverter