Conversation
Since both radiusArc and sagittaArc boils down to a threePointArc in the end I want to be able to just return a threePointArc. This increases code reuse. However, the function toWorldCoords seems to do something strange to a vector that already is in World coordinates. This commit checks if the point already is an Vector before trying to make it an vector. I also refined the testcases by checking edge length and edge type.
…sion to global coords only in threePointArc
If start and end point of a set of 2d edges coincide; create a wire directly. If there is a distance between start and end point; add a line segment before creating the wire.
✅ Build cadquery 1.0.24 completed (commit 06a7a7d32f by @gntech) |
Codecov Report
@@ Coverage Diff @@
## master #255 +/- ##
==========================================
+ Coverage 92.85% 92.86% +<.01%
==========================================
Files 10 10
Lines 2196 2199 +3
==========================================
+ Hits 2039 2042 +3
Misses 157 157
Continue to review full report at Codecov.
|
@gntech thanks for this contribution! You rock!
The testcase I added is creating the previously impossible geometry mentioned in #238 |
@gntech you are on 🔥! @fragmuffin does this satisfy you as far as #238 goes? If so I'll merge |
@fragmuffin Nice catch! After some investigation I found that the problem was triggered by that the origin for workplane was moved. If I set The solution was that when getting endPoint in I have also added testcase 3 to test suite |
When getting the endPoint in close() ; use local coordinates and not global coordinates. It does matter when the origin of the workplane is moved.
@gntech Nice fix! I can confirm, that's working beautifully |
If start and end point of a set of 2d edges coincide; create a wire directly. If there is a distance between start and end point; add a line segment before creating the wire.
When getting the endPoint in close() ; use local coordinates and not global coordinates. It does matter when the origin of the workplane is moved.
Add more elaborate testcases with workplane origin moved and comparing the result of volumes created by threePointArc and sagittaArc.
❌ Build cadquery 1.0.29 failed (commit ba9ad634ff by @gntech) |
When rebasing on master I discovered a problem with global coordinates that introduced in radiusArc that is fixed now as well as adding more elaborate test cases for the close() I however managed to create redundant commits when rebasing on master and pushing. Is that okay or should I squash all commits in the pull request? |
I will clean up the commit history for this pull request later today. |
I will open a new pull request with cleaner history |
If start and end point of a set of 2d edges coincide; create a wire directly.
If there is a distance between start and end point; add a line segment before creating the wire.
I propose this should close #238