paperjs with webworkers

264 views
Skip to first unread message

systemlord001

unread,
Feb 9, 2017, 12:03:16 PM2/9/17
to Paper.js
Hey,

I am working on a large project. We need to do collision detection in various scenarios. Basicly i am using the Path.intersects(..) and the .contains(...) method to do this. And it works realy well.

But as the project progresses we are noticing some perfomance issues with this. I want to do the collision detection inside of a webworker. I found this demo:

But i am wondering if this works in Chrome since the offsceen canvas is not supported 

Does anyone know if this is it works? 




systemlord001

unread,
Feb 9, 2017, 12:06:39 PM2/9/17
to Paper.js
Also we use this with TypeScript, i have been addapting the typings for paperjs so it is more in sync with the latest version of typescript.
Lehni if you read this are you interested in getting these? I can set up something on github if you like.

Jürg Lehni

unread,
Feb 10, 2017, 5:11:46 AM2/10/17
to pap...@googlegroups.com
The web worker support does not rely on OffscreenCanvas, it does not need a canvas for all the bézier math stuff to work. So you should be fine using it in this way.

Once OffscreenCanvas is mature enough, we should somehow optionally support it for rasterizing in web workers.

As for the TypeScript bindings, I would be interested in the files indeed. I am not intending to manually maintain them in the future, but for a while now I have this plan to make it part of the JSDoc output, since we already have most of the needed information around in the docs.

Cheers,

J

--
You received this message because you are subscribed to the Google Groups "Paper.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to paperjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Hanechak

unread,
Feb 13, 2017, 10:50:42 AM2/13/17
to Paper.js
I'm also very interested in updated typings... I'm using TypeScript. Here's a few places I've seen that aren't up-to-date:

* Passing a size to the setup function... the JSDoc comments don't mention this possibility, and so the TypeScript typings also don't include it.
* Missing functions: Shape.toPath(), Curve.isStraight()
* Functions with complicated return types: exportSVG is set to return SVGElement... but if you pass it an option, it can return string instead. I'm not sure if the mechanism used could map nicely to TypeScript overloads, though.

I'd be happy to help contribute as well, but if you already have something in progress it probably makes sense to join efforts.

 - Brian

systemlord001

unread,
Apr 12, 2017, 11:46:09 AM4/12/17
to Paper.js
Hey,

I haved asked the company that i am consulting for, for permission to release the files. So if i know more i will keep you up to date.
Reply all
Reply to author
Forward
0 new messages