# l-system question

## Recommended Posts

From "Geometry.pdf"

Override parameters for F, f, G, h, H take the form of:

F(i,j,k,l,m)

i Override Length.

j Override Thickness.

k Override # Tube Segments.

l Override # Tube Rows.

m User parameter.

The k and l override parameters allow dynamic resolution of tube segments.

L-system OP

##### Share on other sites

Well, it's cool that you can overide.. but what is the syntax? I mean, "F(i=0.1)" or something like that....

ie, "F" is full length forward, "H" is half the length forward... what if I want 1/3 of th length forward? ... or maybe even control the precise length with one of the sliders ie "( b )" etc..

##### Share on other sites

again from the geometry pdf:

Parameters assigned to geometric symbols (e.g. F, +, or !) are interpreted geometrically.

For example, the rule:

F(i, j) = F(0.5*i, 2*j)

will again replace each F with a new F containing modified parameters. In addition

to this, the new F will now be drawn at half the length and twice the width.

so to go 1/3 the length forward use F(.33*i) and to control it with 'b': F(b*i)

##### Share on other sites

The most straightforward way of doing it is like this

`F(0.3)`

If you want to override the width than you put it like this

`F(0.3,0.2)`

And so on with the rest of the overrides.But this method isn't very,whatchacallit, procedural.

These overrides can be used in form of

`F(i,j,..and so on)`

You can find an example here.

I still am not shure how it all works so I guess will have to wait till someone will explain it in more popular fashion.

---------------------------------------------------------------------------------------------

Oooops! arctor beat me to it. O well...

La la la la la la la.......

##### Share on other sites
again from the geometry pdf:

It's a monday

Thanks guys ... will work on this

##### Share on other sites

How can I add more variables? I need more than just the default three.

##### Share on other sites

goto Dialogs>Aliases/Variables... or just hit alt+A

add as many as you need.

##### Share on other sites

Here's the deal.

In L-System I created a stem with this rule

`Premise: F(0.018)A`

Rule1:

##### Share on other sites

Another two questons.

Is it possible to define a custom shape for L-System to use for generating branches geometry. For instance,... what if I want a branch to be shaped like a rail?

Another thing that I need is to somehow implement some sort of a "hittest" thingimagiggy that would basically detect when a branch touches an object and would give the command to a branch to make a turn.

("metatest" is not going to work since it is practically impossible to create oddly shaped volumes with metaballs)

Anyway. I don't have a slitest idea how to approach this!

Can anyone help me out with this one?

Thank you!

##### Share on other sites

"...branch to be shaped like a rail?..."

not sure what you mean here...

for the "hittest" thingimagiggy...I don't know - maybe something that determines if the token is within the bounding box of another piece of geometry and then that causes a change in what rules is applied....

##### Share on other sites

Errr... Never mind the rail shape

What about the "Generations" parameter in L-System?

Is it possible to override it with custom parameter?

##### Share on other sites

One more.

Is it possible to save out the resaulting L-System string to a text file?

##### Share on other sites

thanks for double posting ...6 pages !!!

anyway...

you can click on 'Generations' to put it into expression mode and then do what ever you want...

here is a good one to try :

\$F * 50

as for saving out the l-system out as text...I don't know...you can MMB on the tile and see the string there...so I would assume that you can....but as to how...? maybe some kind of opwrite command...not sure...sorry

##### Share on other sites

O my GOD! Expression state. How could've I forgotten?! Dumbass.

Great. Thanks!

##### Share on other sites

np...

what are you up to anyway?

##### Share on other sites

I'm trying to make a "Feather Generator" OTL that would have a 6 feather presets(that would basically mean 6 L-Systems) and each one of them would be adjustable from the custom panel.

nice

##### Share on other sites

Having trouble again!

...here's what I have

```Premise: A
Rule 1:    A(i):i&lt;50=F(0.0005)[+(60)B]A(i+1)
Rule 2:    B(i):i&lt;8=F(0.002)B(i+1)```

I now need to control the thickness of a tube so, that it decreases with every new generation.

Entering it like this

`B(i,j):i&lt;8=F(i,j)B(i+1,j-0.1)`

only screwes up everything.

What would be the right way to do it?

##### Share on other sites

Why don't you just insert a ! before the A(i+1) and B(i+1) such that it looks like:

```Premise: A
Rule 1:    A(i):i&lt;50=F(0.05)[+(60)B]!(0.98)A(i+1)
Rule 2:    B(i):i&lt;8=F(0.2)!(0.8)B(i+1)```

The ! multiplies the current thickness with its value. You could also use the default-value, that can be set in the tube-tab.

I also took out 2 zeros of the F-override-values, because it was too small for me to see (had some clipping-errors). The overall-size of the feather could be adjusted afterwards using a transform-SOP.

By the way, why do you use absolute step-sizes. You could make the feather tapered if you let the rules determine the actual step-size. For example:

```Step-size: 0.05
Premise: A
Rule 1:    A(i):i&lt;50=F[+(60)!(0.5+i/100)"(2-i/30))B]!(0.98)A(i+1)
Rule 2:    B(i):i&lt;8=F!(0.8)B(i+1)```

You could alter the formula 2-i/30 for the step-size-scale to get a nonlinear shape of the feather. Perhaps a sin or cos could help. Or a cubic interpolation of some hard-coded control-points would make the shape more configurable.

##### Share on other sites

I'm working with this code and I cant figure out one thing.

`Premise: A(1,1)`

Rule 1:

## Create an account

Register a new account