MCPcopy
hub / github.com/fogleman/ln / Partition

Method Partition

ln/tree.go:112–126  ·  view source on GitHub ↗
(size int, axis Axis, point float64)

Source from the content-addressed store, hash-verified

110}
111
112func (node *Node) Partition(size int, axis Axis, point float64) (left, right []Shape) {
113 left = make([]Shape, 0, size)
114 right = make([]Shape, 0, size)
115 for _, shape := range node.Shapes {
116 box := shape.BoundingBox()
117 l, r := box.Partition(axis, point)
118 if l {
119 left = append(left, shape)
120 }
121 if r {
122 right = append(right, shape)
123 }
124 }
125 return
126}
127
128func (node *Node) Split(depth int) {
129 if len(node.Shapes) < 8 {

Callers 2

SplitMethod · 0.95
PartitionScoreMethod · 0.45

Calls 1

BoundingBoxMethod · 0.65

Tested by

no test coverage detected