All Projects → nmwsharp → variational-surface-cutting

nmwsharp / variational-surface-cutting

Licence: GPL-2.0 license
Codebase for "Variational Surface Cutting" by Sharp & Crane, SIGGRAPH 2018

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
CMake
9771 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to variational-surface-cutting

wkb-parser
Well-known binary (WKB) Parser.
Stars: ✭ 69 (+7.81%)
Mutual labels:  geometry
DynamicalBilliards.jl
An easy-to-use, modular, extendable and absurdly fast Julia package for dynamical billiards in two dimensions.
Stars: ✭ 97 (+51.56%)
Mutual labels:  geometry
Mathematics for Machine Learning
Learn mathematics behind machine learning and explore different mathematics in machine learning.
Stars: ✭ 28 (-56.25%)
Mutual labels:  geometry
tyssue
An epithelium simulation library
Stars: ✭ 50 (-21.87%)
Mutual labels:  geometry
elm-geometry-svg
Render 2D elm-geometry types as SVG
Stars: ✭ 40 (-37.5%)
Mutual labels:  geometry
GIBBON
The Geometry and Image-Based Bioengineering add-On for MATLAB
Stars: ✭ 132 (+106.25%)
Mutual labels:  geometry
Geometry-Solving
This is an open source project to share algorithms for solving the geometry games Pythagorea, Pythagorea 60, Euclidea 3 and Xsection
Stars: ✭ 17 (-73.44%)
Mutual labels:  geometry
EsriRESTScraper
A Python class that scrapes ESRI Rest Endpoints and exports data to a geodatabase
Stars: ✭ 43 (-32.81%)
Mutual labels:  geometry
Unity3D-Coding-Examples
Various case-studies in Unity3D
Stars: ✭ 91 (+42.19%)
Mutual labels:  geometry
vec
Vector graphics software to generate HPGL output to drive a plotter
Stars: ✭ 19 (-70.31%)
Mutual labels:  geometry
envelope ex
Utilities for calculating and comparing envelopes from geometries
Stars: ✭ 15 (-76.56%)
Mutual labels:  geometry
vexed-generation
Polymorphic helper functions & geometry ops for Houdini VEX / OpenCL
Stars: ✭ 32 (-50%)
Mutual labels:  geometry
PointProjector
A simple Cinema 4D plugin that non-destructively projects the points of a spline or polygon object on geometry.
Stars: ✭ 20 (-68.75%)
Mutual labels:  geometry
osm-static-maps
Openstreetmap static maps is a nodejs lib, CLI and server open source inspired on google static map service
Stars: ✭ 130 (+103.13%)
Mutual labels:  geometry
classy blocks
Python classes for easier creation of OpenFOAM's blockMesh dictionaries.
Stars: ✭ 53 (-17.19%)
Mutual labels:  geometry
source-engine-model-loader
Three.js loader for parsing Valve's Source Engine models
Stars: ✭ 54 (-15.62%)
Mutual labels:  geometry
geos-cli
A native geometry command line library using libgeos.
Stars: ✭ 20 (-68.75%)
Mutual labels:  geometry
martinez-src
Mirrored implementations of polygon clipping/CSG/operations algorithm, in C (original, by Martínez et al) and ActionScript3 (port, by Mahir Iqbal)
Stars: ✭ 34 (-46.87%)
Mutual labels:  geometry
batyr
Microservice for on-demand synchronization of geographical vector datasources to a PostgreSQL/PostGIS database. The service provides an HTTP API for easy integration into other applications.
Stars: ✭ 25 (-60.94%)
Mutual labels:  geometry
topo
A Geometry library for Elixir that calculates spatial relationships between two geometries
Stars: ✭ 125 (+95.31%)
Mutual labels:  geometry

Variational Surface Cutting

Tennis Balls

This is the codebase associated with "Variational Surface Cutting" by Nicholas Sharp and Keenan Crane (SIGGRAPH 2018). Our method develops a new, variational approach to generating cuts on curved surfaces such that they can be flattened in to the plane with little distortion. The resulting cuts are smooth, and particularly suitable for applications in fabrication.

Warning: This codebase is essentially a dump of research code, and is not polished, trustworthy, or even user-friendly! If you are looking to leverage this code in a project, or generate comparisons, feel free to contact the authors.

