:returns: the geometry as an array of shape (N, 3)
967955
def geom(self):
        
        return numpy.array([(p.x, p.y, p.z) for p in self.mesh],
                           numpy.float32)
214439
def hull(self):
        
        from scipy.spatial import ConvexHull
        if len(self.coordinates) >= 4:
            inds = ConvexHull(self.coordinates).vertices
            return self.coordinates[inds]
        else:
            return self.coordinates
211593
def polygon(self):
            ''''''
            points = []
            for fp in self.points[1:]:
                    points.append((fp.lat, fp.lng))
            return points
570311
def shapes(self):
        """"""
        shp = self.__getFileObj(self.shp)
        shp.seek(100)
        shapes = []
        while shp.tell() < self.shpLength:
            shapes.append(self.__shape())
        return shapes
1367478
def shapes(self):
    """"""
    # Todo: Cache?
    if self._shapes:
      return self._shapes
    # Group together by shape_id
    self.log("Generating shapes...")
    ret = collections.defaultdict(entities.ShapeLine)
    for point in self.read('shapes'):
      ret[point['shape_id']].add_child(point)
    self._shapes = ret
    return self._shapes
1176360
def genslices_ndim(ndim, shape):
    """"""
    iterables = [genslices(shape[n]) for n in range(ndim)]
    yield from product(*iterables)
1150259
def array(self):
        
        return np.linspace(self.start, self.stop, self.num, self.endpoint)
533006
def map(self, coords):
        
        m = np.empty(coords.shape)
        m[:, :3] = (coords[:, :3] * self.scale[np.newaxis, :3] +
                    coords[:, 3:] * self.translate[np.newaxis, :3])
        m[:, 3] = coords[:, 3]
        return m
959463
def kdtree(self):
        

        kdtree = KDTree(self.vertices.view(np.ndarray))
        return kdtree
795996
function ( geometry, n ) {

		var face, i,
			faces = geometry.faces,
			vertices = geometry.vertices,
			il = faces.length,
			totalArea = 0,
			cumulativeAreas = [],
			vA, vB, vC, vD;

		// precompute face areas

		for ( i = 0; i < il; i ++ ) {

			face = faces[ i ];

			if ( face instanceof THREE.Face3 ) {

				vA = vertices[ face.a ];
				vB = vertices[ face.b ];
				vC = vertices[ face.c ];

				face._area = THREE.GeometryUtils.triangleArea( vA, vB, vC );

			} else if ( face instanceof THREE.Face4 ) {

				vA = vertices[ face.a ];
				vB = vertices[ face.b ];
				vC = vertices[ face.c ];
				vD = vertices[ face.d ];

				face._area1 = THREE.GeometryUtils.triangleArea( vA, vB, vD );
				face._area2 = THREE.GeometryUtils.triangleArea( vB, vC, vD );

				face._area = face._area1 + face._area2;

			}

			totalArea += face._area;

			cumulativeAreas[ i ] = totalArea;

		}

		// binary search cumulative areas array

		function binarySearchIndices( value ) {

			function binarySearch( start, end ) {

				// return closest larger index
				// if exact number is not found

				if ( end < start )
					return start;

				var mid = start + Math.floor( ( end - start ) / 2 );

				if ( cumulativeAreas[ mid ] > value ) {

					return binarySearch( start, mid - 1 );

				} else if ( cumulativeAreas[ mid ] < value ) {

					return binarySearch( mid + 1, end );

				} else {

					return mid;

				}

			}

			var result = binarySearch( 0, cumulativeAreas.length - 1 )
			return result;

		}

		// pick random face weighted by face area

		var r, index,
			result = [];

		var stats = {};

		for ( i = 0; i < n; i ++ ) {

			r = THREE.GeometryUtils.random() * totalArea;

			index = binarySearchIndices( r );

			result[ i ] = THREE.GeometryUtils.randomPointInFace( faces[ index ], geometry, true );

			if ( ! stats[ index ] ) {

				stats[ index ] = 1;

			} else {

				stats[ index ] += 1;

			}

		}

		return result;

	}
1137729
def shape(self):
        """"""
        try:
            return self.__shape
        except AttributeError:
            shape = tuple(len(vec) for vec in self.coord_vectors)
            self.__shape = shape
            return shape
1351279
def shape(self):
        
        return tuple(len(self._get_axis(a)) for a in self._AXIS_ORDERS)
967903
def to_point_cloud(self):
        
        return PointCloud(
            data=self._data.reshape(
                self.height *
                self.width,
                3).T,
            frame=self._frame)
454110
def process_parsed_coords(coords):
    
    geometry = np.zeros(shape=(len(coords), 3), dtype=float)
    for ii, entry in enumerate(coords):
        for jj in range(3):
            geometry[ii, jj] = float(entry[jj])
    return geometry
810738
def slice_3d_grid(grid, n):
    
    phen_grid = initialize_grid((len(grid[0]), len(grid)), 0)

    for i in range(len(grid)):
        for j in range(len(grid[i])):
            phen_grid[i][j] = grid[i][j][n]

    return phen_grid
56421
def all_coplanar(triangles):
    
    triangles = np.asanyarray(triangles, dtype=np.float64)
    if not util.is_shape(triangles, (-1, 3, 3)):
        raise ValueError('Triangles must be (n,3,3)!')

    test_normal = normals(triangles)[0]
    test_vertex = triangles[0][0]
    distances = point_plane_distance(points=triangles[1:].reshape((-1, 3)),
                                     plane_normal=test_normal,
                                     plane_origin=test_vertex)
    all_coplanar = np.all(np.abs(distances) < tol.zero)
    return all_coplanar
1092453
def _coords(shape):
    

    assert shape.geom_type == 'Polygon'
    coords = [list(shape.exterior.coords)]
    for interior in shape.interiors:
        coords.append(list(interior.coords))
    return coords