The .NET C# port of libspiro - conversion between spiro control points and bezier's.
Перейти к файлу
Wiesław Šoltés c1fc8bd448 Updated nuget tags 2016-09-04 16:02:51 +02:00
docs Added cake build script 2016-09-04 15:17:37 +02:00
examples Added examples 2016-04-30 19:06:21 +02:00
samples Refactored editor controls 2016-08-07 13:06:07 +02:00
src Added cake build script 2016-09-04 15:17:37 +02:00
.gitattributes Added cake build script 2016-09-04 15:17:37 +02:00
.gitignore Added cake build script 2016-09-04 15:17:37 +02:00
.travis.yml Added cake build script 2016-09-04 15:17:37 +02:00
COPYING Create COPYING 2015-07-31 19:19:06 +02:00
NuGet.Config Added cake build script 2016-09-04 15:17:37 +02:00
README.md Update README.md 2016-08-13 16:10:50 +02:00
SpiroNet.sln Added cake build script 2016-09-04 15:17:37 +02:00
appveyor.yml Added cake build script 2016-09-04 15:17:37 +02:00
build.cake Updated nuget tags 2016-09-04 16:02:51 +02:00
build.ps1 Added cake build script 2016-09-04 15:17:37 +02:00
build.sh Make build script executable 2016-09-04 15:18:18 +02:00

README.md

SpiroNet

Gitter

Build status 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. 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
  • Update your package using SpiroNet feed

You can install the package like this:

Install-Package SpiroNet -Pre

Available Packages

  • SpiroNet - Core libspiro library.
  • SpiroNet.Editor - Core spiro shape editor.
  • SpiroNet.Json - Json support for spiro shape editor.
  • SpiroNet.ViewModels - View models for spiro shape editor controls.
  • SpiroNet.Editor.Avalonia - Avalonia editor view for spiro shape editor.
  • SpiroNet.Editor.Wpf - WPF editor view for spiro shape editor.

Package Dependencies

  • Newtonsoft.Json
  • Avalonia

Dependencies are required only for specifuc 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.