amandaghassaei / OrigamiSimulator

Realtime WebGL origami simulator
http://origamisimulator.org/
MIT License
1.11k stars 140 forks source link

Support for embedding in iframe or window.open #22

Closed edemaine closed 4 years ago

edemaine commented 4 years ago

This small tweak enables another app to embed Origami Simulator in an <iframe> or in a popup window via window.open, while letting the parent app control Origami Simulator by dynamically opening specified .fold data.

Here's an example of it in action: http://erikdemaine.org/cp-editor/ Draw a simple crease pattern like a square of boundary edges and interior mountain/valley creases, then click Simulate: you get a second tab with Origami Simulator running on that pattern. Then you can change the pattern in the first tab, and click Simulate again to update the model being simulated in the second tab.

@amandaghassaei Let me know if you want to review this before merging.