本文整理汇总了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