L-System - How to stop iterating some branches?

   1792   1   0
User Avatar
Member
5 posts
Joined: June 2011
Offline
Hi everyone,
First i have to let you guys now that, I am a former Max and Maya user, totally newbie in Houdini, so please treat me like that

I am trying to learn L-Systems, and the best way of learning a software is to use it in production. So I try to make a Grape vine grow. I want the main branch to go as I increase the iterations, but the smallest branches to stop iterating at some point. Maybe after 10 iterations. Here I write the premise and rules, copy pasted some of them from various sources and made lots of trial/error. If there is a better way or an optimization you can suggest its welcome.

premise: X
Rule1: X=~(50)FFF[^F[^_(1.2)!(0.5)F]_(2)!(0.5)F$]X
Rule2: U: t>4 =“(0.1)!/(137)!!~(5)FW :.8
Rule3: W=;”~(70)G(0.02)~(50) W
Rule4: G=H(0.001)
Rule5: H(h)="~(20)H(h-0.01)

I think I have to stop iterating Rule3 at some point to stop growing of thin branches but I couldnt figure out how to put something like an if-else clause. Any help would be great, thanks.
User Avatar
Member
5 posts
Joined: June 2011
Offline
Ok, I found the solution I guess. I am writing it down for anyone may stuck at the same point.

Actually the answer is inside the question, I probably copy/pasted it from somewhere so I missed it.
In order to stop a rule iterating this template may be used.
variable : t> Number of Maximum Iterations
t is the local variable of current iterations.
In this case the Rule3 have to be something like this:
W: t>30=;"~(70)G(0.02)~(50) W

This way it should stop growing after 30 iterations.
  • Quick Links