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


Python Line.segmentsIntersect方法代码示例

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


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

示例1: trimJoin_Coro

# 需要导入模块: from line import Line [as 别名]
# 或者: from line.Line import segmentsIntersect [as 别名]
 def trimJoin_Coro(self):
     """ Yields a list of lines that have their ends properly trimmed/joined
     after an offset.
     
     When the lines are offset their endpoints are just moved away the offset
     distance. If you offset a circle to the inside this would mean that
     all of the lines would overlap. If the circle was offset to the outside
     none of the lines would be touching. This function trims the overlapping
     ends and extends/joins the non touching ends.
     
     Yields
     ------
     in - Lines
     out - one big List of lines at the end.
     """
     offsetLines = []
     moveEnd = yield
     moveStart = yield
     while not(moveStart is None):
         _, point = moveEnd.segmentsIntersect(moveStart, c.ALLOW_PROJECTION)
         moveEnd = Line(moveEnd.start, point, moveEnd)
         moveStart = Line(point, moveStart.end, moveStart)
         offsetLines.append(moveEnd)
         moveEnd = moveStart
         moveStart = yield
     _, point = moveEnd.segmentsIntersect(offsetLines[0], c.ALLOW_PROJECTION)
     moveEnd = Line(moveEnd.start, point, moveEnd)
     offsetLines.append(moveEnd)
     offsetLines[0] = Line(point, offsetLines[0].end, offsetLines[0])
     yield offsetLines
开发者ID:VanHulleOne,项目名称:DogBoneV2,代码行数:32,代码来源:outline.py


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