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


Python GeoMath.pointEqualPoint方法代码示例

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


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

示例1: intersections_with_crack

# 需要导入模块: from lib import GeoMath [as 别名]
# 或者: from lib.GeoMath import pointEqualPoint [as 别名]
    def intersections_with_crack(self, crack, path_ordered):
        reload(GeoMath)
        intersections = []
        edges_floor = GeoMath.getEdgesFromPoints(self.get_absolute_points())
        prev_intersection = None
        next_intersection = None
        #=======================================================================
        # we group the intersections in pairs, because after we'll have a different
        # destruction in the floor for each pair of intersection
        #=======================================================================

        for infoPrim in path_ordered:
            patterns = crack[infoPrim.getPrim()]
            for pattern in patterns:
                pattern_edges = GeoMath.getEdgesFromPoints(pattern.getPoints())
                may_intersect, pattern_edge_inter, floor_edge_inter = GeoMath.bolzanoIntersectionEdges2_5D(pattern_edges, edges_floor)
                if(may_intersect):
                    # FIXME: HACK: we take one point of the pattern edge and put the y of the floor.
                    # We are assuming the edge is perpendicular to the floor.
                    # TEMP:
                    point_intersection = [pattern_edge_inter[0][0], floor_edge_inter[0][1], pattern_edge_inter[0][2]]
                    logging.debug("Intersection bef" + str(point_intersection))
                    logging.debug("fllor_edge_inter " + str(floor_edge_inter))
                    #point2DToProjectOntoXZ = [point_intersection[0], 0, point_intersection[2]]
                    #floorEdge2DToCalculateProjectionOntoXZ = [[floor_edge_inter[0][0],0 , floor_edge_inter[0][2]], [floor_edge_inter[1][0], 0, floor_edge_inter[1][2]]]

                    #point_intersection = GeoMath.getPointProjectionOnLine(floorEdge2DToCalculateProjectionOntoXZ, point2DToProjectOntoXZ)
                    #point_intersection = [point_intersection[0], floor_edge_inter[0][1], point_intersection[2]]

                    logging.debug("Intersection " + str(point_intersection))
                    
                    if(not prev_intersection):
                        prev_intersection = point_intersection
                        break
                    elif(not GeoMath.pointEqualPoint(point_intersection, prev_intersection)):
                        next_intersection = point_intersection
                        new_intersection = [prev_intersection, next_intersection]
                        intersections.append(new_intersection)
                        prev_intersection = None
                        next_intersection = None
                        break
        return intersections
开发者ID:csoriano89,项目名称:BuildingDestruction,代码行数:44,代码来源:floor.py


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