public PartEntityBezier AddBezierEntity(Vector2 end, Vector2 adjustStart, Vector2 adjustEnd, EntityType type = EntityType.Normal) { PartEntityBezier entity = new PartEntityBezier( Entities.Last().End, end, Entities.Last().End + adjustStart, end + adjustEnd, type ); Entities.Add(entity); return(entity); }
public static CalcResult CalcLength( Vector2 start, Vector2 end, BezierCalculatorControlPointDirection dir1, BezierCalculatorControlPointDirection dir2, float p1Adj, float p2Adj) { Vector2 firstpoint = BezierCalculatorAdjustVector(p1Adj, dir1); Vector2 secondPoint = BezierCalculatorAdjustVector(p2Adj, dir2); float foundLength = new PartEntityBezier(start, end, start + firstpoint, end + secondPoint).Length; return(new CalcResult(firstpoint, secondPoint, foundLength)); }
private static CalcResult CalcLength( Vector2 start, Vector2 end, BezierCalculatorControlPointDirection dir1, BezierCalculatorControlPointDirection dir2, Vector2 p1Adj, Vector2 p2Adj, int i) { Vector2 firstpoint = BezierCalculatorAdjustVector(i, dir1) + p1Adj; Vector2 secondPoint = BezierCalculatorAdjustVector(i, dir2) + p2Adj; float foundLength = new PartEntityBezier(start, end, start + firstpoint, end + secondPoint).Length; return(new CalcResult(firstpoint, secondPoint, foundLength)); }