CS779 Final Project - T-splines
Winter 2018 - Michael Ahn
Overview
This project is a basic implementation of T-spline surfaces, introduced by Sederberg et al. [1]. T-splines are non-uniform B-spline surfaces that allow T-junctions. This enables the artist to add and remove control points without adding/removing entire rows/columns of control points. To accomplish this, T-splines use a T-mesh to infer the knot vectors passed to basis function for each control point.The program implements the following features:
- (Base) Cubic T-splines
- (Base) Control point insertion
- (Base) Tesselation
- (Extra) Control point deletion
- (Extra) T-spline GUI editor
Implementation
- This project implements T-meshes as a graph with two distinct vertex types: points and edges. A point vertex represents a control point and an edge vertex represents a connection between two control points. Point vertices are neighbours to at most 4 edge vertices and edge vertices are neighbours with exactly 2 point vertices. Each point knows its own knot-space coordinate. By using a simple bucketing scheme to group the perpendicular edge vertices for each knot value, each point is able determine its local knot vectors with reasonable efficiency.
- To tesselate the T-spline, Sederberg et al. [1] suggests using knot insertion to extract Bezier patches. This project implements a simpler tesselation scheme where we directly evaluate the T-spline over the evaluatable knot domain. This obtains a grid of points on the T-spline surface which can be easily indexed to form triangles.
Features
![](./images/tspline-step-1.png)
- Initially, the user is presented with a grid of control points with positions and knots uniformly spaced. All weights are unity. The camera is controlled by right-click-dragging the screen to rotate and scrolling the mouse wheel to zoom.
- The user can select control points by left clicking. Additional points can be added to the current selection by holding Shift and left clicking. Selected points are highlighted in yellow.
- To insert a new control point, the user may hold Control and left click on an edge. This creates a new control point with an interpolated knot value based on where the user clicked on the edge. By holding Control and Shift, the user can left click on an adjacent parallel edge to create additional control points that are connected to the previous.
- Note that adding control points this way changes the shape of the surface. Sederberg et al. [2] focuses on local knot insertion where the designer operates in knot-space and control points are added/moved in Cartesian-space such that the shape of the surface is preserved. Due to time constraints, this program solely presents a Cartesian-space view of the T-spline and implements simple control point insertion without any shape corrections.
![](./images/tspline-step-2.png)
- While control points are selected, the user can translate the control points using the (W, A, S, D, Q, E) keys.
![](./images/tspline-step-3.png)
- Control points can be deleted by selecting control points and pressing the Backspace key.
![](./images/tspline-step-4.png)
- The menu panel can be used to control display settings. For example, the tesselation wireframe can be enabled.
![](./images/tspline-tess.png)
Examples
Cat Hat
![](./images/tspline1.png)
![](./images/tspline1a.png)
Disappointment
![](./images/tspline2.png)
![](./images/tspline2a.png)
Future Work
- A major limitation of the program at the time of writing is that it does not present the user with a knot-space view of the T-mesh. This is a necessary part of the UI to allow the user to change the knot values and perform local knot insertion that preserves the surface shape.
- Another limitation of the program is that it currently makes use of only one thread. For small T-spline meshes, evaluation and tesselation can currently be done at interactive speeds with the help of vectorization. However, determining the knot vectors for each control point and evaluating the surface at a knot coordinate can be easily parallelized by multithreading the loop over control points/knot coordinates. Additional work can be done to port these operations to CUDA or OpenCL code.
- The T-spline implementation is written with C++ templates such that it can handle T-splines of arbitrary degree greater than 1. Currently this is only instantiated for degree 3, but degree 2 or 4+ T-splines can be explored. Even-degree T-splines introduce some irregularity in that there is no 'centered' knot coordinate within the knot vectors for each control point.
Learning Outcomes
- Implementation logic of T-spline surfaces
- Working with dynamic graph structures in C++
- Designing a basic 3D model editor from scratch (e.g. rendering pipeline, camera, point/edge selection)
References
- "T-splines and T-nurccs" (2003) Sederberg et al.
- "T-spline simplification and local refinement" (2004) Sederberg et al.