Home | History | Annotate | Download | only in misc

Lines Matching refs:pt1

32 def calcCubicArcLength(pt1, pt2, pt3, pt4, tolerance=0.005):
34 return calcCubicArcLengthC(complex(*pt1), complex(*pt2), complex(*pt3), complex(*pt4), tolerance)
52 def calcCubicArcLengthC(pt1, pt2, pt3, pt4, tolerance=0.005):
55 return _calcCubicArcLengthCRecurse(mult, pt1, pt2, pt3, pt4)
72 def calcQuadraticArcLength(pt1, pt2, pt3):
74 pt1 and pt3 are the "anchor" points, pt2 is the "handle".
95 return calcQuadraticArcLengthC(complex(*pt1), complex(*pt2), complex(*pt3))
98 def calcQuadraticArcLengthC(pt1, pt2, pt3):
100 pt1 and pt3 are the "anchor" points, pt2 is the "handle"."""
104 d0 = pt2 - pt1
110 return abs(pt3-pt1)
114 return abs(pt3-pt1)
123 def approximateQuadraticArcLength(pt1, pt2, pt3):
126 return approximateQuadraticArcLengthC(complex(*pt1), complex(*pt2), complex(*pt3))
129 def approximateQuadraticArcLengthC(pt1, pt2, pt3):
141 v0 = abs(-0.492943519233745*pt1 + 0.430331482911935*pt2 + 0.0626120363218102*pt3)
142 v1 = abs(pt3-pt1)*0.4444444444444444
143 v2 = abs(-0.0626120363218102*pt1 - 0.430331482911935*pt2 + 0.492943519233745*pt3)
148 def calcQuadraticBounds(pt1, pt2, pt3):
150 pt1 and pt3 are the "anchor" points, pt2 is the "handle".
157 (ax, ay), (bx, by), (cx, cy) = calcQuadraticParameters(pt1, pt2, pt3)
165 points = [(ax*t*t + bx*t + cx, ay*t*t + by*t + cy) for t in roots if 0 <= t < 1] + [pt1, pt3]
169 def approximateCubicArcLength(pt1, pt2, pt3, pt4):
171 pt1 and pt4 are the "anchor" points, pt2 and pt3 are the "handles".
186 return approximateCubicArcLengthC(complex(*pt1), complex(*pt2), complex(*pt3), complex(*pt4))
189 def approximateCubicArcLengthC(pt1, pt2, pt3, pt4):
191 pt1 and pt4 are the "anchor" points, pt2 and pt3 are the "handles"."""
204 v0 = abs(pt2-pt1)*.15
205 v1 = abs(-0.558983582205757*pt1 + 0.325650248872424*pt2 + 0.208983582205757*pt3 + 0.024349751127576*pt4)
206 v2 = abs(pt4-pt1+pt3-pt2)*0.26666666666666666
207 v3 = abs(-0.024349751127576*pt1 - 0.208983582205757*pt2 - 0.325650248872424*pt3 + 0.558983582205757*pt4)
213 def calcCubicBounds(pt1, pt2, pt3, pt4):
215 pt1 and pt4 are the "anchor" points, pt2 and pt3 are the "handles".
224 (ax, ay), (bx, by), (cx, cy), (dx, dy) = calcCubicParameters(pt1, pt2, pt3, pt4)
234 points = [(ax*t*t*t + bx*t*t + cx * t + dx, ay*t*t*t + by*t*t + cy * t + dy) for t in roots] + [pt1, pt4]
238 def splitLine(pt1, pt2, where, isHorizontal):
239 """Split the line between pt1 and pt2 at position 'where', which
263 pt1x, pt1y = pt1
275 return [(pt1, pt2)]
279 return [(pt1, midPt), (midPt, pt2)]
281 return [(pt1, pt2)]
284 def splitQuadratic(pt1, pt2, pt3, where, isHorizontal):
285 """Split the quadratic curve between pt1, pt2 and pt3 at position 'where',
307 a, b, c = calcQuadraticParameters(pt1, pt2, pt3)
312 return [(pt1, pt2, pt3)]
316 def splitCubic(pt1, pt2, pt3, pt4, where, isHorizontal):
317 """Split the cubic curve between pt1, pt2, pt3 and pt4 at position 'where',
331 a, b, c, d = calcCubicParameters(pt1, pt2, pt3, pt4)
336 return [(pt1, pt2, pt3, pt4)]
340 def splitQuadraticAtT(pt1, pt2, pt3, *ts):
341 """Split the quadratic curve between pt1, pt2 and pt3 at one or more
352 a, b, c = calcQuadraticParameters(pt1, pt2, pt3)
356 def splitCubicAtT(pt1, pt2, pt3, pt4, *ts):
357 """Split the cubic curve between pt1, pt2, pt3 and pt4 at one or more
368 a, b, c, d = calcCubicParameters(pt1, pt2, pt3, pt4)
394 pt1, pt2, pt3 = calcQuadraticPoints((a1x, a1y), (b1x, b1y), (c1x, c1y))
395 segments.append((pt1, pt2, pt3))
427 pt1, pt2, pt3, pt4 = calcCubicPoints((a1x, a1y), (b1x, b1y), (c1x, c1y), (d1x, d1y))
428 segments.append((pt1, pt2, pt3, pt4))
550 def calcQuadraticParameters(pt1, pt2, pt3):
553 cx, cy = pt1
561 def calcCubicParameters(pt1, pt2, pt3, pt4):
565 dx, dy = pt1