SOLVED RContour.insertPoint() on curve?

  • Hey,
    Is there any example of the usage of RContour.insertPoint() on the curves? (I cannot find any)

    When I'm trying to do that myself, it creates strange bezier curves (I don't know if these are quadratic) with only one BCP.

  • admin

    thanks for your example!!

  • Here is my solution for everyone, who is interested in the problem.
    I hope that this example is proper

    g = CurrentGlyph()
    # drawing the shape with the pen
    pen = g.getPen()
    pen.moveTo((396, 371))
    pen.curveTo((396, 508), (146, 510), (146, 371))
    cA = g.contours[0].points[3]
    hA = g.contours[0].points[2]
    hB = g.contours[0].points[1]
    # coordinates of the points after inserting the new point
    h1,h2,nc,h3,h4 = (
    # inserting the oncurve point
    # adjusting the handlas before the inserted oncurve point
    hA.x = h2[0]
    hA.y = h2[1]
    hB.x = h1[0]
    hB.y = h1[1]
    # inserting handles after the inserted oncurve point

  • ok, Thanks @frederik!
    I figured it out!

  • admin

    you also need to insert the off curves next to the oncurve...

    (traveling no example...)