Downloads: Source Code (Visual Studio 2008 SP1, C++) [Zip]


DragDropTool is a simple tool for combining meshes via an intuitive drag-and-drop interaction. It is primarily an implementation of the techniques described in the following publications:

Drag-and-Drop Surface Composition (2009) Ryan Schmidt, Karan Singh  Technical Report CSRG-604, Department of Computer Science, University of Toronto  [PDF] [Video]
Drag, Drop, and Clone: An Interactive Interface for Surface Composition (2010).  Ryan Schmidt, Karan Singh.
Technical Report CSRG-611, Department of Computer Science, University of Toronto [PDF] [Video]

You may also be interested in the following YouTube videos: [demo] [tutorial] [siggraph 2010 sketch]

DragDropTool includes the following capabilities:

  • Select a region of a mesh by multi-stroke surface lasso, laser lasso, triangle painting, and grow/shrink
  • erase parts of an existing mesh by filling with a smooth patch (including regions with interior holes)
  • drop mesh parts from a library onto the surface, drag them around, and bake them in
  • COILS and Rotation-Invariant Coordinate (RIC) versions of above capabilities
  • Laplacian smoothing and deformation
  • import OBJ format, export OBJ, STL, and Collada (DAE)
  • Other miscellaneous stuff (eg discrete natural conformal parameterization)

Here is a screenshot:

DragDropTool is built on top of the libgeometry library (included in the subdirectory libgeometry\) which is in turn built on top of WildMagic4 from GeometricTools. To build DragDropTool you will need to follow three steps:

  1. run libgeometry\WildMagic4\autobuild_vs2008_x64.bat (or autobuild_vs2008.bat if you have a 32-bit machine)
  2. open DragDropTool\DragDropTool.sln
  3. build and run

Note that some pre-compiled static libraries are included (for exmaple GLUT and GLUI). These are built for Visual Studio 2008 SP1 and are unlikely to work with other versions (but they might - who knows!).

Here is an incomplete list of controls, which you will need to know to use the software:

  • Camera Control uses Maya Keys (ALT+LMB: rotate, ALT+MMB: pan, ALT+RMB: zoom)
  • ESC cancels active operation
  • When nothing is selected, stroke starting on background across model does laser lasso
  • Stroke starting on mesh does multi-stroke surface lasso. You can draw multiple strokes from different viewpoints, the selection is not computed until you close the loop.
  • Once a selection is active, LMB adds triangles and RMB removes them from selection
  • With selection active, mouse wheel expands/contracts selection boundary
  • With selection, click Drag and Drop button or press 'c' to initiate cut-drag-drop pipeline (first does hole-fill, then part-drop)
  • In drop-part mode, LMB moves part, RMB rotates, SHIFT+RMB scales
  • With selection, click Erase to remove selected area and fill hole
  • Click Smooth or press 's' to initiate smoothing (when nothing selected, smooths entire mesh)
  • Press 'd' to initiate Laplacian deformation. Note: very slow. Right-click to drop handles, left-click to manipulate them. Make sure you place the handles before you start the deformation (otherwise they will show up in weird spots)
  • Press 'x' to delete selected faces
  • Click Convert To Part to turn current mesh (with open boundary) into a droppable part. If mesh has multiple boundaries, use left/right keys to select desired part join-boundary
  • 1/2 toggle flat/smooth shaded when nothing is selected, 7 shows multires base mesh (for part) if # of vertices in part is high enough, 8 toggles display of area distortion in part
  • Press 'F' to load a background mesh, press 'G' to clear background meshes (can't interact with them, useful for reference though)
  • press 'n' to smooth normals (rounds of normal smoothing can improve pasting quality on bumpy areas)
  • press 'N' to re-estimate mesh normals
  • press 'r' to repeat last selection (only works if mesh is unmodified)
  • press 'p' to compute discrete natural conformal parameterization of entire mesh (not used in tool, UVs are exported so this might be handy for other things) ((requires open boundary))

There are also options for each of the tools. You'll have to figure those out on your own...

Known Bugs

Too many to list. This is research software. It is not robust or efficient. Good luck!

If you are running inside the Visual Studio debugger and it is very slow, make sure you have set the environment variable _NO_DEBUG_HEAP=1 in the Environment field of the Debugging options in the CloneTool Configuration Properties (right-click on the CloneTool project in the Solution Explorer and select Properties at the bottom to get there). This will make an enormous difference.


This majority of this code is released under the Boost 1.0 License, so you can use it for any purpose, commercial or non-commercial. However, some of the code is taken from other sources and you will need to respect their individual licenses:

The subdirectory libgeometry\WildMagic4 is taken from the WildMagic library (version 4) developed and distributed by Dave Eberly at GeometricTools.com. WildMagic contains, quite simply, the best low-level math library ever, and you should use it for everything. It is similarly under the Boost 1.0 License.

The subdirectory libgeometry\external\eigen contains the Eigen 3 distribution, a C++ headers-only math library. Eigen may be used under the LGPL3 or GPL3 licenses (FAQ).

The subdirectory libgeometry\external\SparseMatrix contains pre-compiled libraries that themselves contain compiled versions of many other math libraries, including LAPACK, BLAS, TAUCS, METIS, UMFPACK, and more. Please see the GSI page for details.

The subdirectory DragDropTool\libgui\external contains files from PugiXML, by Arseny Kapoulkine. PugiXML is provided under the MIT license, so you can use it in anything but you have to provide some attribution (details).

The subdirectory DragDropTool contains pre-compiled static libraries for GLUT, by Mark Kilgard, and GLUI, by Paul Rademacher. GLUT is "not public domain but freely redistributable" (link) and GLUI is distributed under the LGPL.

The file libgeometry\mesh_processing\Triangulator2D.cpp contains the source code to the TRIANGLE software, copyright Jonathan Richard Shewchuk. This code may not be used in commercial products without permission from the copyright owner. Please contact him, not me.

If you want to reference TRIANGLE, here is a citation:

Jonathan Richard Shewchuk, Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator, in ``Applied Computational Geometry: Towards Geometric Engineering'' (Ming C. Lin and Dinesh Manocha, editors), volume 1148 of Lecture Notes in Computer Science, pages 203-222, Springer-Verlag, Berlin, May 1996. (From the First ACM Workshop on Applied Computational Geometry.) [PostScript] [HTML].



Back To
DCS Logo
DGP Logo