Skip to content

Replace hardcoded 0 with CurveOffsetCornerStyle.NONE enum in curve offset method#1495

Closed
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-offset-corner-style
Closed

Replace hardcoded 0 with CurveOffsetCornerStyle.NONE enum in curve offset method#1495
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-offset-corner-style

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 21, 2025

  • Import Rhino.Geometry module at the top of the file
  • Replace the last zero parameter in Offset call with proper enum Rhino.Geometry.CurveOffsetCornerStyle.NONE
  • Apply review feedback to use NONE constant directly
  • Add changelog entry
  • Verify the change with linting (ruff and black)
  • Run security check with CodeQL (no alerts found)

Summary

Successfully replaced the hardcoded 0 parameter in the Offset method call with the proper enum Rhino.Geometry.CurveOffsetCornerStyle.NONE.

Changes Made

  • Added import Rhino # type: ignore at the top of the file
  • Created a corner_style variable using Rhino.Geometry.CurveOffsetCornerStyle.NONE
  • Replaced the hardcoded 0 with the corner_style variable in the Offset call
  • Added entry to CHANGELOG.md under "Unreleased > Changed" section

Implementation Note

The enum member is accessed as NONE (uppercase) rather than None to avoid Python keyword conflicts. This pattern is consistent with other Rhino enum usage in the codebase (e.g., PipeCapMode.NONE, IsoStatus.NONE).

Security Summary

No security vulnerabilities were found in the changes.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix enum for Offset arguments in curve.py Replace hardcoded 0 with CurveOffsetCornerStyle.None enum in curve offset method Oct 21, 2025
Copilot AI requested a review from gonzalocasas October 21, 2025 06:37
Copy link
Copy Markdown
Member

@gonzalocasas gonzalocasas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply review feedback

Comment thread src/compas_rhino/geometry/curves/curve.py Outdated
Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com>
Copilot AI changed the title Replace hardcoded 0 with CurveOffsetCornerStyle.None enum in curve offset method Replace hardcoded 0 with CurveOffsetCornerStyle.NONE enum in curve offset method Oct 21, 2025
Copilot AI requested a review from gonzalocasas October 21, 2025 06:42
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.19%. Comparing base (587ff27) to head (46ad041).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1495      +/-   ##
==========================================
- Coverage   62.21%   62.19%   -0.03%     
==========================================
  Files         208      208              
  Lines       22437    22437              
==========================================
- Hits        13960    13955       -5     
- Misses       8477     8482       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gonzalocasas
Copy link
Copy Markdown
Member

@copilot add an entry to the changelog

Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot add an entry to the changelog

Added changelog entry under "Unreleased > Changed" section (commit: 46ad041 and following)

@gonzalocasas gonzalocasas deleted the copilot/fix-offset-corner-style branch March 6, 2026 19:48
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

Successfully merging this pull request may close these issues.

2 participants