The .NET C# port of libspiro - conversion between spiro control points and bezier's.
Перейти к файлу
Wiesław Šoltés 83f7ef1806 Added missing n increment expression 2015-08-06 21:33:19 +02:00
Editor Added spiro control point knot support 2015-08-06 21:18:55 +02:00
Spiro Added missing n increment expression 2015-08-06 21:33:19 +02:00
Wpf Added spiro control point knot support 2015-08-06 21:18:55 +02:00
.gitattributes Updated gitattributes 2015-07-31 19:17:19 +02:00
.gitignore Added .gitignore 2015-07-31 19:17:20 +02:00
COPYING Create COPYING 2015-07-31 19:19:06 +02:00
README.md Updated README.md 2015-08-02 18:50:17 +02:00
SpiroNet.sln Added empty Editor project 2015-08-05 18:30:18 +02:00

README.md

SpiroNet

The .NET C# port of libspiro - conversion between spiro control points and bezier's

Introduction

For libspiro introduction please see libspiro project page.

Usage

Provided examples create geometric paths as output using Path Markup Syntax for WPF/Silverlight and Path Data for SVG.

var points = new SpiroControlPoint[4];
points[0].X = -100; points[0].Y = 0; points[0].Type = SpiroPointType.G4;
points[1].X = 0; points[1].Y = 100; points[1].Type = SpiroPointType.G4;
points[2].X = 100; points[2].Y = 0; points[2].Type = SpiroPointType.G4;
points[3].X = 0; points[3].Y = -100; points[3].Type = SpiroPointType.G4;

var bc = new PathBezierContext();
var success = Spiro.SpiroCPsToBezier0(points, 4, true, bc);

Console.WriteLine(bc);
Console.WriteLine("Success: {0} ", success);
var points = new SpiroControlPoint[5];
points[0].X = -100; points[0].Y = 0; points[0].Type = SpiroPointType.G4;
points[1].X = 0; points[1].Y = 100; points[1].Type = SpiroPointType.G4;
points[2].X = 100; points[2].Y = 0; points[2].Type = SpiroPointType.G4;
points[3].X = 0; points[3].Y = -100; points[3].Type = SpiroPointType.G4;
points[4].X = 0; points[4].Y = 0; points[4].Type = SpiroPointType.End;

var bc = new PathBezierContext();
var success = Spiro.TaggedSpiroCPsToBezier0(points, bc);

Console.WriteLine(bc);
Console.WriteLine("Success: {0} ", success);
var points = new SpiroControlPoint[4];
points[0].X = -100; points[0].Y = 0; points[0].Type = SpiroPointType.OpenContour;
points[1].X = 0; points[1].Y = 100; points[1].Type = SpiroPointType.G4;
points[2].X = 100; points[2].Y = 0; points[2].Type = SpiroPointType.G4;
points[3].X = 0; points[3].Y = -100; points[3].Type = SpiroPointType.EndOpenContour;

var bc = new PathBezierContext();
var success = Spiro.TaggedSpiroCPsToBezier0(points, bc);

Console.WriteLine(bc);
Console.WriteLine("Success: {0} ", success);