Freeform Deformation

Winter 2013
Matt Pharoah





Overview

My project implements freeform deformation with cubic B-spline patches. Evaluation is performed using the de Boor algorithm. I used cubic B-splines with full knot multiplicity at the edges so that the B-Spline is defined over the entire lattice.

In addition to freeform deformation using the lattice of control points, I also implemented direct manipulation.


Core Project Objectives

(More detailed discussion on interesting objectives farther down)


Extra Objectives




Discussion

Knot Multiplicity

Since I am using a cubic B-spline with full knot multiplicity at the edges, I need to invert the transformation for the initial lattice for points near the edges of the lattice. I used Maple to expand and simplify the transformation, then solved the resulting cubic equations for spline segments including knots with multiplicity higher than 1. For every point in the lattice, there is one real solution, and it can be solved exactly.

Normals

My initial idea for computing the normals of deformed surfaces was to perform a change of basis to store the vertex normals with respect to the polygon's normal computed using the cross product, then reverting the basis after the transformation. This didn't work very well because the polygon shape is irrelevant to the normal at one particular vertex: the way the model is deformed at one edge of a triangle may be very different from how it is deformed at another vertex.

I then realized that a much better approach would be to approximate the deformation at each vertex as an affine transformation. (Actually, just a linear combination since translation doesn't affect normals) To do this, I take 3 points very close to the vertex- each one being epsilon units along one axis. I then deform these points (and the original vertex) and define the linear transformation by the positions of the deformed points relative to the deformed vertex. I can then take the inverse transpose of this linear transformation to get the normal transformation. It ended up working very well, giving good results in most cases, keeping sharp edges sharp and smooth curves smooth.

Advanced Direct Manipulation

There are many free parameters involved in direct manipulation. To give more control over how the surface is deformed, I added "brush attributes" to the direct manipulation tool. The size of the brush determines how many control points should be changed, and the brush pressure determines how much the control points should move relative to each other.

To solve the direct manipulation with these constraints, I simply multiply the blending functions at each control point by a value determined by its distance from the control point that most affects the point on the curve being manipulated and the brush pressure attribute. I then solve for that control point's new position, and all other control points within the brush size are moved by some multiple of this change, again determined by the pressure attribute and the control point's distance from the control point with the greatest effect on the surface point.

Screenshots


The twist tool in action




The bend tool




And shear as well




The translation tool with the pull option creating a smooth deformation (Transparency feature used here to see the control point lattice better)




The effect of different brush sizes for direct manipulation




Transformations can be combined together




They can be done at low quality for a more responsive program...




...then the quality can be increased afterwards




A transformation being applied to a cube




And the same transformation applied to a sphere



Room for Improvement

Some features that I didn't get around to implementing:



Bugs



Controls

Left click selects and moves control points.
Middle click and drag rotates the camera, and the scroll wheel zooms in and out
Right click and drag pans the camera

Acknowledgements

A Gestural Interface to Free-Form Deformation, Geoffrey M. Draper and Parris Egbert, in Graphics Interface 2003, 2003, pages 113--120.
Direct Manipulation of Free-Form Deformations (Hsu, 1992)
Thomas Sederberg and Scott Parry. "Free-Form Deformation of Solid Geometric Models": SIGGRAPH '86
wxWidgets

Source Code

Source code is available here. The checkDependencies.sh shell script checks to see if you have the required dependencies installed and up to date, and gives you the apt-get line to get them if you don't (for Debian based operating systems).