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

Handle degenerate cases in circumcircle-raw, triangle-spec #90

Open
Hendekagon opened this issue Jan 12, 2022 · 0 comments
Open

Handle degenerate cases in circumcircle-raw, triangle-spec #90

Hendekagon opened this issue Jan 12, 2022 · 0 comments

Comments

@Hendekagon
Copy link

Hendekagon commented Jan 12, 2022

thi.ng.geom.triangle/circumcircle-raw returns nil for points that are the same:

(circumcircle-raw [0.5 0.5] [0.5 0.5] [0.5 0.5])
=> nil

causing a NPE in thi.ng.geom.utils.delaunay/triangle-spec :

(alter-meta! #'td/triangle-spec update :private not)

(td/triangle-spec [0.5 0.5] [0.5 0.5] [0.5 0.5])
Execution error (NullPointerException) at thi.ng.geom.utils.delaunay/triangle-spec (delaunay.cljc:40).
null

I can think of these options:

  • circumcircle-raw could return a zero-radius circle in this case - no errors but maybe undesirable
  • check for zero radius in triangle-spec and warn - slower but more friendly
  • add docstring warning in triangulate - at least users would be able to find out why
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