tutorial: documentation: GENR8


TUTORIAL CONTENTS
3.0 Running the Plug-in
   3.1 Setting Up an Environment
   3.2 Running GENR8
   3.3 Grammars
       3.3.1 Predefined
       3.3.2 User-defined
       3.3.3 Evolved
   3.4 Evolution
4.0 MEL-command descriptions
   4.1 genr8
   4.2 degenr8
   4.3 regenr8
   4.4 regn8
   4.5 repellor
   4.6 attractor
5.0 Examples


back to Documentation Main



3.0 Running the Plug-in

3.1 Setting Up an Environment
The normal of the surface will initially be pointing in the z-direction, so it might be a good idea to change the settings in Maya so that its z-axis points upward. Do this from the menu Window->Setting/Preferences->Preferences in the lefthand menu, choose Settings and there you will be able to change axis. Also it might be easier to view what is happening without the grid, turn it off on the Display-menu.

Attractors
Attractors act like magnets for the surface. As it grows it draws closer to the attractor. Attractors and repellors are represented as point charges and have to parameters, a constant and an exponent. The displacement from an attractor is diplacement = c/d^e, where d is the distance to the surface element, c is the constant and e is the exponent. This function has a singularity in d=0 and thus you get strange (and perhaps undesired) results if a surface element is close to the attractor.

Attractors are created in a separate layer, this makes it easy to toggle their visibility.

Repellors
Repellors are similar to attractors, instead of drawing the surface closer, it is pushed away.

Gravity
Gravity is a force that acts uniformly throughout space in one direction (x, y, or z). You can set the gravity with the -g/gravity flag.

Boundaries
You can set boundaries for the growth by placing ordinary Maya-surfaces (polygons or nurbs) in the scene. Before starting genr8, you need to place the surfaces on the selection-list before running the command. There are three different wall behaviours defined, that you can choose between before the run.

Default
The growth is cut off so that the surface do not penetrate the boundary. During testing there have been cases where the, boundary does not stop the growth. The reason for this is most likely because Maya failed to detect the intersection

Cut Off
As the surface element hit the boundary, all movement is stopped. With the default behaviour, it slides along the boundary, but now it stops dead instead.

Soft Boundaries
This behaviour is only interesting when you have evolution. The surface can grow past the boundaries, but their fitness is penalized as they do so.

User Defined Seeds
The seed (starting surface) for GENR8 is by default a regular polygon. The user can control the length of the sides and the starting position of this polygon. However, GENR8 can also handle user defined seeds. You can draw a curve and select it before starting the run (you do not have to close the curve, GENR8 will do that for you). This curve will be tha starting point for the run, predicting the result is difficult though, since the assignment of types for the segments is randomized.

Since GENR8 uses Bsplines rather than nurbs, it is recommended that you use the "Curve with EPs" rather than the "Curve with CVs" tool. Otherwise, the output from GENR8 will have a different shape from the input. GENR8 assumes that the normal of your axiom has some component in the z-axis, if not things might go wrong.


3.2 Running GENR8
The growth of the surfaces are exponential. This means that each step takes approxiamtely twice as long as the previous. It is important to emphasize that this a very rapid growth and that you should be careful about using more than four steps.

GENR8 is seamlessly integrated with Maya, so (except when during calcualtions) you can use any feature in Maya. If a run is taking to long time, it can be interrupted by pressing the ESC-key. Unfortunately, this only works for the evolutionary runs. If you did not follow my advice and started a run with the predefined grammars for 12 steps, then you must force Maya to quit with the Task Manager.

GUI
The GUI provides more user-friendly access to GENR8 for those who do not fancy the command-line alternative. When using the evolutionary part of GENR8, it is strongly advised to use the GUI since it facilitates the inspection of the population and provides interesting data.

When using the GUI, it is important to use the Cancel-button to close the windows. Otherwise, variable values may linger in the environment, resulting in unexpected behaviour. If you think that GENR8 behaves odd, start the GUI and check that all variables have proper values, correct them and close with the Cancel-button.

