Expressions in L-system rules

   4891   3   1
User Avatar
Member
196 posts
Joined: July 2005
Offline
I'm trying to write an expression(involving chops) in an l-system rule similar to say:

Achopf(“/ch/ch1/file1/chan0”, $F)>0.5)=F

This kind of expression isn't working for me. Does anyone know if chops are supported within l-system SOPS?

Cheers
Henster
Henster
User Avatar
Member
412 posts
Joined: July 2005
Offline
someone correct me on this if im wrong, but i don't think you can do many expressions at all in your l-sys rules. not even $F.. which kinda sucks cause that would really really nice if you could..

from the manual:

71.12 EXPRESSIONS


In the earlier example, the expressions 0.5*i and 2*j are used. In fact, expressions can be used anywhere a numeric Þeld is expected. Currently the following symbols can be used within expressions:

( ) brackets for nesting priority
^ + - * / % arithmetic operators
min() max() sin() cos() asin() acos() pic() in() supported functions
== != = < <= > >= logical operators
& | ! logical operators: and, or, not
b c d OP b, c, d parameters after expansion
x y z current turtle position
g age of symbol
t time (generations) of L-system
a OP angle parameter
T OP tropism (gravity) parameter

The pre-deÞned variables above should not be used in the arguments of the prede-cessor. For example:
A(a,b) = B(a*2,b*2)WRONG (a is the OP Angle parameter) a<b (A,B) = b(A+1,B)RIGHT
The last statement is correct because a and b are used as symbols and not variable names. A and B are correct because variable names are case sensitive.

L-SYSTEM SPECIFIC EXPRESSION FUNCTIONS

pic(u, v, c)Using the image speciÞed with Pic Image File, thisfunction returns a normalized value (between 0 and 1) of the pixel at the normalized coordinates (u,v); c selects one of four channels to examine: 0 - grey 1 - red 2 - green 3 - blue

in(q, r, s)Given a MetaTest input source containing a metaball geometry, this function returns a 1 if the point (q, r, s)is contained within the metaball, and 0 if not.Use in(x, y, z) (the letters x, y, and z are special andcontain the X, Y, and Z location of the turtle) to testwhether or not the turtle is currently inside the metaball to create pruned outputs.


hth,

dave
Dave Quirus
User Avatar
Member
7714 posts
Joined: July 2005
Offline
If you look at the help in 6.1 within the Lsystem SOP, I believe there's an example on how to do expressions.
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
you could also use the custon variables (a, b, c etc) for your expressions, then use those values in your rules
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
  • Quick Links