Exemplo n.º 1
0
 def rated_nodes_within(self,
                        polygon: mapping.Polygon,
                        min_rating=0) -> List[Node]:
     return [
         x for x in self.rated_nodes(min_rating)
         if polygon.point_in_poly(x.position)
     ]
Exemplo n.º 2
0
    def test_poly_random(self):
        points = [
            Point(1, 2),
            Point(3, 1),
            Point(7, 2),
            Point(9, 4),
            Point(6, 6),
            Point(6, 9),
            Point(4, 8),
            Point(2, 9),
            Point(1, 7),
            Point(0, 5)]
        poly = Polygon(points)

        for i in range(0, 100):
            rp = poly.random_point()
            self.assertTrue(poly.point_in_poly(rp))
Exemplo n.º 3
0
 def nodes_within(self, polygon: mapping.Polygon) -> List[Node]:
     return [x for x in self.nodes if polygon.point_in_poly(x.position)]
Exemplo n.º 4
0
Arquivo: terrain.py Projeto: pydcs/dcs
 def rated_nodes_within(self, polygon: mapping.Polygon, min_rating=0) -> List[Node]:
     return [x for x in self.rated_nodes(min_rating) if polygon.point_in_poly(x.position)]
Exemplo n.º 5
0
Arquivo: terrain.py Projeto: pydcs/dcs
 def nodes_within(self, polygon: mapping.Polygon) -> List[Node]:
     return [x for x in self.nodes if polygon.point_in_poly(x.position)]