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


Python GeomUtils.pointDist方法代码示例

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


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

示例1: tailToNode

# 需要导入模块: from Utils import GeomUtils [as 别名]
# 或者: from Utils.GeomUtils import pointDist [as 别名]
 def tailToNode( self, arrow_anno, circle_anno ):
     "return true if the tail of the arrow comes from the circle"
     lineDist = max(len(arrow_anno.tailstroke.Points) / 10, 1) #Check the last 10th of the stroke points the right way
     if arrow_anno.direction == "tail2head":
         lineSeg = ( arrow_anno.tailstroke.Points[lineDist], arrow_anno.tailstroke.Points[0] )
     else: #direction == 'head2tail'
         lineSeg = ( arrow_anno.tailstroke.Points[-lineDist], arrow_anno.tailstroke.Points[-1] )
         
     if GeomUtils.pointDist( arrow_anno.tail,  circle_anno.center ) < circle_anno.radius* DiGraphAnnotation.MATCHING_DISTANCE:
         if GeomUtils.linePointsTowards( lineSeg[0], lineSeg[1], circle_anno.center, circle_anno.radius * DiGraphAnnotation.POINTSTO_DISTANCE):
             return True
     return False
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:14,代码来源:DiGraphObserver.py

示例2: collectionFromItem

# 需要导入模块: from Utils import GeomUtils [as 别名]
# 或者: from Utils.GeomUtils import pointDist [as 别名]
 def collectionFromItem( self, strokes, annotation ):
     text_anno = None # text_anno will be the return value
     if annotation.isType( CircleObserver.CircleAnnotation ):
         circle = annotation
         text_anno = TextAnnotation("0",circle.radius*2)
     if annotation.isType( LineObserver.LineAnnotation ):
         line = annotation
         # if the line is up/down then it is a one
         if GeomUtils.angleParallel( line.angle, 90 ) > 0.6:
             line_length = GeomUtils.pointDist( line.start_point, line.end_point )
             text_anno = TextAnnotation("1",line_length)
     return text_anno
开发者ID:ASayre,项目名称:UCSBsketch,代码行数:14,代码来源:TextObserver.py

示例3: tipToNode

# 需要导入模块: from Utils import GeomUtils [as 别名]
# 或者: from Utils.GeomUtils import pointDist [as 别名]
 def tipToNode( self, arrow_anno, circle_anno ):
     "return true if the tip of the arrow points to the circle"
     lineDist = min(10, max(len(arrow_anno.tailstroke.Points) / 10, 1)) #Check the last 10th of the stroke points the right way
     #lineseg: two points from arrow "neck" to arrowhead tip 
     #lineseg2: two points from arrow "neck" to last point in tail stroke
     if arrow_anno.direction == "tail2head":
         lineSeg = ( arrow_anno.tailstroke.Points[-lineDist], arrow_anno.tip )
         lineSeg2 = ( arrow_anno.tailstroke.Points[-lineDist], arrow_anno.tailstroke.Points[-1] )
     else: #direction == 'head2tail'
         lineSeg = ( arrow_anno.tailstroke.Points[lineDist], arrow_anno.tip )
         lineSeg2 = ( arrow_anno.tailstroke.Points[lineDist], arrow_anno.tailstroke.Points[0] )
         
     if GeomUtils.pointDist( arrow_anno.tip,  circle_anno.center ) < circle_anno.radius* DiGraphAnnotation.MATCHING_DISTANCE:
         if GeomUtils.linePointsTowards( lineSeg[0], lineSeg[1], circle_anno.center, circle_anno.radius * DiGraphAnnotation.POINTSTO_DISTANCE):
             return True
         if GeomUtils.linePointsTowards( lineSeg2[0], lineSeg2[1], circle_anno.center, circle_anno.radius * DiGraphAnnotation.POINTSTO_DISTANCE):
             return True
     return False
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:20,代码来源:DiGraphObserver.py

示例4: distance

# 需要导入模块: from Utils import GeomUtils [as 别名]
# 或者: from Utils.GeomUtils import pointDist [as 别名]
 def distance(self, point2):
      "Returns the distance from this point to the point in argument 1"
      from Utils import GeomUtils
      return GeomUtils.pointDist(self, point2)
开发者ID:ASayre,项目名称:UCSBsketch,代码行数:6,代码来源:Point.py

示例5: tailToNode

# 需要导入模块: from Utils import GeomUtils [as 别名]
# 或者: from Utils.GeomUtils import pointDist [as 别名]
 def tailToNode( self, arrow_anno, circle_anno ):
     "return true if the tail of the arrow comes from the circle"
     return GeomUtils.pointDist( arrow_anno.tail, circle_anno.center ) < circle_anno.radius*1.5
开发者ID:ASayre,项目名称:UCSBsketch,代码行数:5,代码来源:DiGraphObserver.py

示例6: tipToNode

# 需要导入模块: from Utils import GeomUtils [as 别名]
# 或者: from Utils.GeomUtils import pointDist [as 别名]
 def tipToNode( self, arrow_anno, circle_anno ):
     "return true if the tip of the arrow points to the circle"
     return GeomUtils.pointDist( arrow_anno.tip,  circle_anno.center ) < circle_anno.radius*1.5
开发者ID:ASayre,项目名称:UCSBsketch,代码行数:5,代码来源:DiGraphObserver.py


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