private void GetDashedCurvePointsNormals(out List <Vector2> points, out List <Vector2> normals) { points = new List <Vector2>(); normals = new List <Vector2>(); float curveLength = 0; float param = 0; float s = 0; if (type == CurveType.Quadratic) { points.Add(start); normals.Add(quadraticBezier.GetQuadraticFirstDerivativeNormal(0)); curveLength = quadraticBezier.GetQuadraticArcLength(0, 1); while (s <= curveLength) { s += stripLenght; if (curveLength <= s) { for (int i = subdivisions; i > 0; i--) { param = quadraticBezier.GetQuadraticArcParameterAtLength(s - i * stripLenght / (subdivisions + 1)); points.Add(quadraticBezier.GetQuadraticPoint(param)); normals.Add(quadraticBezier.GetQuadraticFirstDerivativeNormal(param)); } points.Add(quadraticBezier.GetQuadraticPoint(1)); normals.Add(quadraticBezier.GetQuadraticFirstDerivativeNormal(1)); } else { for (int i = subdivisions; i >= 0; i--) { param = quadraticBezier.GetQuadraticArcParameterAtLength(s - i * stripLenght / (subdivisions + 1)); points.Add(quadraticBezier.GetQuadraticPoint(param)); normals.Add(quadraticBezier.GetQuadraticFirstDerivativeNormal(param)); } s += emptyStripLenght; if (s < curveLength) { param = quadraticBezier.GetQuadraticArcParameterAtLength(s); points.Add(quadraticBezier.GetQuadraticPoint(param)); normals.Add(quadraticBezier.GetQuadraticFirstDerivativeNormal(param)); } } } } else { points.Add(start); normals.Add(cubicBezier.GetCubicFirstDerivativeNormal(0)); curveLength = cubicBezier.GetCubicArcLength(0, 1); while (s <= curveLength) { s += stripLenght; if (curveLength <= s) { for (int i = subdivisions; i > 0; i--) { param = cubicBezier.GetCubicArcParameterAtLength(s - i * stripLenght / (subdivisions + 1)); points.Add(cubicBezier.GetCubicPoint(param)); normals.Add(cubicBezier.GetCubicFirstDerivativeNormal(param)); } points.Add(cubicBezier.GetCubicPoint(1)); normals.Add(cubicBezier.GetCubicFirstDerivativeNormal(1)); } else { for (int i = subdivisions; i >= 0; i--) { param = cubicBezier.GetCubicArcParameterAtLength(s - i * stripLenght / (subdivisions + 1)); points.Add(cubicBezier.GetCubicPoint(param)); normals.Add(cubicBezier.GetCubicFirstDerivativeNormal(param)); } } s += emptyStripLenght; if (s < curveLength) { param = cubicBezier.GetCubicArcParameterAtLength(s); points.Add(cubicBezier.GetCubicPoint(param)); normals.Add(cubicBezier.GetCubicFirstDerivativeNormal(param)); } } } }