MCPcopy
hub / github.com/fogleman/ln / Contains

Method Contains

ln/csg.go:45–54  ·  view source on GitHub ↗
(v Vector, f float64)

Source from the content-addressed store, hash-verified

43}
44
45func (s *BooleanShape) Contains(v Vector, f float64) bool {
46 f = 1e-3
47 switch s.Op {
48 case Intersection:
49 return s.A.Contains(v, f) && s.B.Contains(v, f)
50 case Difference:
51 return s.A.Contains(v, f) && !s.B.Contains(v, -f)
52 }
53 return false
54}
55
56func (s *BooleanShape) Intersect(r Ray) Hit {
57 h1 := s.A.Intersect(r)

Callers 2

IntersectMethod · 0.95
FilterMethod · 0.95

Calls 1

ContainsMethod · 0.65

Tested by

no test coverage detected