The .NET C# port of libspiro - conversion between spiro control points and bezier's.
Перейти к файлу
Wiesław Šoltés b17de94a20
Merge pull request #13 from terryspitz/master
Add helpers which return raw SpiroSegment arrays
2020-03-29 14:00:43 +02:00
.github Update build.yml 2019-11-05 08:13:11 +01:00
build Updated 2020-03-15 13:37:00 +01:00
examples Added examples 2016-04-30 19:06:21 +02:00
samples/SpiroNet.Avalonia Updated 2019-10-01 09:18:33 +00:00
src Fix remaining XML comment. 2020-03-28 22:41:16 +00:00
tests/SpiroNet.UnitTests Updated Avalonia 2019-09-25 23:06:21 +02:00
.editorconfig Updated editorconfig 2018-07-09 19:48:07 +02:00
.gitattributes Updated gitattributes and gitignore 2017-11-14 18:39:32 +01:00
.gitignore Updated gitattributes and gitignore 2017-11-14 18:39:32 +01:00
.nuke Updated Nuke 2019-03-26 18:20:04 +01:00
COPYING Create COPYING 2015-07-31 19:19:06 +02:00
NuGet.Config Update NuGet.Config 2019-04-23 19:26:05 +02:00
README-RaphLevien Added original README by Raph Levien for ppedit 2016-12-27 08:49:09 +01:00
README.md Update README.md 2019-12-24 19:56:42 +01:00
SpiroNet.sln Updated 2019-10-01 09:18:33 +00:00
_config.yml Set theme jekyll-theme-cayman 2017-05-16 15:02:11 +02:00
build.ps1 Added nuke 2018-12-09 12:18:26 +00:00
build.sh Added nuke 2018-12-09 12:18:26 +00:00
global.json Updated 2019-12-06 07:56:22 +00:00

README.md

SpiroNet

Gitter

Build status

NuGet MyGet

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

Introduction

For libspiro introduction please see libspiro project page and drawing with spiro. There is also GUI version using libspiro written in C#/WPF for Windows.

NuGet

SpiroNet is delivered as a NuGet package.

You can find the packages here NuGet or by using nightly build feed:

  • Add https://www.myget.org/F/spironet-nightly/api/v2 to your package sources
  • Alternative nightly build feed https://pkgs.dev.azure.com/wieslawsoltes/GitHub/_packaging/CI/nuget/v3/index.json
  • Update your package using SpiroNet feed

You can install the package like this:

Install-Package SpiroNet -Pre

Available Packages

Package Dependencies

Dependencies are required only for specific editor packages.

Package Sources

Resources

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);

License

SpiroNet is licensed under the GPL-3.0 license.

Original license and patent grant is included in README by Raph Levien for ppedit.