Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Impl
ParamCurve
,ParamCurveArclen
forArc
#378base: main
Are you sure you want to change the base?
Impl
ParamCurve
,ParamCurveArclen
forArc
#378Changes from 1 commit
2c82d7f
060d631
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This feels wrong, though I haven't done tests to validate it. My intuition says it should be
self.sweep_angle * (range.end - range.start)
. In any case, the code that's there reduces algebraically toself.sweep_angle * range.end
. It is of course possible I'm missing something.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.
I think what I have is wrong. I'll get back into this and see.
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.
The 0.1 is arbitrary here - I think
accuracy
for both is reasonable, though of course the "right" way to do this is careful numeric analysis.It is true that arc length of an ellipse is tricky, I believe it involves the incomplete elliptic integral of the second kind. It might also make sense to do Gauss-Legendre integration of the norm of first derivative, which is pretty simple and is likely more "bang for the buck" than going to Bézier.
I'm also wondering whether it might make sense to special case the circular case, as I think it's pretty common and also the math is much easier (especially for inverse arc length). But I'm not going to insist on that, as prefer prioritizing making the general case good rather than having a bunch of special cases.
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.
I was using the same math being used for the
perimeter
function ... I do think we should improve upon this and also either have this call theperimeter
function or have that one call this one.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.
I'm proposing a numerical approximation in #381 (on top of @waywardmonkeys's PR). It needs some more work as the error bounds are not yet as I would've expected, but you can take a look already.