Grid Spacing Tool for Houdini

Houdini Digital Assets | Python

As part of a project about hologram interfaces I made this asset to clone geometry on grids. This is done in and for Houdini as a digital asset. Calculations for scale and toggle expressions are internally done in Python. The full project can be seen on my portfolio as well, this is a more in depth look at one of the tools.

Internal node-tree

Functionalities

The basic settings give an easy way to control the grid’s component size, gap between the components and amount of copies per axis. There is the option to assign fixed dimensions to keep the created grid withing these boundaries. With the By Copies method, the amount of copies per axis is taken into account to scale the components accordingly. By Size does the opposite, it calculates the amount of copies that fit within the boundaries for the given size. The calculations for the size and amount of copies are done internally with Python-code.

Custom Input

The goal for this asset was initially to space anything on a grid, the boxes serve merely as a placeholder when there is no input. The input is for inserting any geometry, curve, etc. in the asset. This internally gets scaled to unit size in order for it to scale correctly with the Size value. The input gets automatically detected by checking the amount of points in the input itself. When no points are detected the tool switches to the box placeholder.

Python

The following are some examples of the python-code I used inside the nodes to calculate size, number of copies and the center distance. Notice I check the spacing method and fixed dimensions in almost every one of these nodes, since they give different results everytime. The channel-operator ch(“../..”) was very useful to use the global variables, defined by the user.