(axis Axis, point float64)
| 91 | } |
| 92 | |
| 93 | func (node *Node) PartitionScore(axis Axis, point float64) int { |
| 94 | left, right := 0, 0 |
| 95 | for _, shape := range node.Shapes { |
| 96 | box := shape.BoundingBox() |
| 97 | l, r := box.Partition(axis, point) |
| 98 | if l { |
| 99 | left++ |
| 100 | } |
| 101 | if r { |
| 102 | right++ |
| 103 | } |
| 104 | } |
| 105 | if left >= right { |
| 106 | return left |
| 107 | } else { |
| 108 | return right |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | func (node *Node) Partition(size int, axis Axis, point float64) (left, right []Shape) { |
| 113 | left = make([]Shape, 0, size) |
no test coverage detected