/// <summary> /// Adds a control point to the end of the spline. /// </summary> /// <param name="point"></param> internal void AddControlPoint(Vector3 point) { //Transform the new control point from world to local space of sketch object Vector3 transformedPoint = transform.InverseTransformPoint(point); Mesh newMesh = SplineMesh.AddControlPoint(transformedPoint); ChooseDisplayMethod(newMesh); }
public void SplineMesh_AddControlPoint_Performance([NUnit.Framework.Range(9, 99, 10)] int length) { SplineMesh splineMesh = null; Measure.Method(() => { splineMesh.AddControlPoint(new Vector3(length + 1, 0, 0)); }) .SetUp(() => { splineMesh = new SplineMesh(new KochanekBartelsSpline()); splineMesh.SetControlPoints(GenerateControlPoints(length).ToArray()); }) .Run(); }