-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add "PolyCubicSpline2d" #98
Comments
Hey @prange! I've thought for a while it would be good to have a function in CubicSpline2d.centripetalCatmullRom : List Point2d -> List CubicSpline2d although it might have to be a bit more complex to allow for different end conditions (free, clamped, closed etc.) Does that seem close to what you're looking for? |
Or if we want to be a bit more opinionated, something like: CubicSpline2d.interpolate : List Point2d -> List CubicSpline2d
CubicSpline2d.closed : List Point2d -> List CubicSpline2d
CubicSpline2d.interpolateWith :
{ start : BoundaryCondition, end : BoundaryCondition }
-> List Point2d
-> List CubicSpline2d
-- zero curvature at the boundary
free : BoundaryCondition
-- fixed first derivative at the boundary
fixed : Vector2d -> BoundaryCondition which you could use as -- Create a centripetal Catmull-Rom curve through
-- the given points, with free ends
splines1 =
CubicSpline2d.interpolate points
-- Create a closed-loop Catmull-Rom curve
-- through the given points
splines2 =
CubicSpline2d.closed points
splines3 =
CubicSpline2d.interpolateWith
{ start = CubicSpline2d.fixed v1, end = CubicSpline2d.free }
points |
When drawing svg it is often the case that we want to draw smooth lines using Bezier curves. It would really be handy with a function to convert a polyline to a list of Bezier curves that are connected and where the control points make sense (based on some smoothing parameter perhaps)
and of course it would be really cool to have a corresponding function to render such a datatructure to svg.
What do you think?
The text was updated successfully, but these errors were encountered: