make_images.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:bezier 作者: dhermes 项目源码 文件源码
def newton_refine_curve(curve, point, s, new_s):
    """Image for :func:`._curve_helpers.newton_refine` docstring."""
    if NO_IMAGES:
        return

    ax = curve.plot(256)
    ax.plot(point[:, 0], point[:, 1], marker='H')
    wrong_points = curve.evaluate_multi(np.asfortranarray([s, new_s]))
    ax.plot(wrong_points[[0], 0], wrong_points[[0], 1],
            color='black', linestyle='None', marker='o')
    ax.plot(wrong_points[[1], 0], wrong_points[[1], 1],
            color='black', linestyle='None', marker='o',
            markeredgewidth=1, markerfacecolor='None')

    # Set the axis bounds / scaling.
    ax.axis('scaled')
    ax.set_xlim(-0.125, 3.125)
    ax.set_ylim(-0.125, 1.375)

    save_image(ax.figure, 'newton_refine_curve.png')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号