-
Notifications
You must be signed in to change notification settings - Fork 15
Create Polygon class with a few functions and tests #99
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #99 +/- ##
==========================================
+ Coverage 42.89% 44.53% +1.64%
==========================================
Files 15 15
Lines 2625 2746 +121
Branches 324 348 +24
==========================================
+ Hits 1126 1223 +97
- Misses 1387 1401 +14
- Partials 112 122 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new Polygon class to replace the previous functional polygon.resample API, providing a more comprehensive object-oriented interface for working with 2D and 3D polygon paths. The class encapsulates polygon data and offers methods for geometric computations, resampling, and smoothing operations.
Key changes:
- Refactored polygon module from functional to object-oriented design with a
Polygonclass - Added geometric computation methods (length, centroid, area) beyond just resampling
- Introduced Laplace and Taubin smoothing methods for polygon paths
- Updated integration point in
tria_mesh.pyto use the new Polygon API - Comprehensive test suite covering initialization, geometric operations, resampling, and smoothing
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
| lapy/polygon.py | Complete refactor introducing the Polygon class with methods for geometric computations, resampling, and smoothing operations |
| lapy/utils/tests/test_polygon.py | Extensive test suite rewritten to test the new Polygon class covering all major methods and edge cases |
| lapy/tria_mesh.py | Updated to use new Polygon class API for path resampling in level_path method |
| lapy/init.py | Added Polygon to package-level exports for public API access |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: m-reuter <8526484+m-reuter@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: m-reuter <8526484+m-reuter@users.noreply.github.com>
Document edge case behavior and add tests for smoothing small polygons
No description provided.