(f Filter)
| 47 | } |
| 48 | |
| 49 | func (p Path) Filter(f Filter) Paths { |
| 50 | var result Paths |
| 51 | var path Path |
| 52 | for _, v := range p { |
| 53 | v, ok := f.Filter(v) |
| 54 | // ok = ok || i%8 < 4 // show hidden lines |
| 55 | if ok { |
| 56 | path = append(path, v) |
| 57 | } else { |
| 58 | if len(path) > 1 { |
| 59 | result = append(result, path) |
| 60 | } |
| 61 | path = nil |
| 62 | } |
| 63 | } |
| 64 | if len(path) > 1 { |
| 65 | result = append(result, path) |
| 66 | } |
| 67 | return result |
| 68 | } |
| 69 | |
| 70 | func (p Path) Simplify(threshold float64) Path { |
| 71 | if len(p) < 3 { |