lab9.py 文件源码

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

项目:Computer-graphics 作者: Panda-Lewandowski 项目源码 文件源码
def clipping(win):
    if len(win.clip) <= 1:
        QMessageBox.warning(win, "??????!", "?????????? ?? ?????!")

    if len(win.pol) <= 1:
        QMessageBox.warning(win, "??????!", "????????????? ?? ?????!")

    if len(win.pol) > 1 and len(win.clip) > 1:
        norm = isConvex(win.clip)
        if not norm:
            QMessageBox.warning(win, "??????!", "?????????? ?? ????????!???????? ?? ????? ???? ?????????!")
        else:
            p = sutherland_hodgman(win.clip, win.pol, norm)
            if p:
                win.pen.setWidth(2)
                win.pen.setColor(red)
                win.scene.addPolygon(p, win.pen)
                win.pen.setWidth(1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号