# Leaf Pile 3D

Sean's pick this week is leafpile3d by Nathaniel Barlow and the extended version with drag by Chris Verhoek.

Last year I picked leaf pile which generated pretty leaves in 2d. Well now there are 3d options! Nathaniel has extended the 2d version to show the leaves falling with gravity.

leafpile3D(60)

However, it appears he wrote this so that his students could extend it and add physics to it. I don't know of Chris is one of his students or not, but he extended it and added variable drag based on leaf type, and rotation. I find I'm just sitting here waiting for that last leaf to hit the ground.

leafpile3Dd(30) % added d at end to disambiguate

I also like some of the code changes that Chris made. Specifically, keeping one command per line and splitting some of the longer lines into multiple for readability or better interpretability with source control.

You can see a comparison of the two files in MATLAB by selecting them and comparing to each other or by calling visdiff.

visdiff("leafpile3D.m", "leafpile3Dd.m")