> For the complete documentation index, see [llms.txt](https://gitbook.testingwaters.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.testingwaters.in/patterns/phyllotaxis.md).

# Phyllotaxis

![](/files/-Lh8nq_8hDB2zIA2fd0e)

<http://algorithmicbotany.org/papers/abop/abop-ch4.pdf>

```d
//Gherkin Surface
sr01 = Surface.ByLoft(Circle.ByCenterPointRadius
(Point.ByCoordinates(0,0,[0,85,168,173,175]),[25,28,11,7,3]));

//Density
n = 1000;

//Alpha
a = 137.5;

//Phyllotactic Points
pt01 = Point.ByCylindricalCoordinates(CoordinateSystem.Identity(),
(0..n)*a,0, Math.Sqrt(0..n));

//Determining Point Parameters to map to surface
pg01 = Polygon.RegularPolygon(Circle.ByCenterPointRadius(Point.Origin(),
Math.Sqrt(n)),4).Rotate(Point.Origin(),Vector.ZAxis(),45);

pr01 = pg01.Patch().UVParameterAtPoint(List.FilterByBoolMask
(pt01,pg01.ContainmentTest(pt01))["in"]);

pt02 = sr01.PointAtParameter(pr01.U,pr01.V);

sp01 = [sr01,Sphere.ByCenterPointRadius(pt02,5)];
```
