Stroke AddStroke(Vectors vectors) { var controlpoints = new CoordinateList <double> { new Coordinate <double>(10, 10), new Coordinate <double>(50, 50), new Coordinate <double>(100, 100) }; return(vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, true)); }
public void NewFromPoints() { var vectors = new Vectors(_image, "firstVector"); var controlpoints = new CoordinateList <double>() { new Coordinate <double>(50, 50), new Coordinate <double>(100, 100), new Coordinate <double>(150, 150) }; vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, false); Assert.AreEqual(1, vectors.Strokes.Count); }
// [Test] public void Close() { var vectors = new Vectors(_image, "firstVector"); var controlpoints = new CoordinateList<double>() { new Coordinate<double>(50, 50), new Coordinate<double>(100, 100), new Coordinate<double>(150, 150) }; var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, false); stroke.Close(); bool closed; stroke.GetPoints(out closed); Assert.IsTrue(closed); }
// [Test] public void Close() { var vectors = new Vectors(_image, "firstVector"); var controlpoints = new CoordinateList <double>() { new Coordinate <double>(50, 50), new Coordinate <double>(100, 100), new Coordinate <double>(150, 150) }; var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, false); stroke.Close(); bool closed; stroke.GetPoints(out closed); Assert.IsTrue(closed); }
public void GetPoints() { var vectors = new Vectors(_image, "firstVector"); var controlpoints = new CoordinateList<double>() { new Coordinate<double>(50, 50), new Coordinate<double>(100, 100), new Coordinate<double>(150, 150) }; var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, false); bool closed; // Fix me: this one segfaults // var points = stroke.GetPoints(out closed); // Assert.AreEqual(controlpoints.Count, points.Count); // Assert.AreEqual(controlpoints, points); // Assert.IsFalse(closed); }
public void GetPoints() { var vectors = new Vectors(_image, "firstVector"); var controlpoints = new CoordinateList <double>() { new Coordinate <double>(50, 50), new Coordinate <double>(100, 100), new Coordinate <double>(150, 150) }; var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, false); bool closed; // Fix me: this one segfaults // var points = stroke.GetPoints(out closed); // Assert.AreEqual(controlpoints.Count, points.Count); // Assert.AreEqual(controlpoints, points); // Assert.IsFalse(closed); }
public void Scale() { var vectors = new Vectors(_image, "firstVector"); var controlpoints = new CoordinateList <double>() { new Coordinate <double>(50, 50), new Coordinate <double>(100, 100), new Coordinate <double>(150, 150) }; var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, false); double precision = 0.001; stroke.Close(); double oldLength = stroke.GetLength(precision); stroke.Scale(2, 2); double newLength = stroke.GetLength(precision); Assert.IsTrue(Math.Abs(2 * oldLength - newLength) < precision); }
Stroke AddStroke(Vectors vectors) { var controlpoints = new CoordinateList<double> { new Coordinate<double>(10, 10), new Coordinate<double>(50, 50), new Coordinate<double>(100, 100) }; return vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, true); }
public void NewFromPoints() { var vectors = new Vectors(_image, "firstVector"); var controlpoints = new CoordinateList<double>() { new Coordinate<double>(50, 50), new Coordinate<double>(100, 100), new Coordinate<double>(150, 150) }; vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, false); Assert.AreEqual(1, vectors.Strokes.Count); }
public void Scale() { var vectors = new Vectors(_image, "firstVector"); var controlpoints = new CoordinateList<double>() { new Coordinate<double>(50, 50), new Coordinate<double>(100, 100), new Coordinate<double>(150, 150) }; var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, false); double precision = 0.001; stroke.Close(); double oldLength = stroke.GetLength(precision); stroke.Scale(2, 2); double newLength = stroke.GetLength(precision); Assert.IsTrue(Math.Abs(2 * oldLength - newLength) < precision); }