-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Curve3D
bake refactor continue
#69043
Curve3D
bake refactor continue
#69043
Conversation
Curve3D
bake refactor continue
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.
@TokageItLab has combined many bezier curve equations into a central place. Maybe you can combine?
@fire Is it a derivative? Perhaps it would make sense to make it a separate function. Not sure whether it is better named |
Sure. Where is this "central place" refers to?
Done. |
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.
@TokageItLab Can you look and review for approval? I'm not able to check the math. The structure is good.
Please don't forget to squash your commits and give it a short but clear message. |
01e154f
to
10c4516
Compare
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 behavior seems to be better than before.
@xiongyaohua Please squash again. |
The main change is to caculate tangent directly from bezier curve, without going through discretized polyline, avoiding pitfalls of discretization. Other changes are: 1. Add an bezier_derivative() method for Vector3, Vector2, and Math; 2. Add an tesselate_even_length() method to Curve3D, which tesselate bezier curve to even length segments adaptively; 3. Cache the tangent vectors in baked_tangent_vector_cache;
02158f1
to
f9fa182
Compare
squashed |
Thanks! |
This PR follows #64212, further refactoring the bake code of
Curve3D
.The main change is to calculate tangent directly from bezier curve, without going
through discretized polyline.
This is mathematically correct method has the following benefits:
The same refactor can be applied to
Curve2D
in a seperate PR.Production edit: Fixes #68893