Skip to content
The .NET C# port of libspiro - conversion between spiro control points and bezier's.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build Updated Avalonia May 18, 2019
examples Added examples Apr 30, 2016
samples/SpiroNet.Avalonia
src Added PackageId to csproj May 25, 2019
tests/SpiroNet.UnitTests Updated Avalonia Feb 1, 2019
.editorconfig Updated editorconfig Jul 9, 2018
.gitattributes Updated gitattributes and gitignore Nov 14, 2017
.gitignore Updated gitattributes and gitignore Nov 14, 2017
.nuke Updated Nuke Mar 26, 2019
COPYING Create COPYING Jul 31, 2015
NuGet.Config Update NuGet.Config Apr 23, 2019
README-RaphLevien Added original README by Raph Levien for ppedit Dec 27, 2016
README.md
SpiroNet.sln Use Microsoft.NETFramework.ReferenceAssemblies May 4, 2019
_config.yml Set theme jekyll-theme-cayman May 16, 2017
build.ps1 Added nuke Dec 9, 2018
build.sh Added nuke Dec 9, 2018
global.json Update global.json May 7, 2019

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
  • 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.

You can’t perform that action at this time.