chen0040 / cpp-spline

Package provides C++ implementation of spline interpolation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Splines with less than 4 control points

CosminPerRam opened this issue · comments

Hello, thanks for the effort put into this library, I want to use it for a project of mine but I need to be able to create splines (Bezier and Catmull) using 3 control points (and 2, but that's just a straight line), not the coded minimum of 4.

I have been looking into on how to do it but I can't really wrap my head around the math for it and also to create an implementation, any help regarding this? Thanks.

what do you mean less than 4 points
point 1 : start point
point 2 : bezier point 1
point 3 : bezier point 2
point 4 : end point

if you want to make straight line just place point 2 and 3 to center of point 1 and 2 using average coord in distance.