For a description of the parameters, read the help-file for the MEL-command. If you change a parameter value, it is important to hit the Tab-key, or click in another field with the mouse, afterwards for the change to take effect.

The output window pops up if you choose to "GENR8 and Show Stats". Each individual is drawn in a separate layer, and the visibility of that layer is toggled when the details of the individual is viewed. If you choose to "Continue GENR8", the evolution will be continued with the same parameters as before. If you choose to "GENR8 and Change Parameters", you will be able to change the parameters for the run. If you wish to continue with the same population as before, do not forget to check "Continue" under "Genetic Engine". The "Grow Individual" option can be used to study a surface in more detail. You will be able to see all the growth steps of that particular surface.


3.3 Grammars
Surfaces are grown using a grammar. The grammar tells us how each surface element should be altered during each growth step.

There are three kinds of grammars in GENR8, predefined, user-defined and evolved.

It is recommended that you start by using the predefined grammars until you feel that you have understood the growth model and the environment. It is much easier to figure out the effects of the environment if you have a rough idea of what the outcome will be.

3.3.1 Predefined
Three-sided Tiles
This grammar produces a triangular surfaces that gets subdivided in to smaller and smaller triangles. The grammar is defined as:
Edge0 + Edge1 + Edge2
Edge0 -> Edge0 [ [ [ [ + Edge2 ] + + Edge1 ] - Edge1 ] - - Edge2 ] Edge0
Edge1 -> Edge1 [ [ [ [ + Edge0 ] + + Edge2 ] - Edge2 ] - - Edge0 ] Edge1
Edge2 -> Edge2 [ [ [ [ + Edge1 ] + + Edge0 ] - Edge0 ] - - Edge1 ] Edge2
Angle 60
Sync
Four-sided Tiles
This grammar produces a square surface which is subdivided in to smaller squares. The grammar is:
Edge0 + ~ Edge1 + ~ Edge0 + Edge1
Edge0 -> Edge0 [ [ + Edge1 ] - Edge1 ] Edge0
Edge1 -> Edge1 [ [ + Edge0 ] - Edge0 ] Edge1
Angle 90
Koch curve
The Koch curve is an example of a fractal and it is a curve rather than a surface and it is not of much use for generating surfaces. However, fractals are interesting in themselves and the ability to generate them comes "for free" with the growth model. The grammar is:
Edge0 + Edge0 + Edge0
Edge0 -> Edge0 - Edge0 + + Edge0 - Edge0
Angle 60
Quadratic Koch curve
The quadratic Koch curve is a variant of the Koch curve.
Edge0 + Edge0 + Edge0 + Edge0 Edge0 -> Edge0 + Edge0 - Edge0 - Edge0 Edge0 + Edge0 + Edge0 - Edge0 Angle 90

3.3.2 User-defined
GENR8 can parse grammars that are defined by the user. The grammars used by GENR8 are expressed on Backus-Naur Form (BNF).The parser can handle all grammars that are generated from the following definition.

