How the pencil physics sandbox works
This is a small rigid-body playground. You draw static geometry with your pointer â ramps, walls, platforms â and then drop a ball that obeys gravity, friction, and restitution. Everything runs locally in your browser using a real physics engine, so nothing you draw is uploaded anywhere.
What you can do
- Draw with your pointer to sketch a ramp or wall. Each stroke becomes a solid segment.
- Erase by clicking near a segment to remove it.
- Drop ball to spawn a ball at the top of the canvas. It will fall, roll, and settle.
- Gravity and Bounce sliders change the world in real time.
- Pause freezes the simulation so you can inspect the scene.
- Save snapshot exports the current canvas as a PNG.
What the physics actually does
Each drawn stroke becomes a static line segment with a small thickness. The ball is a circle with mass, velocity, and restitution. The engine resolves collisions against segments and the floor, applies gravity each frame, and damps velocity so the ball eventually comes to rest. Bounce controls restitution â 0% means the ball stops dead on contact, 90% means it retains most of its speed.
Limitations
This is a 2D sandbox, not a full rigid-body simulator. Segments are static (they don't move), balls don't collide with each other, and there's no friction model beyond simple velocity damping. It's designed for quick experiments, not engineering analysis.
Does this work on mobile?
Yes. Draw with your finger, and use the toolbar above the canvas to change gravity, bounce, and drop a ball. The canvas scales to fit your screen.
Is anything uploaded?
No. All drawing, physics, and export happen in your browser. There is no server call for the simulation.
Can I save my scene?
You can save a PNG snapshot of the current canvas. The scene itself is not persisted between page loads.