If this code contributes to a project, please cite the paper:

@article{sharp2018variational,
  title={Variational surface cutting},
  author={Sharp, Nicholas and Crane, Keenan},
  journal={ACM Transactions on Graphics (TOG)},
  volume={37},
  number={4},
  pages={156},
  year={2018},
  publisher={ACM}
}

The Variational Surface Cutting algorithm actually only generates the cuts in the surface, it does not parameterize the surface (aka generate UV coordinates). However, for convenience, this software also generates parameterizations using the excellent Boundary First Flattening algorithm by Sawhney & Crane. If you utilize the parameterizations generated by this software, that work should also be cited.

Building

To checkout and compile on a *nix machine, run:

git clone https://github.com/nmwsharp/variational-surface-cutting.git
cd variational-surface-cutting/ && git submodule update --init --recursive
mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j4

A few notes:

  • Empty directories for the dependencies? You forgot the submodules! See above.
  • The BUILD_TYPE=Release flag turns on optimizations in the resulting makefile. Use BUILD_TYPE=Debug for debugging options.
  • We use SuiteSparse for sparse linear solves. You should be able install SuiteSparse via your package manager.

On Ubuntu, you may need to install some common C++/openGL development packages first (as well as Suitesparse). This command gets most of the typical ones (but may not be exactly correct for your machine).

apt-get install build-essential cmake xorg-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev libsuitesparse-dev

Running

Building generates the executable build/bin/cuts, which accepts a mesh in OBJ format as input. We've included an example mesh in the repo, so you can test the codebase with:

./bin/cuts ../data/spot.obj

This should pop up a GUI for the application. Selecting Toolbox --> Variational Cuts will summon the UI for this project.

Tips

Generally speaking, this is a research code dump, so you'll need to explore a bit to find your way around. This UI does a lot of things, some of which go beyond what was presented in the paper. As usual, the source code itself is littered with fragments from experiments.

A basic workflow to generate cuts on the sample input would look like:

  1. Run the GUI with ./bin/cuts ../data/spot.obj
  2. Open the UI [Tool Chest --> Variational Cuts]
  3. Initialize cuts with normal clustering [Initialize --> Normal Clustering] (this is not required, but a decent initialization can speed up convergence)
  4. Set the weight of the Hencky energy term to 3.0 [Cuts Parameters --> Hencky Distortion --> Weight]
  5. Set the #steps to 300 [Cuts Control --> # steps]
  6. Run the algorithm for the specified number of steps [Cuts Control --> Take Many Steps]
  7. Visualize the resulting cuts [Cuts Control --> Show boundary, Cuts Control --> Show Extra Cuts]
  8. Visualize the resulting parameterization [Cuts Control --> Visualization --> Cut Mesh Param]
  9. Export the resulting cut & parameterized mesh [Cuts Control --> Save --> Save .obj with injective texcoords]

Note that these cuts won't look very smooth like some of the results in the paper, because the sample mesh is quite coarse in order to keep the repository size small.

Some more miscellaneous tips:

  • The Hencky energy is probably your best bet for most applications. I suggest always starting there, with a weight of around 3.0.
    • The Dirichlet Energy tends to create extremely fine cuts in highly curved regions. Although this is optimal in the sense of that energy, it might not be desirable for some purposes.
    • The Rescaled Dirichlet Energy attempts to mitigate this behavior by rescaling according to curvature, but Hencky is still often intuitively preferable (and has mechanical meaning!).
  • Don't turn off the length term, it's important! When the length term is strong relative to other terms, you will get longer, lower distortion cuts. When it is weak, you will get shorter cuts.
  • The energy terms are all scaled to be dimensionless, so you should be able to use the same weights whether your mesh has positions measured in milimeters or kilometers. However, between the different energy weight parameters, some do need significantly different values to get an effect. You might need to play around with weight values on the order of 10^0 - 10^3 to achieve a desired result.
  • We represent the solution implicitly on your input mesh; this means that the mesh but be sufficiently high-resolution to represent the cuts. For this reason, you may need to refine highly-curved but coarsely-tessellated inputs. If your mesh is too coarse to reprsent the solution requested by your choice of parameters, you will see numerical noise that looks like random cuts in highly curved regions.
  • The Save menu option allows exporting to various formats.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].