Tips for Procedural Modeling
 
 
 

There are some things you should be aware of as you build ICE modeling trees.

Setting the Topology Attribute

Setting the Topology attribute is time-consuming because it essentially executes all the topology operations that have been accumulated so far. In particular, avoid setting it inside a loop like Repeat or While. A good strategy is to save the value as a custom attribute inside the loop, and then set the actual Topology attribute afterward.

However, some operations can't be done until the Topology has been set. For example:

Attribute Values on New Components

Apart from intrinsic attributes like PointPosition and so on, the ICE attributes of new components are set to the default values. They are not interpolated in the same way that, for example, weights are interpolated when you add new points using non-ICE operators. This means that you can find new components by setting a custom attribute like PreExisting to True, setting Topology, and then filtering for PreExisting = False.

Creating Invalid Geometry

It is possible to create invalid geometry, such as disconnected vertices. These vertices are automatically cleaned up after the entire tree is evaluated, but they still exist between execution branches of the tree. However, getting attributes on these invalid vertices will give incorrect values, even for intrinsic attributes like PointPosition.

Simulated Topology

Although you cannot set a polymesh's Topology attribute in the Simulation region, you can calculate a topology value and use it to set a custom attribute in a simulated ICE tree on another object. You can then get this attribute in an ICE tree in the Modeling region of an empty mesh and use it to set Self.Topology.

Getting Data from Different Component Contexts

When modeling, you often need to get or set data from different contexts. For example, the current context may be per-polygon but you need to access per-edge data. In these situations, the Build Array from Set node is useful for building arrays of component data that can be accessed in any context. The following subtree gets the length of the longest edge per polygon.

Be careful using Build Array from Set with filtered sets. Any values that have been filtered out are replaced by the default value for that data type.

If you want to get the value of an attribute of a single component and access it in any context, use the Per Object Single Value output port of one of the "Test Component Index" compounds in the Conditionals group of the Task Topology tab in the preset manager.