geometry.py 文件源码

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

项目:xdesign 作者: tomography 项目源码 文件源码
def contains(self, other):
        if isinstance(other, Point):
            x = other._x
        elif isinstance(other, np.ndarray):
            x = other
        elif isinstance(other, Polygon):
            x = _points_to_array(other.vertices)
            return np.all(self.contains(x))
        else:
            raise TypeError("P must be point or ndarray")

        # keep track of whether each point is contained in a face
        bools = np.full(x.shape[0], False, dtype=bool)
        for f in self.faces:
            bools = np.logical_or(bools, f.contains(x))
        return bools
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号