# One-Shot Prompt

**Simulation**: Receipt
**Theme**: Minimal (Tender)
**Generated**: 2026-04-14

## Prompt

Create a complete, single-file interactive 3D physics simulation of a paper receipt that you can grab, crumple, and toss, using Three.js.

Technical Requirements:
1. **Physics Engine**: Custom Verlet integration with position-based dynamics.
   - Grid resolution: around 30x60 particles to match a receipt's aspect ratio.
   - Constraints: Structural (adjacent), shear (diagonal), and crucially, bending constraints (distance between particles 2 steps away) to give the paper its stiffness and resistance to folding.
   - Integration: Fixed timestep with an accumulator and at least 8-16 substeps per frame for stable constraint solving.
   - Gravity and a slight ambient wind.
   - Self-collision: A basic spatial hashing or distance-based repulsion to prevent the paper from completely intersecting itself.
2. **Interaction**: 
   - Mouse and touch support.
   - Raycasting to find the exact point on the mesh the user clicks/taps.
   - Grab the nearest particle, move it in 3D space according to the cursor, and release it with residual momentum.
3. **Visuals**:
   - `THREE.MeshStandardMaterial` with `THREE.DoubleSide`.
   - Dynamic canvas texture: Programmatically draw a realistic store receipt (store logo/name, list of items, totals, and a barcode at the bottom) onto a 2D canvas and use it as a `CanvasTexture`. Update the UVs or just map it cleanly so the text deforms naturally with the paper mesh.
   - Lighting: Ambient light plus a directional light casting soft shadows.
   - Environment: Minimalist, clean gray studio background with a ground plane receiving shadows.
4. **Implementation**:
   - Everything must be in a single `index.html` file.
   - Only dependency allowed is Three.js from a CDN (e.g., `https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js`).
   - Use `BufferGeometry` and update the `position` attribute and compute vertex normals on every frame.
   - Target 60fps.

Make the receipt feel tangible, like real thermal paper—stiffer than cloth, prone to creasing, but satisfying to pull and drop.

## Notes

- Verlet integration is preferred as it handles distance constraints elegantly.
- The CanvasTexture technique allows high-resolution text without loading external images.
- Bending constraints are what transforms the typical "cloth" simulation into a "paper" simulation.
- Hosting: Drop into Vercel, Cloudflare Pages, or run locally.