MCPcopy Index your code
hub / github.com/fogleman/ln / Intersect

Method Intersect

ln/csg.go:56–65  ·  view source on GitHub ↗
(r Ray)

Source from the content-addressed store, hash-verified

54}
55
56func (s *BooleanShape) Intersect(r Ray) Hit {
57 h1 := s.A.Intersect(r)
58 h2 := s.B.Intersect(r)
59 h := h1.Min(h2)
60 v := r.Position(h.T)
61 if !h.Ok() || s.Contains(v, 0) {
62 return h
63 }
64 return s.Intersect(Ray{r.Position(h.T + 0.01), r.Direction})
65}
66
67func (s *BooleanShape) Paths() Paths {
68 p := s.A.Paths()

Callers

nothing calls this directly

Calls 5

ContainsMethod · 0.95
PositionMethod · 0.80
OkMethod · 0.80
IntersectMethod · 0.65
MinMethod · 0.45

Tested by

no test coverage detected