Ejemplo n.º 1
0
def parse_points(shape, points, reflect=False):
    # Deal with input arguments
    if isinstance(points, int):
        points = generate_base_points(num_points=points,
                                      domain_size=shape,
                                      reflect=reflect)
    else:
        # Should we check to ensure that points are reflected?
        points = np.array(points)
    return points
Ejemplo n.º 2
0
    def _parse_points(self, shape, points):
        # Deal with input arguments
        if isinstance(points, int):
            points = topotools.generate_base_points(num_points=points,
                                                    domain_size=shape,
                                                    reflect=True)
        else:
            # Should we check to ensure that points are reflected?
            points = np.array(points)

        # Deal with points that are only 2D...they break Delaunay
        if points.shape[1] == 3 and len(np.unique(points[:, 2])) == 1:
            points = points[:, :2]

        return points
Ejemplo n.º 3
0
    def _parse_points(self, shape, points, num_points):
        # Deal with input arguments
        if points is None:
            if num_points is None:
                raise Exception('Must specify either "points" or "num_points"')
            points = topotools.generate_base_points(num_points=num_points,
                                                    domain_size=shape,
                                                    reflect=True)
        else:
            # Should we check to ensure that points are reflected?
            points = sp.array(points)

        # Deal with points that are only 2D...they break Delaunay
        if points.shape[1] == 3 and len(sp.unique(points[:, 2])) == 1:
            points = points[:, :2]

        return points