Parent: MorphoOptimizationProject_BetterSerialCode

Defects are a local region of edges and faces that require additional edges and faces to repair.

The code that adds these includes the apparently difficult task of adding an edge whose projection onto the surface of the sphere does not add any intersections with existing edges. The previous general purpose code does this by doing an extensive and expensive test against other existing edges, involving dot and cross products.

The new code speeds this code up in three ways, but they all exploit a geometrical property. When you project a straight line within the sphere onto the surface of the sphere, it creates a portion of a great circle, which I refer to here as a "great arc". A set of such edges project onto a set of great arcs. The code is determining whether two of these great acs intersect.