N = { RewriteRule, Predecessor, Successor, Modifier, Operator, Axiom, Condition, LSystem, Segment }
T = { +, -, &, ^, \, /, ~, [, ], <, >, Edge, -> }
S = { <LSystem> }
P = {
<LSystem> ::= <Axiom> <RewriteRule> { <RewriteRule> }
<Axiom>
::= <Segment> [ "~" ] "+" <Segment> [ "~" ] "+" <Segment> { [ "~" ] "+" <Segment> }
<RewriteRule> ::= <Predecessor> "->" <Successor> [ <Condition>]
<Predecessor> ::= <Segment> |
      <Segment> "<" <Segment> |
      <Segment> ">" <Segment> |
      <Segment> "<" <Segment> ">" <Segment>
<Successor> ::= { <Modifier> } <Segment>
<Condition> ::= "If"
<Modifier> ::= { <Segment> } |
      "+" <Modifier> "-" |
      "-" <Modifier> "+" |
      "&" <Modifier> "^" |
      "^" <Modifier> "&" |
      "\" <Modifier> "/" |
      "/" <Modifier> "\" |
      "~" <Modifer> |
      "[" "[" "+" { <Operator> } <Segment> "]" "-" { <Operator> } <Segment> "]"
<Operator> ::= "+" |
      "-" |
      "&" |
      "^" |
      "\" |
      "/" |
      "~" |

Most of this information is unnecessary when writing your own grammar. Instructions for creating a grammar file can be found here.

3.3.3 Evolved
There are obviously an infinite set of possible grammars and in order to be able to search them somewhat more effectively, there is an evolutionary component that does this. When generating grammars the evolutionary algorithm uses a BNF that is very similar to the one described above. You can use one of the following.

Default
The default BNF has been specified to generate a lot of branches. This will in turn produce subdivisions, which in general is a desired property for a surface.

Reversible
This BNF produces grammars that can be inverted using regn8.

Symmetric
The symmetric BNF creates a grammar that produces a symmetric surface.

Probabilistic
This BNF produces grammars with probabilistic productions.


3.4 Evolution
GENR8 features an evolutionary algorithm that searches a universe of grammars. The purpose of this is to create new and interesting surfaces. The user has high-level control of the evolution by setting the fitness criterion. The specific method used by GENR8 is called grammatical evolution(GE).



4.0 Mel-command Descriptions

4.1 genr8
synopsis: genr8 [flags]
return value: Message from the developer
description: Generate a scaffold using a reactive growth model in a user-defined environment
flags:
-n/steps unsigned The number of growth steps. Note, since the growth is exponential, each step will take approximately twice as long as the previous.
Default: 4
-s/scale double  How much the design will be scaled on each growth step.
Default: 1.5.
-sx/scaleX double How much the design will be scaled in the X-direction.
Default: same as scale.
-sy/scaleY double How much the design will be scaled in the Y-direction.
Default: same as scale.
-sz/scaleZ double How much the design will be scaled in the Z-direction.
Default: same as scale.
-p/polygons  Draw polygons instead of nurbs.
Default: off.
-fp/fixedPerimeter  Keep the perimeter fixed. If this is on, the perimeter will be fixed and the surface will behave more like a membrane.
-fc/fixedCenter  Keep the center fixed to the starting position.
-ds/drawEachStep If this flag is set GENR8 will draw each growth step, if not it only draws the scaffold when it has finished growing it. If the populationSize is 1 and this flag is used, each step will be drawn in its own layer.
-sp/startPosition double double double The coordinates for the centre at the start.
Default: origin (0, 0, 0).
-sl/startLength double Set the side length of the seed. The seed is always a regular polygon.
Default: 1.
-ba/branchAngle unsigned Set the angle (in degrees, ie between 0 and 90) for the cone that is used when trying to match branches.
Default: 30.
-bl/branchLength double Set a limit to the maximum distance for when branches can be connected. This is not an absolute value, but a multiple of the characteristic length of the scaffold. The characteristic length is defined as the startLength, multiplied by the scale for each step. A value of -1 means infinite range.
Default: -1.
-g/gravity x|y|z double Apply a gravitational force in the desired direction. The second argument gives the magnitude, where a negative value means in the negative direction.
Default: no gravity.
-a/attractor double double double  Place an attractor at the given coordinates. This argument can be used multiple times.
-r/repellor double double double  Place a repellor at the given coordinates. This argument can be used multiple times.
-aw/activeWalls  If the walls should push back vertices growing towards it or simply cut them off if they try to move outside. If this is off and you have a small bounding box there is a risk that a lot of vertices will pile up at the walls.
-rn/randomNoise double Add a noise component to the system. The growth will be affected by a random perturbation.
Default: 0.
-rr/randomRewrite unsigned This is similar to the -rn flag. Its value should be between 0 and 100 and it is the probability that a segment will get another type than the rewriterule indicated.
Default: 0.
-wc/wallConstant double Set c in the attractorequation, c/d^e. Only used when aw is on.
Default: 50.
-we/WallExponent unsigned Set e in the attractorequation, c/d^e. Only used when aw is on.
Default: 2.
-co/cutOff  Determines the behaviour when a vertex hits a wall. If this is on, it stops dead at the wall, if off, it slides along the wall and continues to grow.
-rp/repellingPoints double unsigned Make the vertices repelling, this means that there will be an internal feedback throughout the system. The vertices will move away from each other, making the cellsizes more uniform. This function has quadratic complexity, while the other functions are linear, thus this function could slow down the program significantly.
-rns/randomSeed unsigned Set the seed of the random number generator to this value (good if you want to get the same run again).
-t/tiles 3|4 Use a predefined grammar that generates square tiles. If you use the four sided tiles, GENR8 will try to create a nurbs-surface. Since the two first steps are of degree one and the latter of degree three, the transition between these steps can look odd.
-kc/kochCurve  Use a predefined grammar to draw a Koch-curve (snowflake fractal).
-qk/quadraticKoch  Use a predefined grammar to draw a variant of the Koch curve.
-rv/reversible  If this flag is set, the grammar will be generated from a more restricted BNF. Then it will always be possible to reverse the grammar produced with regn8. This flag should also be used when you are loading a genome that was produced by regn8.
-syb/symmetricBNF  If this flag is set the BNF will be constrained so that it only produces grammars that generate symmetric scaffolds. The symmetric BNFs are a subset of the reversible BNFs.
-pr/probabilistic  If this flag is used, genr8 will produce grammars that have probabilistic rewrite rules.
-frr/fullRandomRewrite unsigned If this flag is set the probabalistic rules will behave in a different way. If the flag is not used, every segment gets rewritten by the same rule (during each step), if it is set each segment will get a separate rule, which most likely results in a more random structure.
-mbd/maxBNFDepth unsigned This limits the depth of the expansion of the grammar when interpreting the evolutionary algorithm interprets the genome.
Default: 5.
-met/maxEdgeTypes unsigned This enables you to set a maximum for the number of edge types that can be produced by the evolutionary algorithm.
-lg/loadGrammar string Use a grammar that has been specified in the file in string. If you do not specify the entire path to the file, GENR8 looks for it in the same directory that GENR8 is stored in. For more info on how you should write your grammar file, please read this section.
-sg/saveGrammar string Save the grammars used (all of them) in the file specified by string. GENR8 will automatically place it in the same directory as it is installed in if you do not specify the entire path.
-ps/populationSize unsigned If you do not use the predefined tiles or fractals, GENR8 will do an evolutionary search for good grammars. This specifies the population size, and it must be at least 1 (even if you are using tiles). Each inidivual is drawn in its own layer.
Default: 1.
-ge/generations unsigned How many generations should be evolved. Each scaffold will grow steps times before being evaluated (and it may take a while if steps, populationSize or generations is high).
Default: 0.
-mr/mutationRate unsigned Set the mutation rate for the genetic engine. This is the probability that a gene is mutated and the value should be between 0 and 100.
Default: 2.
-ts/tournamentSize unsigned Set the size of the tournament used by the EA. A high value means more elitism.
Default: 4.
-e/elites unsigned Set the number of elites. Elites are automatically copied into the next generation. In order to maintain diversity, this value should be kept low.
Default: 1.
-gl/genomeLength unsigned Set the genomelength to this value, all individuals have the same length. Unless the genome is very short, the value does not really make a big difference.
Default: 50.
-e/elites unsigned Set the number of elites. Elites are automatically copied into the next generation. In order to maintain diversity, this value should be kept low.
Default: 1.
-vi/viewIndividual unsigned Just view the individual with rank unsigned instead of the entire population.
-ci/copyIndividual unsigned unsigned The first argument is the rank of the individual to be copied and the second is the number of copies. The new copies be inserted at the end of the population. Note that you copy the individual with the specified rank and not the ID!
-sdp/seedPopulation unsigned unsigned This is similar to the -ci flag. But instead of making exact copies, the copies will be mutated.
-c/continue  Continue with the same genetic material as in your last run. The genome is read from the file genome.txt. In this way, you can change your settings and parameters after running a few generations.
-lge/loadGenome string Load genome from the file string.
-sge/saveGenome string Save the genome in the file string. If you do not specify the whole path, it will be saved in the same directory as GENR8. By default, the genome is saved in the file genome.txt.
-sf/setFitness unsigned double Set the fitness of individual unsigned to double. This is a good way to give the EA a kick in the direction you want it to go. This flag can be used multiple times.
-si/size double double Desired size in the x- and y-direction.
Default: 10 10.
-siw/sizeWeight double Set the weight for the size fitness criterion.
Default: 1.
-sm/smoothness double This parameter is used when determining the fitness for a design. The value is how much you wish the z-values of the vertices to vary. 0 means that the surface is completly flat and a high value will give a rugged surface.
Default: 0.
-smw/smoothnessWeight double Set the weight for the smoothness fitness criterion.
Default: 1.
-sbw/softBoundaryWeight double If this weight is greater than 0, the boundaries will not stop growth, instead there will be a fitness penalty proportional to the number of vertices that are outside the boundaries.
Default: 0.
-su/subdivisions double This parameter should be between 0 and 1 and is the desired amount of subdivisions on the surface. A value of 1 means that there are no subdivisions and the lower the value is, the more subdivisions should be generated.
Default: 0.
-suw/subdivisionsWeight double Set the weight for the subdivisions fitness criterion.
Default: 1.
-sy/symmetry double Desired level of symmetry. The value should be between 0 and 1 where 0.5 represents a symmetrical design and the extreme values something totally unsymmetric.
Default: 0.5.
-syw/symmetryWeight double Set the weight for the symmetry fitness criterion.
Default: 1.
-un/undulation double The undulation fitness criteria specifies how much variation in the z-value we desire on a global level (smoothness is a local criterion). A value of 0 strives for a flat surface and positive values allows for more varition in z-values.
Default: 0
-unw/undulationWeight double Set the weight for the undulation fitness criterion.
Default: 1.
-dy/displayStats  Use this flag to get the output window.

4.2 degenr8
synopsis: degenr8 [flags]
return value: Message from the developer
description: Remove things from the Maya scene that were created by genr8. You should use this command for removing stuff created by genr8, attractor and repellor rather than deleting them by hand, since these commands create MEL-variables that can cause problems later.
flags:
-n/steps unsigned The number of growth steps. Note, since the growth is exponential, each step will take approximately twice as long as the previous.
Default: 4
-s/scale double  How much the design will be scaled on each growth step.
Default: 1.5.
-sx/scaleX double How much the design will be scaled in the X-direction.
Default: same as scale.
-sy/scaleY double How much the design will be scaled in the Y-direction.
Default: same as scale.
-sz/scaleZ double How much the design will be scaled in the Z-direction.
Default: same as scale.
-p/polygons  Draw polygons instead of nurbs.
Default: off.
-fp/fixedPerimeter  Keep the perimeter fixed. If this is on, the perimeter will be fixed and the surface will behave more like a membrane.
-fc/fixedCenter  Keep the center fixed to the starting position.
-ds/drawEachStep If this flag is set GENR8 will draw each growth step, if not it only draws the scaffold when it has finished growing it. If the populationSize is 1 and this flag is used, each step will be drawn in its own layer.
-sp/startPosition double double double The coordinates for the centre at the start.
Default: origin (0, 0, 0).
-sl/startLength double Set the side length of the seed. The seed is always a regular polygon.
Default: 1.
-ba/branchAngle unsigned Set the angle (in degrees, ie between 0 and 90) for the cone that is used when trying to match branches.
Default: 30.
-bl/branchLength double Set a limit to the maximum distance for when branches can be connected. This is not an absolute value, but a multiple of the characteristic length of the scaffold. The characteristic length is defined as the startLength, multiplied by the scale for each step. A value of -1 means infinite range.
Default: -1.
-g/gravity x|y|z double Apply a gravitational force in the desired direction. The second argument gives the magnitude, where a negative value means in the negative direction.
Default: no gravity.
-a/attractor double double double  Place an attractor at the given coordinates. This argument can be used multiple times.
-r/repellor double double double  Place a repellor at the given coordinates. This argument can be used multiple times.
-aw/activeWalls  If the walls should push back vertices growing towards it or simply cut them off if they try to move outside. If this is off and you have a small bounding box there is a risk that a lot of vertices will pile up at the walls.
-rn/randomNoise double Add a noise component to the system. The growth will be affected by a random perturbation.
Default: 0.
-rr/randomRewrite unsigned This is similar to the -rn flag. Its value should be between 0 and 100 and it is the probability that a segment will get another type than the rewriterule indicated.
Default: 0.
-wc/wallConstant double Set c in the attractorequation, c/d^e. Only used when aw is on.
Default: 50.
-we/WallExponent unsigned Set e in the attractorequation, c/d^e. Only used when aw is on.
Default: 2.
-co/cutOff  Determines the behaviour when a vertex hits a wall. If this is on, it stops dead at the wall, if off, it slides along the wall and continues to grow.
-rp/repellingPoints double unsigned Make the vertices repelling, this means that there will be an internal feedback throughout the system. The vertices will move away from each other, making the cellsizes more uniform. This function has quadratic complexity, while the other functions are linear, thus this function could slow down the program significantly.
-rns/randomSeed unsigned Set the seed of the random number generator to this value (good if you want to get the same run again).
-t/tiles 3|4 Use a predefined grammar that generates square tiles. If you use the four sided tiles, GENR8 will try to create a nurbs-surface. Since the two first steps are of degree one and the latter of degree three, the transition between these steps can look odd.
-kc/kochCurve  Use a predefined grammar to draw a Koch-curve (snowflake fractal).
-qk/quadraticKoch  Use a predefined grammar to draw a variant of the Koch curve.
-rv/reversible  If this flag is set, the grammar will be generated from a more restricted BNF. Then it will always be possible to reverse the grammar produced with regn8. This flag should also be used when you are loading a genome that was produced by regn8.
-syb/symmetricBNF  If this flag is set the BNF will be constrained so that it only produces grammars that generate symmetric scaffolds. The symmetric BNFs are a subset of the reversible BNFs.
-pr/probabilistic  If this flag is used, genr8 will produce grammars that have probabilistic rewrite rules.
-frr/fullRandomRewrite unsigned If this flag is set the probabalistic rules will behave in a different way. If the flag is not used, every segment gets rewritten by the same rule (during each step), if it is set each segment will get a separate rule, which most likely results in a more random structure.
-mbd/maxBNFDepth unsigned This limits the depth of the expansion of the grammar when interpreting the evolutionary algorithm interprets the genome.
Default: 5.
-met/maxEdgeTypes unsigned This enables you to set a maximum for the number of edge types that can be produced by the evolutionary algorithm.
-lg/loadGrammar string Use a grammar that has been specified in the file in string. If you do not specify the entire path to the file, GENR8 looks for it in the same directory that GENR8 is stored in. For more info on how you should write your grammar file, please read this section.
-sg/saveGrammar string Save the grammars used (all of them) in the file specified by string. GENR8 will automatically place it in the same directory as it is installed in if you do not specify the entire path.
-ps/populationSize unsigned If you do not use the predefined tiles or fractals, GENR8 will do an evolutionary search for good grammars. This specifies the population size, and it must be at least 1 (even if you are using tiles). Each inidivual is drawn in its own layer.
Default: 1.
-ge/generations unsigned How many generations should be evolved. Each scaffold will grow steps times before being evaluated (and it may take a while if steps, populationSize or generations is high).
Default: 0.
-mr/mutationRate unsigned Set the mutation rate for the genetic engine. This is the probability that a gene is mutated and the value should be between 0 and 100.
Default: 2.
-ts/tournamentSize unsigned Set the size of the tournament used by the EA. A high value means more elitism.
Default: 4.
-e/elites unsigned Set the number of elites. Elites are automatically copied into the next generation. In order to maintain diversity, this value should be kept low.
Default: 1.
-gl/genomeLength unsigned Set the genomelength to this value, all individuals have the same length. Unless the genome is very short, the value does not really make a big difference.
Default: 50.
-e/elites unsigned Set the number of elites. Elites are automatically copied into the next generation. In order to maintain diversity, this value should be kept low.
Default: 1.
-vi/viewIndividual unsigned Just view the individual with rank unsigned instead of the entire population.
-ci/copyIndividual unsigned unsigned The first argument is the rank of the individual to be copied and the second is the number of copies. The new copies be inserted at the end of the population. Note that you copy the individual with the specified rank and not the ID!
-sdp/seedPopulation unsigned unsigned This is similar to the -ci flag. But instead of making exact copies, the copies will be mutated.
-c/continue  Continue with the same genetic material as in your last run. The genome is read from the file genome.txt. In this way, you can change your settings and parameters after running a few generations.
-lge/loadGenome string Load genome from the file string.
-sge/saveGenome string Save the genome in the file string. If you do not specify the whole path, it will be saved in the same directory as GENR8. By default, the genome is saved in the file genome.txt.
-sf/setFitness unsigned double Set the fitness of individual unsigned to double. This is a good way to give the EA a kick in the direction you want it to go. This flag can be used multiple times.
-si/size double double Desired size in the x- and y-direction.
Default: 10 10.
-siw/sizeWeight double Set the weight for the size fitness criterion.
Default: 1.
-sm/smoothness double This parameter is used when determining the fitness for a design. The value is how much you wish the z-values of the vertices to vary. 0 means that the surface is completly flat and a high value will give a rugged surface.
Default: 0.
-smw/smoothnessWeight double Set the weight for the smoothness fitness criterion.
Default: 1.
-sbw/softBoundaryWeight double If this weight is greater than 0, the boundaries will not stop growth, instead there will be a fitness penalty proportional to the number of vertices that are outside the boundaries.
Default: 0.
-su/subdivisions double This parameter should be between 0 and 1 and is the desired amount of subdivisions on the surface. A value of 1 means that there are no subdivisions and the lower the value is, the more subdivisions should be generated.
Default: 0.
-suw/subdivisionsWeight double Set the weight for the subdivisions fitness criterion.
Default: 1.
-sy/symmetry double Desired level of symmetry. The value should be between 0 and 1 where 0.5 represents a symmetrical design and the extreme values something totally unsymmetric.
Default: 0.5.
-syw/symmetryWeight double Set the weight for the symmetry fitness criterion.
Default: 1.
-un/undulation double The undulation fitness criteria specifies how much variation in the z-value we desire on a global level (smoothness is a local criterion). A value of 0 strives for a flat surface and positive values allows for more varition in z-values.
Default: 0
-unw/undulationWeight double Set the weight for the undulation fitness criterion.
Default: 1.
-dy/displayStats  Use this flag to get the output window.

4.3 regenr8
synopsis: regenr8 [flags]
return value: Message from the developer
description: This command will make it easier to view the different individuals. If you want to, you can turn the visibility on and off in the menus, but this command provides an easier way. This command is built in to the GUI for genr8.
flags:
-a/allIndividuals boolean Turn the visibility on or off for all individuals.
-s/showIndividual unsigned boolean Turn the visibility on or off for individual unsigned.

4.4 regn8
synopsis: regn8 [flags]
return value: Message from the developer
description: This command is part of the Interruption Interaction and Resumption (IIR) features of GENR8. It can be used to map a grammar to a genotype. This genotype can later be modified and used in a genr8 run.

It is important to note that the grammar that is to be inverted must be generated by a reversible BNF. If this is not the case, the produced genome will not produce the original grammar. It is important to use the -rv flag when using this genome with genr8.
flags:
-g/grammarFile string
The file that specifies the grammar that should be mapped to a genome. If the entire path is not specified, regn8 will look in the directory where it is stored.
-s/saveFile string
The file where the generated genome will be stored. If the entire path is not specified, regn8 will look in the directory where it is stored. NB Do not use the name genome.txt, since genr8 is using that name.

4.5 repellor
synopsis: repellor [flags]
return value: Message from the developer
description: Use this command to place repellors (you may still place repellors using the flags for genr8). When you have placed the repellor, you may move it around just like an ordinary Maya-cylinder. If you use this command it is a good idea to remove the repellors with degenr8, since it cleans up the MEL-variables that are generated. If that is not done, things may behave strangely later. If you select a repellor when this command is executed, you will be able to edit the values of the repellor.

The repellors that are being drawn are ordinary polyCylinders and as long as you do not change the name of the repellor, feel free to alter the position and the size.

If you select a repellor and use the repellor command, you will be able to edit the parameters. Whenever you change a value, you should hit enter while the cursor still is in that field. If you edit a repellor, you will get the GUI, regardless of the presence of the -g flag.
flags:
-g/graphical 
Turn on a gui to place the repellor.
-p/position double double double
Position of the repellor. Default is origin.
-c/constant double
Set the nominator in the repellor equation. Default is 10.
-e/exponent 
The exponent for the repellor equation. Default is 2.

4.6 attractor
synopsis: attractor [flags]
return value: Message from the developer
description: Use this command to place attractors (you may still place attractors using the flags for genr8). When you have placed the attractor, you may move it around just like an ordinary Maya-cylinder. If you use this command it is a good idea to remove the attractors with degenr8, since it cleans up the MEL-variables that are generated. If that is not done, things may behave strangely later. If you select a attractor when this command is executed, you will be able to edit the values of the attractor.

The attractors that are being drawn are ordinary polyCylinders and as long as you do not change the name of the attractor, feel free to alter the position and the size.

If you select a attractor and use the attractor command, you will be able to edit the parameters. Whenever you change a value, you should hit enter while the cursor still is in that field. If you edit a attractor, you will get the GUI, regardless of the presence of the -g flag.
flags:
tr valign=top>
-g/graphical 
Turn on a gui to place the attractor.
-p/position double double double
Position of the attractor. Default is origin.
-c/constant double
Set the nominator in the attractor equation. Default is 10.
-e/exponent 
The exponent for the attractor equation. Default is 2.




5.0 Examples
In this section we present a few commands that can be used to create interesting surfaces. Hopefully, this can be of some help when you are learning how to use the system (I am afraid that it is more difficult to use than I intended to). The easiest way to use these commands is to copy the text to the script editor and hit Enter (you must use the Enter key at the numerical keyboard and not the ordinary one).

genr8 -kc
Comment: The Koch-curve (also known as the snow flake), fractals are just subset of what is possible with genr8.

genr8 -fp -sl 8 -n 5 -ba 70 -t 4 -r 0 0 3 -rn 0.1 -s 1.1
Comment: The surface behaves more like a membrane since the perimeter vertices are not allowed to move.

polyCube -w 3 -h 4 -d 3;
genr8 -t 3 -rn 0.1 -n 4;
Comment: Remember that you must select teh cube before the run. If you run the commands simultaneously, the cube is automatically selected.

polyCube -w 3 -h 4 -d 3;
genr8 -t 3 -n 5 -a 0 0 4 -g z -0.5;
Comment: Do not forget to select the cube! The center of the surface is pulled by the attractor until it hits the ceiling of the cube. The other parts are dragged down by gravity.

polySphere -r 5;
genr8 -t 4 -n 5 -ba 90 -g z -1 -sp 0 0 7 -sl 3 -s 1.3;
Comment: This an example where it works fine with a convex wall.

genr8 -t 4 -n 6 -ds -s 1.3 -r 0 0 -3 -r 0 4 0 -ba 90 -r 1 -3 -4 -r 2 2 5 -r -3 -2 1;
Comment: The final shape is far from the original square.

genr8 -t 3 -n 5 -g z -1 -r 0 0 -3;
Comment: The gravity is balanced by the repellor, producing a nice arc.

polyCube -w 3 -h 4 -d 3;
genr8 -t 4 -n 5 -r 3 3 3 -co;
Comment: Note how the parts of the surface that hit the walls of the cube stop moving because of the cut-off wall behaviour.




home   |   media : publications   |   files : documentation