-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Region class method for Corner Rounding #335
base: main
Are you sure you want to change the base?
Conversation
…rrect point on the arc is always returned.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #335 +/- ##
==========================================
- Coverage 87.00% 85.57% -1.44%
==========================================
Files 20 21 +1
Lines 2039 2183 +144
==========================================
+ Hits 1774 1868 +94
- Misses 265 315 +50 |
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.
Spotted some cases that need handling:
This is a slightly more complicated case. Happy to also just throw an exception for now if you don't want to implement this. Also need to consider arc/arc intersection.
Added round_corners() for rounding of multiple corners in a region
I think we can avoid these issues with the new commits. Now an exception is thrown if a corner radius is given that would shorten an entity by more than its length |
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Added tests for more scenarios
I think all the necessary tests should now be there. |
… start points (previously only checked end point case)
… a corner coordinate (arc angle will be zero). In this case round_corner does nothing. Test added as well
corner_coordinate : ansys.motorcad.core.geometry.Coordinate | ||
Coordinate of the corner to be rounded. | ||
radius : float | ||
Radius by which the corner will be rounded. |
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.
corner_coordinate : ansys.motorcad.core.geometry.Coordinate | |
Coordinate of the corner to be rounded. | |
radius : float | |
Radius by which the corner will be rounded. | |
corner_coordinate : ansys.motorcad.core.geometry.Coordinate | |
Coordinate of the corner to round. | |
radius : float | |
Radius to round the corner by. |
Use present tense rather than future tense verbs.
if radius == 0: | ||
return | ||
|
||
# find adjacent entities. There should be 2 entities adjacent to the corner. Going |
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.
When a comment consists of multiple sentences, it is preferable, but not mandatory, to start them all with a capital letter. The same is true if you are using a concluding punctuation mark at the end of a comment that is only a single sentence.
Parameters | ||
---------- | ||
corner_coordinates : list of ansys.motorcad.core.geometry.Coordinate | ||
List of coordinates of the corners to be rounded. |
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.
List of coordinates of the corners to be rounded. | |
List of coordinates of the corners to round. |
A method for defining automatic corner rounding for regions.
The method finds entities that contain the specified corner coordinate, cuts the entities by a certain distance and draws an arc between the new start/end coordinates.
Example shown for triangular rotor notch example, .mot file for this example attached (in zip):
e9_Tri_Rotor_Notch_Rounded.zip
Trapezoidal Duct example with corner rounding also attached (in zip):
Trapezoidal_duct_rounded.zip