-
Notifications
You must be signed in to change notification settings - Fork 185
(feat) Hobby Splines #209
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
base: master
Are you sure you want to change the base?
(feat) Hobby Splines #209
Conversation
(feat) Hobby Splines
|
This looks really sweet, and thank you for adding examples and tests as well! The one thing I want to ask about is SolidPython v2. The author is energetic and invested, and that's where all new SolidPython development is happening these days. I'm happy to merge this once I look around a little bit, but you'll probably find a bigger audience at the v2 repo |
|
Interesting, I'll check out the v2 repo for more contributions! |
Goal
Implement Hobby Splines inspired by Jake Low's post Hobby’s algorithm for aesthetic Bézier splines that "render down" to bezier curves.
Functionality
hobby_pointfunction to create a list in the form of [Knot, Control Control, Knot,... ] representing knots and controls for bezier curves defined using hobby's algorithm.close_loopboolean.The curve from the last knot point to the first is generated regardless of
close_loopso that the tangents at the first and last knot point are those of the closed hobby spline; this helps keep the curves round and aesthetic. To generate the resulting hobby points the final segment of the curve is set to the closed loop curve is appended if the curve is closed, otherwise only the final point is appended.Changes
hobby_pointsfunction to splines in order to generate bezier curves following Hobby's algorithm.hobby_splines_example.pywith open & closed hobby splines & their polygon projectionshobby_pointstotest_splines.pyfor open hobby splines usingbezier_controlsin raw, Point2, and Point3 formsExamples
Create hobby curve examples by running
hobby_splines_example.py.Testing
Test changes using
test_splines.py.