Esempio n. 1
0
def makecurve(pt1, pt2, c1, c2):
    p = Path()
    p.moveto(pt1.x, pt1.y)
    p.curveto(c1.x, c1.y, c2.x, c2.y, pt2.x, pt2.y)
    p.fill = None
    p.stroke = Color.BLACK
    p.strokeWidth = 1.0
    return p
Esempio n. 2
0
def quad_curve(pt1, pt2, t, distance):
    t /= 100.0
    cx = pt1.x + t * (pt2.x - pt1.x)
    cy = pt1.y + t * (pt2.y - pt1.y)
    a = angle(pt1.x, pt1.y, pt2.x, pt2.y) + 90
    qx, qy = coordinates(cx, cy, distance, a)

    p = Path()
    p.moveto(pt1.x, pt1.y)
    c1x = pt1.x + 2 / 3.0 * (qx - pt1.x)
    c1y = pt1.y + 2 / 3.0 * (qy - pt1.y)
    c2x = pt2.x + 2 / 3.0 * (qx - pt2.x)
    c2y = pt2.y + 2 / 3.0 * (qy - pt2.y)
    p.curveto(c1x, c1y, c2x, c2y, pt2.x, pt2.y)
    p.fill = None
    p.stroke = Color.BLACK
    p.strokeWidth = 1.0
    return p
Esempio n. 3
0
def quad_curve(pt1, pt2, t, distance):
    t /= 100.0
    cx = pt1.x + t * (pt2.x - pt1.x)
    cy = pt1.y + t * (pt2.y - pt1.y)
    a = angle(pt1.x, pt1.y, pt2.x, pt2.y) + 90
    qx, qy = coordinates(cx, cy, distance, a)

    p = Path()
    p.moveto(pt1.x, pt1.y)
    c1x = pt1.x + 2/3.0 * (qx - pt1.x)
    c1y = pt1.y + 2/3.0 * (qy - pt1.y)
    c2x = pt2.x + 2/3.0 * (qx - pt2.x)
    c2y = pt2.y + 2/3.0 * (qy - pt2.y)
    p.curveto(c1x, c1y, c2x, c2y, pt2.x, pt2.y)
    p.fill = None
    p.stroke = Color.BLACK
    p.strokeWidth = 1.0
    return p