Branched Shape Generator

We model a branched shape by a collection of connected nodes (See the black points in Fig. 1). For each node we define a circle representing the width of the branche in such node and an smoothing factor representing the smoothness of the connections between branches in the green points (see Fig. 1).

Figure 1. Branched shape model

- A silhouette contouring the branched shape : a silhouette is given by an image where the silhouette is in black with a white background. You can choose one of the silhouettes proposed at the beginning of the DEMO, you can upload your own silhouette or you can do nothing and then the algorithm will use a default silhouette. The silhouette is used by the algorithm to constraint the nodes location, that is, all nodes has to be included in the silhouette.
- Branched shape type : We have created 11 different branched shape types including abstract trees, symmetric patterns, periodic patterns, etc.. You can select the branched shape type using an slider. Above the slider you can see an image illustrating the type of outcomes provided by the shape type
- Initial random seed generator : The creation of branched shape includes a random seed initialization, by changing this parameter you can obtain similar shapes.
- Average node distance : This is the distance between the nodes. The lower this value, the larger the number of nodes. The node coordinates are normalized to a 1024x1024 region.
- Average width of branches : This parameter is used to compute the width of the branches. The witdh of the branche is also affected for the above parameter "Average node distance": The lower the "Average node distance" the lower the width of the branches.
- Smoothing factor : The smoothing factor parameter determines how smooth is the connection between the branches (the connection of branches is produced in the green points illustrated in Fig. 1). For instance, if this parameter is equal to zero, then there is not any regularization and the branche contour arrive to the contact point (the green point) as straigh lines. The larger the value of this parameter, the smoother is the connection between branches.
- Branched finished in peak : This parameter determines if we want the extrema branches of the shapes (which correspond to nodes with a single neighbor) finishes in peak or not.
- Number of rows/lines in periodic pattern : Number of rows/lines used to show a periodic pattern. If the branched shape type is not periodic, then the algorithm produces different instances of the shape type changing the initial random seed
- Joint extrema probability : It is the probability of joining extrema nodes with just 1 neighbors. If the value of this parameter is 0 means that we do not join any extrema nodes and if the value is 1, the algorithm tries to connect all extrema nodes with other nodes of the shape.
- Max size of node neighborhood : This parameter represents the maximum size of a node neighborhood, that is, the maximum number of nodes that can be connected to a given one.
- Allow branche intersection : This parameter determines if we want to allow branches to intersect each other or not.
- Reduction factor of branche width through the branches : In most of the branche shape types we start by selecting an initial node and then, teratively, new nodes, connected to the previous ones, are added . This parameter represents how we reduce the branche width across the iterations of this procedure
- Max number of angles in a node neighborhood : This parameter (MaxAngles) determines the number of orientations (angles) we allow when we try to add a new node to the neighborhood of an existing one. For instance, if the value of this parameter is 32, we use orientations in the range [0,2pi]. If the value is 17, the orientation range is [0,pi] and if this value is 9 the orientation range is [pi/4, 3*pi/4], that is the smaller the parameter value, the more vertical are the orientations of a new node with respect to an existing one. The shape type 1 is slightly different. In this case we want to create labyrinthic shape and then we chose particular collection of angles: if MaxAngles=3, we use as potential angles to connect new nodes {0,2*pi/3,4*pi/3}, if MaxAngles=4, we use {0,pi/2,pi,3*pi/2}, and if MaxAngles=8, we use {0,pi/4,pi/2,3*pi/4,pi,5*pi/4,3*pi/2,7*pi/4}

Notice that the way parameters affect the branched shape depends on the branched shape type. In fact not all parameters are active for the different types. To clarify this point in the image illustrating each branched shape type you can see, in green, the parameters which are active for the style and in red the ones which are not active. For instance the silhouette option is only active for the first three types. It means that for the rest of the types no matter which silhouette you use the result is going to be the same.

For any parameter controlled by an slider, if you put the slider in the left side of the slider range you will get a negative number which means that the value of the parameter will be chose randomly when you click the RUN button.

If you find difficulties to understand how a parameter affects the final shape do not worry, just modify the value of the parameter in the DEMO interface (when all other parameter are not fixed as random), and just see what happen.