ICE: Getting the edge index of the longest edge


For each polygon, I want to get the EdgeIndex of the longest edge (ultimately, I want to get the midpoint of the longest edge for each polygon).

Being literal-minded, I started by getting the length of the longest edge for each polygon:
edgelength_max
Here’s a Show Values to show it works:
edgelength_max_showvalues

From there, I hacked my way to the edge index:
edgelength_max_index_1
The Show Values:
edgelength_max_index_1_showvalues

For my second try at getting the index of the longest edge, I stopped trying to go from the length back to the index. I think this is a little better approach:
edgelength_max_index_2

edgelength_max_index_2_showvalues

ICE: Selecting every N points in a grid


Here’s a question from the Softimage mailing list, and what I would have answered (I didn’t answer, and I didn’t peek at the other answers either).

Given a 100×100 Grid point cloud, how would you do something to the following subsets of points?
[0,5,10, ... 595] and [1000,5,10, ... 1595]

For something like that, modulo is an obvious way to do it:
grid_every_n
Contrast the above with this nicer tree

Here’s [a cruder?] approach using linearly interpolated arrays:
grid_every_n_1

See also this for some compounds.

Rotating vectors around the global X axis


Another Rotate Vector example. This time, I rotate the points of a mesh around the global X axis. In short, the point positions are treated as vectors, and then rotated about the specified axis. Of course, this requires some conversion between coord systems, which is always fun :)

The bottom part of the tree is just for visualization.

rotate_vector_around_X_axis