Skip to content

Fix Polygon2D convex hull winding direction - #249

Open
JayLeo04 wants to merge 1 commit into
mathnet:masterfrom
JayLeo04:fix/polygon2d-convex-hull-direction
Open

Fix Polygon2D convex hull winding direction#249
JayLeo04 wants to merge 1 commit into
mathnet:masterfrom
JayLeo04:fix/polygon2d-convex-hull-direction

Conversation

@JayLeo04

Copy link
Copy Markdown

Fixes#248.

Summary

  • Correct the convex hull winding selection by passing !clockWise when sorting centroid-to-vertex vectors by their signed angle to the x-axis.
  • Let three-point inputs use the same hull collection and ordering path, so the direction argument is honored for the smallest valid polygon.
  • Correct the existing SciPy-generated test expectations to treat their 2-D order as counter-clockwise.
  • Add regression coverage for clockwise, counter-clockwise, default, and triangle behavior using signed area.

Testing

  • Updated convex hull tests: 7 passed. The same 7 tests fail against the unmodified implementation.
  • Full NUnitLite suite on netcoreapp3.1: 1307 total, 1271 passed, 0 failed, 35 skipped, 1 inconclusive (pre-existing).
  • Release build completed for both netcoreapp3.1 and net461.

@JayLeo04

Copy link
Copy Markdown
Author

CI environment note: AppVeyor build 1.0.553 restored, compiled, and packed the solution successfully, then failed before running any tests because Microsoft.NETCore.App 3.1 is no longer installed on the current Visual Studio 2022 image. The available runtimes begin at 5.0, while Spatial.Tests targets netcoreapp3.1.

The repository's AppVeyor configuration downloads SDK 5.0.200 but relies on the image for the 3.1 runtime. For comparison, the previous build 1.0.552 found image-provided runtime 3.1.32 and completed both test runs successfully.

With runtime 3.1.32 installed locally, this PR's full NUnitLite suite completes with 1307 total, 1271 passed, 0 failed, 35 skipped, and 1 pre-existing inconclusive test. The Release build also succeeds for both netcoreapp3.1 and net461.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Polygon2D convex hull winding direction is reversed and ignored for triangles

1 participant

@JayLeo04