Exemplo n.º 1
0
    def __init__(self, center, radius):
        Boundary.__init__(self)

        self.center = array(center, dtype=np.double).flatten()
        self.radius = float(radius)
        self.dimension = len(self.center)

        self._hash = self._hash = hash(tuple(self.center) + (self.radius, ))
Exemplo n.º 2
0
    def __init__(self, ranges):
        Boundary.__init__(self)

        self.ranges = array(ranges, dtype=np.double)
        assert self.ranges.shape[1] == 2
        assert all(self.ranges[:, 0] <= self.ranges[:, 1])
        self.dimension = self.ranges.shape[0]

        self._hash = hash(tuple(self.ranges.flat))
Exemplo n.º 3
0
    def __init__(self, ranges):
        Boundary.__init__(self)

        self.ranges = array(ranges, dtype=np.double)
        assert self.ranges.shape == (2, 2)
        assert all(self.ranges[:, 0] <= self.ranges[:, 1])
        self.dimension = 2

        self.polygon = None

        self._hash = hash(tuple(self.ranges.flat))
Exemplo n.º 4
0
    def __init__(self, center, radius):
        Boundary.__init__(self)

        if len(center) != 2:
            raise ValueError(
                "Center dimension does not match the space's dimension!")
        assert radius > 0

        self.center = array(center, dtype=np.double).flatten()
        self.radius = float(radius)
        self.dimension = 2

        self.polygon = None

        self._hash = self._hash = hash(tuple(self.center) + (self.radius, ))
Exemplo n.º 5
0
    def __init__(self, polygon):
        Boundary.__init__(self)

        self.polygon = geom.Polygon(polygon)
        self.dimension = 2
        self._hash = hash(tuple(array(self.polygon.exterior.coords).flat))