This tutorial builds a more advanced flow featuring dynamic attributes. The final outcome is a fully functional Activity Centre form.
Setting Up Your Flow: A Step-by-Step Guide
1. Applying Flows to Geometry: A key aspect of the Flow tool is that it can be applied to any Giraffe geometry. Once you've built your flow, you can apply it to many shapes at once. Just select all relevant shapes and apply the flow from the properties panel.
2. Understanding the Flow Editor: When you first open the flow editor, it can appear complex. The core principle is that you're building a series of connected nodes, each performing a specific function. The video focuses on creating a flow with several different feature sets. These sets are copied to write different features based on certain conditions.
3. Feature Writing: Defining Your Rules The heart of the flow lies in the "Write Feature" function. This function defines what properties should be applied to the geometry based on specific criteria. The example demonstrated in the video involves defining different usage types (Commercial, Medium Residential, Single Family Residential) based on proximity to a central point (centroid).
Building a Proximity-Based Flow: A Practical Example
Let's break down how to create a flow that changes usage based on proximity to a central point. Here's the logic we'll implement:
Commercial Zone: Within a 100-meter radius of the centroid.
Medium Residential: Between 101 and 220-meter radius.
Single Family Residential: Beyond 220 meters.
Here's a step-by-step breakdown:
1. Inputs: Start with the "Closed Point". This represents the central point that will trigger the changes.
2. Defining the Range: We need to define the distance ranges for each usage type. For this, we will use greater than and less than nodes.
Greater Than Node: Use this to define the minimum distance. Add a "Number" input node and set the value to 220 (representing 220 meters for the single-family residential zone). Connect the "Closed Point" to input A, and the "Number" node to input B of the Greater Than Node.
Less Than Node: Use this to define the maximum distance. Add another "Number" input node and set the value to 1000 (representing 1 kilometer). Connect the "Closed Point" to input A, and the "Number" node to input B of the Less Than Node.
3. Logic Gates:
AND Node: Use an "AND" node to combine the results of the "Greater Than" and "Less Than" nodes. The "AND" node ensures that the usage is only applied if both the minimum and maximum distance conditions are met.
Connect the "Greater Than" Node and "Less Than" Node to the "AND" node.
4. Conditional Application:
Ternary If Node: This node acts as a "true/false" switch. If the conditions defined by the "AND" node are true (i.e., the geometry falls within the specified distance range), then the flow will apply the defined usage. If false, then the flow will follow a different path, which we'll define later. Connect the "AND" node to the condition input of the "Ternary If" Node.
5. Writing the Feature:
Write Feature Node: This node is responsible for writing (applying) the new feature to the geometry. Connect the "Ternary If" node to the Write Feature node.
Apply Usage Node: This node specifically applies the desired usage to the geometry.
Get Usage Node: Instead of manually typing the usage name, use the "Get Usage" node. This provides a dropdown list of all available usages in your project. Select "Single Family Residential" from the list. Connect the "Get Usage" node to the "Apply Usage" node, and then connect the "Apply Usage" node to the Write Feature node.
Feature Property Node: Apply the properties to the feature such as levels (height). Use "Get Feature Property Name" node and select "Levels" and set the "Number Value" to 3.
6. Default Value for Out-of-Range Geometry If we drag the reference point to a large distance, the feature may disappear if there are no features available.
Identity Node: Helps with routing.
Filter Node: Filters the features based on the conditions. Connect the Identity Node to this Node.
List Length Node: Helps with filtering based on number of features. Connect the list Length Node to the C input on the Ternary If Node.
Ternary If Node: If true apply the filter to the features. If false, apply to the original feature.
7. Complete the Loop
Write Feature Node: Connect the Ternary If Node to this node. Now all of the geometry is back, and working well.
Important Tips for Optimizing Your Flow
Inspectors: Use Inspectors to understand what the node output values. Make sure "Evaluated Mode" is turned on at the top.
Default Values: Always consider what should happen when the defined rules don't apply. Returning to the original feature is a good practice.
Referencing Features: The Flow tool allows you to reference other features in your project. This is crucial for creating dynamic interactions between different elements.
