Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spiro Examples #4

Open
OSUblake opened this issue Jul 17, 2017 · 3 comments
Open

Spiro Examples #4

OSUblake opened this issue Jul 17, 2017 · 3 comments

Comments

@OSUblake
Copy link

Just wanted to share a couple demos I made with Spiro a couple years ago. It's based on a different code base. Most of it comes from the python version of Spiro found in the Roboto font repo.
https://github.com/google/roboto/tree/master/third_party/spiro/curves

Click to add/move a point. Right-click to remove a point.
https://codepen.io/osublake/pen/wKGvVG

Using Spiro with PixiJS meshes.
https://codepen.io/osublake/pen/vNjjqa

@nanjizal
Copy link
Owner

nanjizal commented Jul 18, 2017

These are wonderful, would be great to add these demos.

My main problem with putting more work into Spiro is that it's not MIT, I contacted Ralph Lieven after I had ported the code, and he was keen to keep Spiro GPL3, despite my arguments.

To some extent a port may not automatically inherit a licence because it's all new code ( ? ), but I respected his wishes, I am more dubious on software patents - that is an Americanism and not something that European developers widely support, but with UK leaving Europe no doubt they will soon end up with them in the UK without the current grey areas :(

I have separated my hxSpiro demo's from the core library so that the demo code is MIT while the library itself is not, and that also makes it cleaner just to put hxSpiro in haxelib the official library system for Haxe.

The Kha demo version hxSpiroKhaG2 can easily be modified to work on mobile and does not require javascript ( it currently just uses js buttons but can be refactored out and I would be happy to do that if you wish to see c++ etc... demos, even python! ).

I would have to think deeply about how to support rope demo, if you look at justLetters it should be feasible to reuse, and really Letters needs to be less specific ( can work with shapes easily ) and allow any font and c++ output, but quite a lot of effort for a GPL project when I prefer code that can be used both commercially as well as educational
easily. Also I want to add some texture support to justTriangles but was thinking of a flat texture rather than a curve following one, so the rope is a very interesting thought mmm... so much to fix and improve in justTriangles.

Can I ask about the curves in your first example, the non Spiro ones would any of these be viable as MIT haxe libraries, do you have maybe some extracts of them to make a port simpler, I don't code javascript so the less I need to look through the better :).

Are you interested in extending hxSpiro, the main advantage of working in Haxe is that it opens more opportunities beyond just javascript, like for instance pre-rendering data in PHP7 and then passing it to Javascript, running in a Java application. Running anywhere c++ runs etc.. Also libraries like Kha, Luxe, NME seem to be suitable future of more flexible gui's rather than many of the heavy graphics solutions of the past.

Looking at one or two of your codepens they are amazing!

How were you thinking about moving hxSpiro forward in terms of your demos, some form of collaboration perhaps, do you have a suitable future pull I should integrate on one of the demos, or an alternate hxSpiro demo I could link to, or we could create some places for other curves for Haxe lang under MIT?

Many thanks for sharing these hopefully they will inspire more exploration of Spiro :)

@OSUblake
Copy link
Author

Thanks!

The license is definitely an issue, and is the reason I never made a repo of the work I was doing on Spiro. Unfortunately, I lost all my work in a hard drive crash, so those 2 demos are all that I have left.

And the curves in my first example are all based on different versions of Spiro I found, so I don't think they could be used as an MIT library.

It's too bad you couldn't convince Raph to change the license. I have no interest in fonts, but Spiro could have so many other applications. I originally started working on it as a way to create roads in a map editor for a game. That's what the rope demo is kind of based on. And then I started using it to create motion paths for animations.

Extending hxSpiro or a curves library would be cool. I'm always looking for tools to easily create curves, and I know I'm not alone. Right now I use Paper.js for that, but sometimes it's more than I need.

I've never used Haxe, but I'd be willing to give a try. What's the best way to get started?

@nanjizal
Copy link
Owner

Well Kha is quite low level but rather nice to use, and with Kode very easy to get started and there are lots of youtube videos. Quick instructions here:

https://github.com/nanjizal/haxeverse/blob/master/md/khaSetup.md

OpenFL or NME are just like using flash very popular and powerful, so very flexible and Luxe toolkit is worth checking out.

For say svg in haxe Javascript without any toolkits you could look at this:

https://github.com/nanjizal/code-cookbook/blob/master/assets/content/cookbook/Graphics/Creating-SVG/01.Drawing-a-Circle.md

There are a lot more resources on haxe website.
http://code.haxe.org/category/beginner/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants