示例#1
0
def interpolate_length(lengths, secs, interp):
    points = []

    for station in range(0, len(lengths)):
        points.append(FreeCAD.Vector(secs[station], lengths[station], 0))

    BSpline = Part.BSplineCurve(points)
    wire = DraftGeomUtils.curvetowire(BSpline, interp)
    ys = [lengths[0]]

    for edge in wire:
        ys.append(edge.lastVertex().Y)

    return ys