Skip to content

Instantly share code, notes, and snippets.

@ClysmiC
Created August 17, 2018 22:29
Show Gist options
  • Save ClysmiC/1b6c3092fc757ac1b0ba3217c7b84f59 to your computer and use it in GitHub Desktop.
Save ClysmiC/1b6c3092fc757ac1b0ba3217c7b84f59 to your computer and use it in GitHub Desktop.
Quickhull comment ASCII art!
//
// |--- h ---| h = horizon
// /____ /____ x = current face (other face is prev face)
// \ |\ /| c = conflict
// \ x |<--/---\
// h2c \ | / |---- c2h (twin of prev h2c)
// _\\| /
// C
//
//
// Fix topological problems caused by merge.
// Namely, ensure every vertex in the face has >= 3 neighboring faces
// Omitting this step would lead to issues when the merge looks as follows:
//
// Case 1:
// /|\ / \ / \
// / | \ merge / \ fix / \
// (--x ) => a(--x ) => a( )
// \ | / \ | / \ /
// \|/ \|/ \ /
// b b
// Strategy 1: merge the faces and remove the "interior" edges (ax, xb, bx, xa). Replace them by the single "exterior" edge (ab)
// Note: We use this strategy when the "other" face is a triangle, since it only has 1 exterior edge that is simple to drop in w/o iteration
//
// OR
//
// Case 2: a a
// /|\ /|\ /|\
// / | \ merge / | \ fix / | \
// (--x ) => ( x )c => ( | )c
// \ | / \ | / \ | /
// \|/ \|/ \|/
// b b
// Strategy 2: combine edges ax and xb into ab and combine bx and xa into ba
// Note: We use this strategy when the "other" face has >3 edges, since replacing the 2 edges w/ 1 won't lead to a degenerate triangle like it would in the triangle case
//
// Note: We could always use a more complex version of Strategy 1 where we replace them by a chain of exterior edges (in Case 2, these would be bc and ca), but this would require yet another iteration of edges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment