4

I've taken to creative coding on my iPad and iPhone using Codea, Procoding, and Pythonista. I really love the paper.js Javascript library, and I'm wondering how I might have the functionality that I find in paper.js when writing in Python.

Specifically, I'd love to have the vector math and path manipulation that paper.js affords. Things like finding the intersection of two paths or binding events to paths (on click, mouse move, etc).

There's an ImagePath module provided by Pythonista that does some path stuff but it's not as robust as paper.js (it seems).

Any ideas?

Luke Taylor
  • 8,631
  • 8
  • 54
  • 92
nmelehan
  • 51
  • 4
  • Hey: you can get a lot more help with Pythonista on forum.omz-software.com or in the community Slack team. Just in case you're still searching. – Luke Taylor Jul 18 '16 at 08:10

1 Answers1

1

The ui module actually includes a lot of vector drawing functions, inside a ui.ImageContext. ui.ImageContext is a thin wrapper around part of one of the Objective-C APIs (maybe CALayer?) The drawing methods are designed to operate inside the draw method of a custom view class, but you can present these things in other contexts using a UIImageContext, from which you can get a static image.

Luke Taylor
  • 8,631
  • 8
  • 54
  • 92