Cleave SOP

by Stuart Ramsden, ANUSF Vizlab

Latest info

Newer versions of the pre-compiled Cleave SOP are now available with Drew Whitehouse's Houdini Ocean Toolkit (HOT) He is keeping this package up to date with the latest versions of Houdini, for a variety of platforms, and the Cleave SOP is going along for the ride.

Since this SOP was written, Houdini has progressed in leaps and bounds on the customisation front with Vex, OTLs and the bundling of the HDK with the standard release. Perhaps it will one day be possible to do something similar directly in Vex. I'm still planning to do a 3D version, especially now that Houdini has DOPs. I'm curious to know what others do with it too, so if you use the Cleave SOP for any interesting projects please tell me about them. Enjoy;-)

What is it?
The Cleave SOP is a custom Surface OPerator for the Side Effects 3D package Houdini. It is useful for generating both regular and randomized subdivisions of any polygonal input. It recursively cleaves polygons into sub-polygons, each time cleaving through the polygon center. If polygons are split into two pieces each time, the result is a tessellation similar to a Binary Space Partition (BSP) tree. Higher values for 'split' than 2 result in pie-slice cleaving into N pieces at each recursive step.

Installation
Select the binary you need, based on Houdini version and platform:

cd to your personal $HOME/houdiniX.x dir and extract the contents of the *.tar.gz file.

It should unpack the files
dso/SOP_Cleave.so (or dso/SOP_Cleave.dll)
config/Icons/SOP_cleave.icon

Restart houdini, and you're away

Overview of Parameters:
  • Frequency: Number of recursive subdivisions
  • Initial Rotation: Angle of first cleave
  • Cummulative Rotation: Angle added to each recursive subdivision
  • Random Rotation: Maximum angle perturbation added to each recursive subdivision
  • Seed: Seed for Randomness
  • Splits: Number of polygons to cleave into at each subdivision step - 2 gives a Binary Space Partition (BSP), higher values cleave into N pie slices. High values for both Frequency and Splits will result in many polygons - in fact (Splits) to the power (Frequency) polys for each input poly
  • Use Random Splits: choose a split value randomly between 2 and 'Splits' for each subdivision
  • Channel Width: Thickness of channel to remove in subdivision
  • Channel Scale: Amount to fractally decrease the channel width for successive subdivisions.
  • Subdiv Threshold: Set the size limit (area) of polygons, below which no subdivision will occur. Recursive subdivision can create polygons of very different sizes. By limiting subdivision for the smallest polys, a more even tessellation To best test this, start with a higher frequency of subdivisions than you want and gradually increase, this threshold. The smallest polys should start to consolidate, until the result is more homogeneous.

About the Algorithm:
The Cleave SOP uses rest positions and clips to do its work.
It does the following:

As the subdivision process repeats, the number of polygons proliferate geometrically. In the end, you have a whole lot of polygon fragments clustered around the origin. You then re-instate the point rest positions (which have been nicely linearly interpolated by the clip on new points) and recover the original shape of the object.

Limitations
The Cleave SOP only works on polygons (as the Clip SOP does). This is means that it treats polygons as the largest unit. If you have a nice polygonal vase, you couldn't cleave it into a few pieces of vase - each polygon is cleaved individually.

It cleaves by recursion, so there is always a very obvious first cut. It would be nice to have other subdivision algorithms, like Voronoi tesselation, to make this first cut less obvious.

Points inserted into a boundary, are only inserted on a single side. There is no complete topological connectivity for the final geometry; even with point consolidation, neighbouring polys don't necessarily share points on their apparent common boundaries.

Future
The single-polygon unit limation might be solvable with auto-created and managed groups of polygons, which have their own centroid and are cleaved as a whole. I intend to look into this. Other potential enhancements include irregular 2D cuts (with the Cookie, instead of the Clip), and 3D subdivisions.

Source Code
The code is written in conservative C++ with calls to Houdini's HDK custom SOP interface. I make no claims as to the efficency or elegance of the code - in fact, if anyone has optimization tips, by all means let me know. This was my first SOP and I was working pretty much in the dark, apart from invaluable help from the coders at Side Effects when I became stuck. C++ is not my favourite language, and I'm always much happier coding in Python.

The source code for the Cleave SOP is made available under the GPL. Compilation requires the Side Effects HDK (Houdini Toolkit)

cleave_src.tar.gz source code package

which unpacks to:
cleave/README.txt
cleave/SOP_Cleave.C
cleave/SOP_Cleave.h
cleave/SOP_cleave.icon

Acknowledgements
Thanks to Drew Whitehouse for help with C++ and many helpful conversations. Thanks also to Mark Elendt and Cristin Barghiel of Side Effects for their kind assistance with HDK interface issues.

Contact:
Stuart.Ramsden@anu.edu.au
Vizlab, ANU Supercomputer Facility,
Australian National University,
Canberra, ACT, Australia


Stuart Ramsden
Last modified: Fri Feb 24 12:02:34 AUS Eastern Daylight Time 2006