public void Init(Curve4Points cp) { Init(cp.c0, cp.c1, cp.c2, cp.c3, cp.c4, cp.c5, cp.c6, cp.c7); }
//----------------------------------------------------------------------- public static Curve4Points UbSplineToBezier(Curve4Points cp) { return(UbSplineToBezier( cp.c0, cp.c1, cp.c2, cp.c3, cp.c4, cp.c5, cp.c6, cp.c7)); }
//----------------------------------------------------------------------- public static Curve4Points CatromToBezier(Curve4Points cp) { return(CatromToBezier( cp.c0, cp.c1, cp.c2, cp.c3, cp.c4, cp.c5, cp.c6, cp.c7)); }
//----------------------------------------------------------------------- public static Curve4Points HermiteToBezier(Curve4Points cp) { return(HermiteToBezier( cp.c0, cp.c1, cp.c2, cp.c3, cp.c4, cp.c5, cp.c6, cp.c7)); }
public Curve4(Curve4Points cp) { m_approximation_method = Curves.CurveApproximationMethod.Div; Init( cp.c0, cp.c1, cp.c2, cp.c3, cp.c4, cp.c5, cp.c6, cp.c7); }
public Curve4Div(Curve4Points cp) { m_approximation_scale = (1.0); m_angle_tolerance = (0.0); m_count = (0); Init( cp.c0, cp.c1, cp.c2, cp.c3, cp.c4, cp.c5, cp.c6, cp.c7); }
public Curve4Inc(Curve4Points cp) { m_num_steps = (0); m_step = (0); m_scale = (1.0); Init( cp.c0, cp.c1, cp.c2, cp.c3, cp.c4, cp.c5, cp.c6, cp.c7); }
//------------------------------------------------------hermite_to_bezier public static void HermiteToBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, Curve4Points output) { // Trans. matrix Hermite to Bezier // // 1 0 0 0 // 1 0 1/3 0 // 0 1 0 -1/3 // 0 1 0 0 // output.Set( x1, y1, (3 * x1 + x3) / 3, (3 * y1 + y3) / 3, (3 * x2 - x4) / 3, (3 * y2 - y4) / 3, x2, y2); }
//-----------------------------------------------------ubspline_to_bezier public static void UbSplineToBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, Curve4Points output) { // Trans. matrix Uniform BSpline to Bezier // // 1/6 4/6 1/6 0 // 0 4/6 2/6 0 // 0 2/6 4/6 0 // 0 1/6 4/6 1/6 // output.Set( (x1 + 4 * x2 + x3) / 6, (y1 + 4 * y2 + y3) / 6, (4 * x2 + 2 * x3) / 6, (4 * y2 + 2 * y3) / 6, (2 * x2 + 4 * x3) / 6, (2 * y2 + 4 * y3) / 6, (x2 + 4 * x3 + x4) / 6, (y2 + 4 * y3 + y4) / 6); }
//-------------------------------------------------------catrom_to_bezier public static void CatromToBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, Curve4Points output) { // Trans. matrix Catmull-Rom to Bezier // // 0 1 0 0 // -1/6 1 1/6 0 // 0 1/6 1 -1/6 // 0 0 1 0 // output.Set( x2, y2, (-x1 + 6 * x2 + x3) / 6, (-y1 + 6 * y2 + y3) / 6, (x2 + 6 * x3 - x4) / 6, (y2 + 6 * y3 - y4) / 6, x3, y3); }