MCPcopy
hub / github.com/golang/geo / LoopFromCell

Function LoopFromCell

s2/loop.go:92–105  ·  view source on GitHub ↗

LoopFromCell constructs a loop corresponding to the given cell. Note that the loop and cell *do not* contain exactly the same set of points, because Loop and Cell have slightly different definitions of point containment. For example, a Cell vertex is contained by all four neighboring Cells, but it

(c Cell)

Source from the content-addressed store, hash-verified

90// loop contains points on its boundary that actually belong to other cells
91// (i.e., the covering will include a layer of neighboring cells).
92func LoopFromCell(c Cell) *Loop {
93 l := &Loop{
94 vertices: []Point{
95 c.Vertex(0),
96 c.Vertex(1),
97 c.Vertex(2),
98 c.Vertex(3),
99 },
100 index: NewShapeIndex(),
101 }
102
103 l.initOriginAndBound()
104 return l
105}
106
107// These two points are used for the special Empty and Full loops.
108var (

Callers 3

PolygonFromCellFunction · 0.85
TestLoopFromCellFunction · 0.85

Calls 3

initOriginAndBoundMethod · 0.95
NewShapeIndexFunction · 0.85
VertexMethod · 0.45

Tested by 2

TestLoopFromCellFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…