# Generative "leaf" geometry - position meshes along a tube

Hello folks,
I’m trying to make a simple generative “leaf” instead of modeling it in Blender and I’m stuck.

I did the following:

1. generated a curve from points
2. extruded a tube along the curve
3. divided the curve in segments, from each segment point have a “leaf” feathering out (a thin cylinder as a single leaf base geom)

My question is - how to rotate the leaves properly so they “feather” outwards like a leaf might?

I know it has to do with the tangent and normal at every point where the cylinders are placed, but no idea how to move on.

Will be thankful for any tips!

This is where I am so far:
https://jsfiddle.net/vrug72L5/

A rough sketch below of what I have in mind:

I needed corresponding calculations in my addon THREEg. Maybe you can take something from there.

https://github.com/hofk/THREEg.js/blob/c0f2e8063922465a32e2887d3f79a9c24c84d5bf/THREEg.js from line 3776
see code from line 3978 …

1 Like

Also there I have a similar calculation

from line 2135

UPDATE:
This is not a leaf, but the vertex normals show an orthogonal orientation. You can change that. (… sandboxthreef)

1 Like

Thanks, @hofk, after playing with it for a while I can say your addon is very impressive.
I’m tinkering with other tools as well for now, hoping there is still a simpler solution:)

With the Addons you can not solve your problem directly. That’s clear.

But the calculations there with normal, binormal and tangent and the vector equation of the circle in 3D space could be a basis. It is a matter of mathematics. You have to add the desired angle between stem and leaf. Otherwise the vertex normals are only 90° like in the Addon.