MCPcopy
hub / github.com/tdewolff/canvas / SplitAt

Method SplitAt

path_intersection.go:318–331  ·  view source on GitHub ↗
(z Point)

Source from the content-addressed store, hash-verified

316}
317
318func (s *SweepPoint) SplitAt(z Point) (*SweepPoint, *SweepPoint) {
319 // split segment at point
320 r := boPointPool.Get().(*SweepPoint)
321 l := boPointPool.Get().(*SweepPoint)
322 *r, *l = *s.other, *s
323 r.Point, l.Point = z, z
324 r.end, l.end = false, false
325
326 // update references
327 r.other, s.other.other = s, l
328 l.other, s.other = s.other, r
329 l.node = nil
330 return r, l
331}
332
333func (s *SweepPoint) Reverse() {
334 s.left, s.other.left = !s.left, s.left

Callers 3

breakupSegmentMethod · 0.95
bentleyOttmannFunction · 0.95
splitAtIntersectionsFunction · 0.45

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected