New paper with Chris Yu & Henrik Schumacher: cs.cmu.edu/~kmcrane/Proje…

We model 2D & 3D curves while avoiding self-intersection—a natural requirement in graphics, simulation & visualization.

Our scheme also does an *amazingly* good job of unknotting highly-tangled curves!

[1/n]
[2/n] Here's a short movie that summarizes some of what we do:

And if you don't care *how* it works, here's the code!
github.com/icethrush/repu…

Otherwise, read on to find out more!
[3/n] A classic problem is deciding if a curve is an "unknot": can it be untangled into a circle, without passing through itself?

We don't solve this problem conclusively—but can use untangling as a stress test for our method

Typically, we can untangle crazy knots, crazy fast!
[4/n] Other descent methods and preconditioners get stuck, or take forever to converge—we tried a bunch of different schemes, ranging from classic baselines, to knot-specific algorithms (including Scharein's KnotPlot), to state-of-the-art methods from geometry processing:
[5/n] A fast optimization scheme lets you have a lot of fun with curves. For instance, we can "grow" a curve progressively longer to pack it into a volume:
[6/n] Especially useful if you need to 3D print ramen noodles into any packaging more interesting than a brick! @liningy
[7/n] Constraining curves to a surface yields Hilbert-like curves that are smooth and evenly-spaced:
[8/n] Repulsive curve networks (i.e., multiple curves meeting at the same point) let us play with biologically-inspired designs—would really love to bump up the number of muscle fibers here!
[9/n] Even simple 2D graph layout can benefit from repulsive curves. Rather than the usual "edge is a linear spring" model, each edge can bend around to optimize node placement:
[10/n] Optimizing edge geometry is a nice alternative to the layouts provided by packages like GraphViz, giving high information density while avoiding crossings (circled in red) and clearly indicating connections between nodes:
[11/n] Of course, not all graphs are planar (see Kuratowski's theorem! en.wikipedia.org/wiki/Kuratowsk…) but we can still produce really nice "repulsive" graph embeddings in 3D:
[12/n] Finally, here's a weird idea, to find 2D trajectories for vehicles that are as "far as possible from collision," optimize 3D curves in space + time:
[13/n] Ok, so, how does all of this work?

There is a lot to say here, but the main points are:

1. Simple vertex-vertex repulsion is a bit too simple.
2. Maximizing distance from the curve to itself is much harder than just avoiding local collisions.

Let me unpack that a bit...
[14/n] Naïvely, you might try an energy that goes to ∞ when two points x,y on the curve get close to each other. For instance, 1/|x-y|, where |x-y| is the distance between two points.

But if you try integrating over all pairs, it blows up! Which makes it numerically unstable.
[15/n] We instead consider the "tangent-point energy" of Buck & Orloff, which is little-known even in mathematics/curve & surface theory.

The basic idea is to penalize pairs that are close in space but distant along the curve. I.e., immediate neighbors "don't count."
[16/n] More precisely, for any two points x,y on a smooth curve γ let r(x,y) be the radius of the smallest sphere tangent to x and passing through y. Tangent-point energy is the double integral of 1/r(x,y)^α.

Small spheres matter (near-contact); big ones don't (just neighbors).
[17/n] The power α just controls how quickly the influence of the curve falls off, yielding somewhat different solutions for different α values. (See the paper for a more detailed discussion of which values can/should be used.)
[18/n] So, this is a pretty simple & slick energy, that doesn't need an ad-hoc definition of "close on the curve" vs. "close in space."

But, some problems:

1. It's expensive to evaluate/optimize, since it considers all pairs of points

2. It's easy to get stuck in local minima
[19/n] To deal with the O(n²) complexity we draw on a bunch of tricks & techniques from n-body literature: Barnes-Hut, hierarchical matrices, and a multi-resolution mesh hierarchy. Have to think a bit to incorporate tangent information—but get massive speedups in the end!
[20/n] The more interesting question is how to navigate the energy landscape. I.e., which direction(s) should we nudge the curve to reduce the energy as fast as possible?

Just doing ordinary (L2) gradient descent takes *forever*, and struggles to slide out of tricky situations.
[21/n] Instead of trying to bludgeon this problem with general-purpose, black-box optimization techniques, we take some queues from functional analysis and differential geometry.

Here we really need to think in terms of *smooth* curves, rather than "all pairs of vertices."
[22/n] The full-blown strategy gets quite technical—so instead I'll consider a much simpler problem:

Minimize the "wiggliness" of an ordinary function on the real line.

I.e., minimize the integral of its squared derivative (Dirichlet energy).
[23/n] A natural idea is to just do gradient descent: find the direction that reduces Dirichlet energy "fastest" and move a bit in that direction.

It's not too hard to show that this strategy is equivalent to heat flow: push the curve down where the 2nd derivative is big.
[24/n] At the beginning, heat flow does a great job of smoothing out small bumps and wrinkles.

But after this initial phase, it takes *forever* to smooth out bigger, lower-frequency oscillations.
[25/n] So, what can you do?

A critical observation is: to talk about the "fastest" descent direction, you must define a notion of size!

I.e., you must pick a norm (or inner product).

And: nobody requires you to use the standard L2 inner product.
[26/n] More precisely:

The *gradient* is the vector whose _inner product_ with any vector X gives the directional derivative along X.

So: a different inner product gives a different (sometimes "better") definition to the gradient.
[27/n] This perspective is one way of explaining Newton's method.

Rather than use the steepest direction in your usual coordinate system—which might zig-zag back and forth across a narrow valley—you switch to a coordinate system where the gradient points straight to the bottom.
[28/n] But Newton's method, famous as it is, is far from perfect:

- The Hessian is expensive to evaluate/invert.
- If it's not convex, you need heuristics to "convexify."
- It works great near minimizers, but not everywhere.
[29/n] A different starting point are so-called "Sobolev methods."

The ansatz is that gradient descent is a high-order partial differential equation (PDE), which requires *very* small time steps.

So, can we pick an inner product that yields a lower-order gradient descent PDE?
[30/n] Well, let's think again about Dirichlet energy.

The ordinary (L2) gradient flow PDE is 2nd-order in space: heat flow.

But if we use the 2nd-order Laplace operator to define our inner product ("H1") we get a 0th-order gradient equation—which is trivial to integrate!
[31/n] Rather than smoothing out only "little features", this H1 gradient flow smooths out "big features" at the same rate.

So, you can take super-big time steps toward the minimizer (which in this case is just a constant function).
[32/n] We could try going even further, and "remove" even more derivatives—for instance, by using the bi-Laplacian Δ² to precondition the gradient. But this would be a mistake: now gradient flow eliminates low frequencies quickly, but small details stick around for a long time.
[33/n] Here's a plot in a 2D slice of function space. L2 gradient flow quickly eliminates high frequencies, but not low frequencies. H2 kills low but not high frequencies. H1 is just right—at least for Dirichlet energy.

In general: match the inner product to your energy!
[34/n] Sobolev schemes have been used over the years for various problems in simulation and geometry processing.

For instance, the classic algorithm Pinkall & Polthier for minimizing surface area is a Sobolev scheme in disguise—see Brakke 1994 §16.10: facstaff.susqu.edu/brakke/evolver…
[35/n] Renka & Neuberger 1995 directly considers minimal surfaces and Sobolev gradients:
epubs.siam.org/doi/pdf/10.113…

Since the Laplace operator changes at every point (i.e., for every surface), you can also think of these schemes as gradient descent w.r.t. a Riemannian metric.
[36/n] Many other methods for surface flows adopt this "Sobolev" approach: pick an inner product of appropriate order to take (dramatically) larger steps, e.g.

2007: di.ens.fr/willow/pdfs/07…
2012: cs.utah.edu/docs/techrepor…
2013: cs.cmu.edu/~kmcrane/Proje…
2017: arxiv.org/abs/1703.06469
[37/n] Another nice example is preconditioning for mesh optimization.

For instance, Holst & Chen 2011 suggests H1 preconditioning to accelerate computation of optimal Delaunay triangulations: math.uci.edu/~chenlong/Pape…

(We use this scheme all the time—works great in practice!)
[38/n] In more recent years, Sobolev methods (esp. Laplacian/H1 preconditioning) has become popular for elastic energies for mesh parameterization/deformation:

2016: shaharkov.github.io/projects/Accel…
2017: people.csail.mit.edu/jsolomon/asset…
2018: cs.columbia.edu/~kaufman/BCQN/…

@JustinMSolomon @lipmanya
[39/n] What about tangent-point energy?

Unfortunately we can't just "plug and chug", since the differential of tangent-point energy has *fractional* order.

So, to eliminate all the derivatives, we likewise need to define & invert a *fractional* to inner product.
[40/n] This situation leads down a rabbit hole involving fractional Laplacians and kernel approximations…

A big challenge is that, unlike ordinary (integer-order) operators, the fractional Laplacian is not a local operator—hence we can't use standard computational tools…
[41/n] …But in the end things work out great: a fractional preconditioner works way better than even ordinary "integer" Sobolev preconditioners (H1 and H2) that have been used in past geometry processing methods—and can still be applied efficiently.
[42/n] This efficient fractional preconditioning doesn't merely let us avoid collisions—it enables us to navigate the global energy landscape, and untangle difficult knots way faster than any known method (including tried-and-true packages like KnotPlot).
[43/n] At the risk of re-writing the whole paper on Twitter, I'll just point back to the original source: cs.cmu.edu/~kmcrane/Proje…

Have fun—and hope you're not too repulsed! ;-)

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Keenan Crane

Keenan Crane Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @keenanisalive

2 Aug
Think knots are easy to untangle?

As a companion to our recent paper on "Repulsive Curves," we're releasing a dataset of hundreds of *extremely* difficult knots: cs.cmu.edu/~kmcrane/Proje…

In each case, a knotted & canonical embedding is given. Can you recover the right knot? 1/5
We've already tried a few dozen methods—from classics like "KnotPlot", to baselines like L-BFGS, to bleeding-edge algorithms like AQP, BCQN, etc.

For many knots, most these methods get "stuck," and don't reach a nice embedding.

Even our method doesn't hit 100%—but is close! 2/5
But this is a pretty unique problem relative to "standard" energies in geometry processing

For one thing, it considers all O(n²) pairs of points rather than just neighbors in a mesh

For another, you can't just *avoid* collisions—you have to maximize your distance from them. 3/5
Read 6 tweets
14 Jun
Uniform edge lengths are a reasonable proxy for mesh quality, since equilateral triangles have good angles. But if you have more specific criteria, you can usually do better. "Hodge-Optimized Triangulations" provides a nice discussion of this perspective: geometry.caltech.edu/pubs/MMdGD11.p…
A popular approach in graphics is something like Botsch & Kobbelt, "Remeshing for Multiresolution Modeling" (Sec. 4): graphics.rwth-aachen.de/media/papers/r…

Basic idea: iteratively move vertices to equalize areas, split long edges, collapse short edges, & flip edges to improve vertex valence.
In this class of algorithms, I really like Chen & Holst, "Efficient mesh optimization schemes based on Optimal Delaunay Triangulations": math.uci.edu/~chenlong/Pape…

Here there's a clear notion of optimality, & an efficient preconditioner. For surfaces: restrict to tangential motions
Read 12 tweets
25 May
Excited to share a new #SIGGRAPH2021 paper with @markgillesie81 and Boris Springborn that is a pretty big breakthrough in mesh parameterization: cs.cmu.edu/~kmcrane/Proje…

In short: no matter how awful your mesh is, we compute beautiful high-quality texture coordinates.

(1/n) Image
For instance, just as a stress test we can try to flatten this crazy #Thingi10k model as a single piece, rather than cutting it up into many charts. We still get excellent texture coordinates, with no flipped triangles, no angle distortion, and little scale distortion.

(2/n)
In general, the algorithm is guaranteed to produce maps that do not locally fold over and are perfectly conformal in a discrete sense, for absolutely any triangle mesh. It also gives globally 1-to-1 maps to the sphere, and handles any configuration of "cone singularities" (3/n) Image
Read 13 tweets
11 May
1/n This past weekend I gave two lectures @HarvardCMSA on “intrinsic triangulations” and how they can open new doors in geometric computing.

Videos here:



And details about the (terrific!) event here: cmsa.fas.harvard.edu/frg-2021/
2/n The story begins with the transition in the 19th century from thinking about geometry in terms of points in space (extrinsic) to thinking about the broader ways we can describe shapes without knowing how they’re embedded (intrinsic).
3/n Even though the intrinsic picture is now commonplace in mathematics, it’s still not how most people think about mesh processing. Almost universally we still describe the geometry of a mesh using Cartesian coordinates in a global coordinate system—just as we did in the 19th c.
Read 19 tweets
3 Jul 20
Excited to share new work w/ @nmwsharp on a Laplace operator that works great for both point clouds and arbitrary, nonmanifold triangle meshes—aimed at geometry processing & learning:

web: cs.cmu.edu/~kmcrane/Proje…
code: github.com/nmwsharp/nonma…
video: youtube.com/watch?v=JY0koz…
(1/n) Image
First of all, if you don't know what a Laplace operator is or why it's important (and are curious to find out!), I've recorded an intro lecture here with a bunch of animations and examples:

youtube.com/watch?v=oEq9RO…

(2/n)
Just like the Fast Fourier Transform (FFT) is the foundation of a lot of classical signal processing, the Laplacian is the foundation for a lot of modern algorithms in geometry processing and geometric learning:

cs.cmu.edu/~kmcrane/Proje…

(3/n) Image
Read 16 tweets
6 May 20
Very excited to share #SIGGRAPH2020 paper w/ @rohansawhney1 on "Monte Carlo Geometry Processing"

cs.cmu.edu/~kmcrane/Proje…

We reimagine geometric algorithms without mesh generation or linear solves. Basically "ray tracing for geometry"—and that analogy goes pretty deep (1/n)
Especially for problems with super complicated geometry, not having to mesh the domain provides a massive reduction in real world end-to-end cost. For instance, this model takes 14 hours to mesh and solve w/ FEM, but less than 1 minute to preview with Monte Carlo: (2/n)
As an added bonus, we can do geometry processing directly on nonmanifold meshes, implicit surfaces, instanced geometry, CSG, Bezier curves, NURBS surfaces, etc., without doing any tessellation, sampling, mesh booleans, etc. So how does this all work? Here's the story. (3/n)
Read 22 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(