CS 679 Project
A Surface Paster
Overview
For my project, I implemented a basic, domain space surface paster editor
(for the basic 75% of the project) and incorporated a (more or less functional)
b-spline surface editor and created a nice-looking model using the surface
editor and paster as extras.
B-Spline Editor (and GUI)
![](add.jpg) |
The New Surface dialog (to the left) adds a new surface to the
model. The dialog can be used to set the following properties:
-
Surface degree (in both the u and v directions)
-
Number of control points (in both the u and v directions)
-
Surface colour
OK creates the surface, CANCEL closes the dialog without
creating the surface.
After creating the surface, the program switch to edit mode and sets
the new surface for editing. |
![](app.jpg) |
The Surface Editor in Action.
This shows the basic operation of the surface editor.
Menus
-
File
-
New - create a new model (clears out current model)
-
Load - loads a new model (clears out current model)
-
Save - saves current model under current file name
-
Save As - saves the current model under a new file name
-
Quit - quites the program
-
Surface
-
Add Surface - opens New Surface dialog
-
Delete Surface - deletes all selected surfaces
-
Copy Surface - creates copies of selected surfaces
-
Paste - pastes surface onto model (from edit mode only)
-
Edit Domains - opens the Edit Domains dialog
-
Make C0 - makes current surface approximately C0
-
Make C1 - makes current surface approximately C1
-
Properties - edit surface colour of selected surface
|
-
View
-
Control Points - toggles display of control points for current selected
surface on and off
-
Greville Points - toggles display of greville points for current
selected surface on and off (in control point edit window only)
-
Hide - hides all selected surface (and deselectes them)
-
Unhide All - unhides all selected surfaces
-
Reset View - resets the view transformation
-
Edit
-
Align X/Y/Z/All - aligns control points by their x, y or z coordinates
(or all coordinates which sets them equal)
Control Point Window
-
Select control points with the left mouse button (in control point window),
hold shift to select multiple points
-
Dragging the mouse with the left button held down moves selected control
points in the xy-plane
-
Dragging the mouse with the right button held down increases or decreases
z-value of selected control points
-
The first point selected is displayed in pale green, subsequent ones in
purple
-
Points are aligned to the first selected control point
Knot Window
-
Knots can be moved by clicking and dragging a knot while holding the left
mouse button
-
New knots can be added by clicking the right mouse button on one of the
knot vectors
Main Window
-
In edit mode, displays the new surface, in paste mode, displays the model
-
Paste Mode
-
Clicking on a surface selects it, clicking again deselects it
-
Multiple surfaces can be selected
-
Control points are displayed (if enabled) for most recently selected surface
-
Most recently selected surface can be edited in the knot and control point
windows
-
Edit Mode
-
Displays surface to be added as a result of New Surface dialog
-
Click on mode indicator to switch back to paste mode without pasting surface
(looses new surface)
-
Choose Paste menu option to paste new surface onto model
-
holding and dragging left, middle or right mouse button rotates model/surface
around x, y or z axis respectively
-
holding shift while pressing and dragging left button translates model
in x-y direction
-
holding shift while pressing and dragging middle button translates model
in z direction
-
Sampling Resolution changes the sample resolution of current surface
(upon pressing the set button)
Surface Paster Editor
The paster editor is used to move and resize surface domains (and thus
edit the model)
![](domain.jpg) |
This shows the edit domain dialog (accessed through
the Edit Domains option in the surface menu).
-
domain window shows representation of the domains of the model relative
to the base surface
-
domains can be translated or scaled (the current mode is indicated by a
pair of radio buttons)
-
domains are scaled by clicking and dragging one of the corner points of
one of the domains
-
domains are translated by clicking inside the domain and dragging; the
topmost domain is selected
-
the model's base domain cannot be transformed
|
-
surface evaluation used by the pasting algorithm is the Mann-DeRose method
-
translations are applied hierarchically
-
scaling is applied just to the domain being scaled directly (no particular
reason why, just an arbitrary descision of mine)
-
pasting is supported through a directed acyclic graph structure
Models
The test model which was used to test the functionality
of the program (just a bunch of blobs).
(I became very fond of my blobs.) |
![](blobs.jpg) |
![](face.jpg) |
The "nice" model created (with much blood and sweat)
using the surface paster/b-spline surface editor. This is the face
of the puppet I created in CS 488. The face (the base of the model)
was created first and the other features were stuck on top of it.
For most features, the surface was edited to achieve the basic desired
shape and then extensively re-edited after being pasted and positioned
on the model. Some pieces were easier to do than expected (most of
the hair and the face), others were harder (ears and mouth). |
Various Notes
-
The control point window gets confusing quickly when editing surfaces with
lots of control points, especially if the surface is complex
-
programming DAG structures is annoying
-
I'm sure there are many inefficiencies in the code...
-
The control point window is rather tempermental under Windows (seems like
a bug in Windows though...)
-
creating the model wasn't the most intuitive thing in the world
-
the GUI could stand a lot of work yet
-
probably other things that I'm forgetting...
References
-
CS 679 Course Notes
-
Pasting Spline Surfaces, Cristin Barghiel, Richard Bartels, and
David Forsey, 1995
-
Better Pasting via Quasi-Interpolation, Blair Conrad and Stephen
Mann, 1999
-
World Space Surface Pasting, Leith Kin Yip Chan, Stephen Mann and
Richard Bartels
-
Feature Oriented Composition of B-Spline Surfaces, Cristin Barghiel,
Master's Thesis, University of Waterloo, 1995