ansys / pymotorcad

https://motorcad.docs.pyansys.com
MIT License
15 stars 1 forks source link

Rotate translate regions and fixes #261

Closed jgsdavies closed 3 months ago

jgsdavies commented 7 months ago

Arc currently need start,end,centre,radius. On first inspection it seems that only centre or radius is required to fully define the arc however this is not the case:

2 valid solutions for start/end/centre image

These are both valid solutions for arc with start/end/rad image

We have some options:

  1. force user to specify direction of arc
  2. Assume arc smaller than 180 degrees

I've tried to implement idea 2 whilst still allowing user to force arc with greater than 180 deg by using all 4 params.

Nice side effect of these changes is that centre coord can become a property rather than a class object. This means rotation/translation can be handled by parent Entity class in same way for both arc and Line.

Hoping this makes the most sense as rounding corners etc is very simple when you only have to provide start/end/radius

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 96.92308% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.95%. Comparing base (250f266) to head (41baabf).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #261 +/- ## ========================================== + Coverage 83.70% 83.95% +0.25% ========================================== Files 20 20 Lines 1890 1932 +42 ========================================== + Hits 1582 1622 +40 - Misses 308 310 +2 ```