# 2D Mechanisms examples?

**URL:** <https://discourse.processing.org/t/2d-mechanisms-examples/12752>\
**Category:** p5.js\
**Created:** [July 16, 2019, 6:15pm UTC](https://discourse.processing.org/t/2d-mechanisms-examples/12752 "2019-07-16T18:15:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bird](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bird/32/118_2.png) [@Bird](https://discourse.processing.org/u/Bird)\
**Post date:** [July 16, 2019, 6:15pm UTC](https://discourse.processing.org/t/2d-mechanisms-examples/12752/1 "2019-07-16T18:15:51Z")

</div>

I’m looking for some examples of basic 2D mechanisms in JS. Simple animations showing rotary and linear motors, linkages, pistons, etc. I would love to find some kind of sandbox that allows simple experiments, but just some JS examples would be good. Yes, I’ve done a fair amount of web searches, but I haven’t found anything I’m looking for. The Arm example in the p5.js web editor is kind of what I’m looking for in simplicity and I know I could just start hacking at it, but I’d prefer to find more examples.  
I want to do some simple mockups for automata toys, so that is where I am headed with this.  
Thank you.

---

<div class="post-metadata">

**Author:** ![tony](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tony/32/949_2.png) [@tony](https://discourse.processing.org/u/tony)\
**Post date:** [July 16, 2019, 10:30pm UTC](https://discourse.processing.org/t/2d-mechanisms-examples/12752/2 "2019-07-16T22:30:01Z")

</div>

I personally haven’t tried it out, but it has a great examples page. Take a look:

> **[schteppe/p2.js](https://github.com/schteppe/p2.js)**
>
> JavaScript 2D physics library. Contribute to schteppe/p2.js development by creating an account on GitHub.

A Spring demo:

[http://schteppe.github.io/p2.js/demos/springs.html](http://schteppe.github.io/p2.js/demos/springs.html)

---

<div class="post-metadata">

**Author:** ![Bird](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bird/32/118_2.png) [@Bird](https://discourse.processing.org/u/Bird)\
**Post date:** [July 16, 2019, 10:53pm UTC](https://discourse.processing.org/t/2d-mechanisms-examples/12752/3 "2019-07-16T22:53:52Z")

</div>

Very much what I was looking for! Thank you.
