L-system how to make a cube grow

A beginnger at grasshopper. I am trying to apply plant growth behaviour to a cube and essentially trying to grow it organically.

I was following a youtube to create this tree but how do I convert this script so that it works for a cube? Additionally, I want to make this cube grow towards the sunlight and changes growth direction depending on the position of the sunlight. I have also attached a reference picture of the end result I am looking to achieve.

Any suggestion would be lovely! Desperately need help :cry:

. L-SYSTEM.gh (18.1 KB)

Hello
what you want is not clear. Are you sure your last image is based on L-System ?
Searching with your image I found that

You are far from what you describe as L-System.

You better try something like Culebra plugin.

Hi Laurent,

Sorry for the confusion and thanks for your response!

The imaged I provided was just a youtube vid that I came across. I’m not too familiar with L-system either and thought that it would create the similar result. But if I want to stick with L-system, how can I manipulate the cube to grow in response to the direction of the sunlight?

There are many possibilities and you will find many discussions on this forum and on other places.

The main thing is the recursion and the transformation you want.
For a cube, or general case I will say a Brep. Firs part is to choose the face you want to grow.
The face for example could be oriented , scaled and moved toward the sun. The face could also be splitted to have some more branches. You could then loft the faces to make some new brep and apply the recursion on these objects.

But if you want to stay with the cube you’ll have to explain better what you want.

Here an example of a little script I have done to grow circles on a shape.

Here there is bit more constraint as the circles can’t intersect and the attractor is the Z direction.