MCPcopy Index your code
hub / github.com/tdewolff/canvas / LessH

Method LessH

path_intersection.go:997–1009  ·  view source on GitHub ↗

func (s *SweepStatus) Clear() { n := s.First() for n != nil { cur := n n = n.Next() s.returnNode(cur) } s.root = nil }

(b *SweepPoint)

Source from the content-addressed store, hash-verified

995//}
996
997func (a *SweepPoint) LessH(b *SweepPoint) bool {
998 // used for sweep queue
999 if a.X != b.X {
1000 return a.X < b.X // sort left to right
1001 } else if a.Y != b.Y {
1002 return a.Y < b.Y // then bottom to top
1003 } else if a.left != b.left {
1004 return b.left // handle right-endpoints before left-endpoints
1005 } else if a.compareTangentsV(b) < 0 {
1006 return true // sort upwards, this ensures CCW orientation order of result
1007 }
1008 return false
1009}
1010
1011func (a *SweepPoint) CompareH(b *SweepPoint) int {
1012 // used for nodes in tolerance square so that a.X==b.X and a.Y==b.Y

Callers 2

LessMethod · 0.80
TestBentleyOttmannSortHFunction · 0.80

Calls 1

compareTangentsVMethod · 0.95

Tested by 1

TestBentleyOttmannSortHFunction · 0.64