本文整理匯總了Python中polygon.Polygon.get_number_of_intersected_sides方法的典型用法代碼示例。如果您正苦於以下問題:Python Polygon.get_number_of_intersected_sides方法的具體用法?Python Polygon.get_number_of_intersected_sides怎麽用?Python Polygon.get_number_of_intersected_sides使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類polygon.Polygon
的用法示例。
在下文中一共展示了Polygon.get_number_of_intersected_sides方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_should_retrive_each_side_that_crosses_the_Y_from_the_test_point
# 需要導入模塊: from polygon import Polygon [as 別名]
# 或者: from polygon.Polygon import get_number_of_intersected_sides [as 別名]
def test_should_retrive_each_side_that_crosses_the_Y_from_the_test_point(self):
A = [3, 6]; B = [3, 11]; C = [6, 11]; D = [6, 9]; E = [5, 9]; F = [5, 6]
polygon = Polygon([A, B, C, D, E, F])
test_point = [4, 7]
assert_equals(polygon.get_number_of_intersected_sides(test_point), {"left" : 1, "right" : 1}) #note that the the vertical side CD must not to be returned