Skip to content

🐛 Fix zero-span issue for nearly collinear Voronoi inputs#40

Merged
wwang721 merged 1 commit intomainfrom
fix/span
Apr 5, 2026
Merged

🐛 Fix zero-span issue for nearly collinear Voronoi inputs#40
wwang721 merged 1 commit intomainfrom
fix/span

Conversation

@wwang721
Copy link
Copy Markdown
Owner

@wwang721 wwang721 commented Apr 5, 2026

Summary

  • When input points are nearly collinear, the Voronoi diagram may produce only one vertex, yielding a zero span in x or y
  • The old code computed spans for vertices and points separately, which fails in this edge case
  • Fix: stack vertices and points together by computing a unified bounding box (xmin, xmax, ymin, ymax) before deriving span_x, span_y, and span

Test plan

  • Run existing test suite to confirm no regressions
  • Manually test with three nearly collinear input points to confirm the zero-span case no longer errors or produces degenerate output

When input points are nearly collinear, the Voronoi diagram may produce
only one vertex, resulting in a zero span. Stack vertices and points
together to compute the overall span robustly.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@wwang721 wwang721 self-assigned this Apr 5, 2026
@wwang721 wwang721 added the bug Something isn't working label Apr 5, 2026
@wwang721 wwang721 added this to the Release v0.5 milestone Apr 5, 2026
@wwang721 wwang721 merged commit b6b5a15 into main Apr 5, 2026
4 checks passed
@wwang721 wwang721 deleted the fix/span branch April 5, 2026 23:19
@github-project-automation github-project-automation bot moved this from Todo to Done in PyAFV project Apr 5, 2026
@wwang721 wwang721 linked an issue Apr 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

QhullError when 3+ points are collinear

1 participant