# Combinatorial Geometry in Houdini

As primitive geometric objects (objects that do not arise as combinations of other objects) Houdini supports also round spheres, cylinders (called tubes in Houdini), volumes and other things. We will focus here on Houdini’s implementation of the combinatorial complexes described in the last two posts.

Both types of complexes that we discussed rely on a finite set $P$ of points. This is the case also in Houdini. Since Houdini wants to visually represent all of its geometry, here every point $i$ comes with a position $\mathbf{p}_i\in \mathbb{R}^3$.

All combinatorics in Houdini is encoded in a finite set of polygons. Polygons come in two flavors, open or closed. In both cases the polygon is described by an arbitrary finite sequence

$\gamma = (i_1,\ldots,i_n)$

of points $i_1,\ldots,i_n \in P$. If a polygon is marked as “open”, it will be drawn by connecting in $\mathbb{R}^3$ the positions $\mathbf{p}_{i_k},\mathbf{p}_{i_{k+1}}$ of consecutive points by straight line seqments.

If the polygon is marked as “closed”, there will be also a line seqment from $\mathbf{p}_{i_n}$ to $\mathbf{p}_{i_1}$ and the polygon will be rendered as filled in by some surface (which looks more smooth in the render view than in the scene view).

What is now the relation of Houdini’s setup to the two types of combinatorial complexes that we discussed?

First, based on Houdini’s data we define a one-dimensional simplicial complex $\Sigma$: A two-element subset $\{i,j\}\subset P$ belongs $\Sigma$ if and only if there is a polygon $\gamma = (i_1,\ldots,i_n)$ and an index $k$ such that $(i,j)=(i_k,i_{k+1})$. Here the indices are understood modulo $n$ in case the polygon $\gamma$ is closed.

Next, we make $\Sigma$ into a one-dimensional cell complex (a multigraph) $G$ which has oriented edge starting at $i$ and ending at  $j$ if and only if $\{i,j\}\in \Sigma$.

Finally, we create a two-dimensional cell complex whose faces $\varphi\in F$ correspond one-to-one with the closed polygons: To each closed polygon $\gamma$ we assign the edge cycle in $G$ corresponding to $\gamma$.

So there are no edges in Houdini’s underlying combinatorial data structure, edges are derived quantities here. However, Houdini provides two convenient ways to access the resulting edge graph $\Sigma$: First, there is a node named “Convert Line” that provides a two-vertex open polygon for each edge of $\Sigma$. Second, there are two methods findEdge and globEdges on the Python class hou.geometry that provide access to $\Sigma$.

Besides this, there are of course many interactive tools that work with edges.

This entry was posted in Lecture. Bookmark the permalink.