(size int, axis Axis, point float64)
| 110 | } |
| 111 | |
| 112 | func (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 | |
| 128 | func (node *Node) Split(depth int) { |
| 129 | if len(node.Shapes) < 8 { |
no test coverage detected