connector.py 文件源码

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

项目:OpenRAM 作者: mguthaus 项目源码 文件源码
def shortenpath(self, dists):
        """shortens a path by the given distances"""

        # XXX later, this should be done by extended boxes instead of intersecting with circles
        # cut off the start of self
        center = self.atbegin_pt()
        cutpath = path.circle_pt(center[0], center[1], dists[0])
        try:
            cutpath = cutpath.normpath()
        except normpath.NormpathException:
            pass
        else:
            sp = self.intersect(cutpath)[0]
            self.normsubpaths = self.split(sp[-1:])[1].normsubpaths

        # cut off the end of self
        center = self.atend_pt()
        cutpath = path.circle_pt(center[0], center[1], dists[1])
        try:
            cutpath = cutpath.normpath()
        except normpath.NormpathException:
            pass
        else:
            sp = self.intersect(cutpath)[0]
            if sp:
                self.normsubpaths = self.split(sp[:1])[0].normsubpaths


################
## classes
################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号