当前位置: 首页>>代码示例>>Python>>正文


Python Region.relativePosition方法代码示例

本文整理汇总了Python中region.Region.relativePosition方法的典型用法代码示例。如果您正苦于以下问题:Python Region.relativePosition方法的具体用法?Python Region.relativePosition怎么用?Python Region.relativePosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在region.Region的用法示例。


在下文中一共展示了Region.relativePosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: doubleCut

# 需要导入模块: from region import Region [as 别名]
# 或者: from region.Region import relativePosition [as 别名]
	def doubleCut(self, other, doreverse=True):
		'''takes self and another AngularDomain, and slices both of them,
		i.e.: cuts each region in the endpoints of the other AngularDomains
		regions, i.e.: ater this operation, for each region R1 in one
		AngularDomain, if there exists an Region R2 in the other so that R1
		contains R2 or R2 contains R1, the endpoints of R1 and R2 are the
		same.'''
		i,j= 0,0
		while i<len(self) and j<len(other):
			p= Region.relativePosition(self[i],other[j])
			if p==1:
				i+=1
			elif p==2:
				j+=1
			elif p==3:
				self.cutRegionOnPoint(i, other[j][0])
				i+=1
				other.cutRegionOnPoint(j, self[i][1])
				j+=1
			elif p==4:
				other.cutRegionOnPoint(j, self[i][0])
				j+=1
				self.cutRegionOnPoint(i, other[j][1])
				i+=1
			elif p==5:
				i= self.cutRegionOnPoint(i, other[j][0])
				i= self.cutRegionOnPoint(i, other[j][1])
				j+=1
			elif p==6:
				j= other.cutRegionOnPoint(j, self[i][0])
				j= other.cutRegionOnPoint(j, self[i][1])
				i+=1
开发者ID:goncalopp,项目名称:LK_angular_constraints,代码行数:34,代码来源:angulardomain.py


注:本文中的region.Region.relativePosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。