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

Method add

path_intersection_util.go:147–160  ·  view source on GitHub ↗
(pos Point, ta, tb, dira, dirb float64, tangent, same bool)

Source from the content-addressed store, hash-verified

145}
146
147func (zs Intersections) add(pos Point, ta, tb, dira, dirb float64, tangent, same bool) Intersections {
148 // normalise T values between [0,1]
149 if ta < 0.0 {
150 ta = 0.0
151 } else if 1.0 <= ta {
152 ta = 1.0
153 }
154 if tb < 0.0 {
155 tb = 0.0
156 } else if 1.0 < tb {
157 tb = 1.0
158 }
159 return append(zs, Intersection{pos, [2]float64{ta, tb}, [2]float64{dira, dirb}, tangent, same})
160}
161
162func correctIntersection(z, aMin, aMax, bMin, bMax Point) Point {
163 if z.X < aMin.X {

Callers 5

intersectionLineLineFunction · 0.80
intersectionLineQuadFunction · 0.80
intersectionLineCubeFunction · 0.80
addLineArcIntersectionFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected