當前位置: 首頁>>代碼示例>>Python>>正文


Python GeoMath.bolzanoIntersectionEdges2_5D方法代碼示例

本文整理匯總了Python中lib.GeoMath.bolzanoIntersectionEdges2_5D方法的典型用法代碼示例。如果您正苦於以下問題:Python GeoMath.bolzanoIntersectionEdges2_5D方法的具體用法?Python GeoMath.bolzanoIntersectionEdges2_5D怎麽用?Python GeoMath.bolzanoIntersectionEdges2_5D使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在lib.GeoMath的用法示例。


在下文中一共展示了GeoMath.bolzanoIntersectionEdges2_5D方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: intersections_with_crack

# 需要導入模塊: from lib import GeoMath [as 別名]
# 或者: from lib.GeoMath import bolzanoIntersectionEdges2_5D [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.bolzanoIntersectionEdges2_5D方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。