test_curve.py 文件源码

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

项目:bezier 作者: dhermes 项目源码 文件源码
def test_intersect_algebraic(self):
        from bezier import _intersection_helpers

        nodes1 = np.asfortranarray([
            [0.0, 0.0],
            [1.0, 1.0],
        ])
        curve1 = self._make_one(nodes1, 1)
        nodes2 = np.asfortranarray([
            [0.0, 1.0],
            [1.0, 0.0],
        ])
        curve2 = self._make_one(nodes2, 1)
        strategy = _intersection_helpers.IntersectionStrategy.ALGEBRAIC

        intersections = curve1.intersect(curve2, strategy=strategy)
        expected = np.asfortranarray([
            [0.5, 0.5],
        ])
        self.assertEqual(intersections, expected)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号