Makes a face with num_edges edges, which will be attached to nothing.
509281
def make_original_face(num_edges)
      num_edges_check(num_edges)
      # Make the vertices
      vert_ref = Array.new(num_edges) {Vertex.new}
      edge_ref = []

      # Connect each vertex to the one before it (including the first one :)
      (num_edges).times do |vert_id|
        edge_ref << make_connection(vert_ref[vert_id - 1], vert_ref[vert_id])
      end

      # Make the face and store it
      face = add_face(edge_ref)
      # Store the new vertices
      @vertices += vert_ref
      # Store the new edges
      @edges += edge_ref

      face
    end
527049
def tess(faces, properties=None, meta_data=None):
    '''
    
    '''
    return Tesselation(faces, properties=properties, meta_data=meta_data)
539909
def add_edge(self, edge):
        
        u, v = edge

        both_exist = u in self.vertices and v in self.vertices
        # Using `is` because if they belong to the same component, they MUST
        # share the same set object!
        if both_exist and self.components[u] is self.components[v]:
            # Both vertices are part of the same connected component.
            raise InvariantError('Adding %r would form a cycle' % (edge,))
        if u == v:
            raise InvariantError('Cannot add loop: %r' % (edge,))

        # Ensure the vertices exist in the graph.
        self.add_vertex(u)
        self.add_vertex(v)

        # Add the edges to each other.
        self._vertices[u].add(v)
        self._vertices[v].add(u)

        # Add all of the smaller components to the bigger one.
        smaller_component, bigger_component = self.sort_components(u, v)
        for vertex in smaller_component:
            bigger_component.add(vertex)
            # And with this assignment, say bye-bye to the smaller component.
            self.components[vertex] = bigger_component
983860
def mesh_nmasked(self):
        

        return self._make_2d_array(
            np.ma.count_masked(self._data_sigclip, axis=1))
95972
def polygon(self, vertexes, attr=0, row=None):
        ''
        self.polylines.append((vertexes + [vertexes[0]], attr, row))
380457
def compute_number_edges(function):
    
    n = 0
    for node in function.nodes:
        n += len(node.sons)
    return n
1021885
def _preprocess_edges_for_pydot(edges_with_data):
    """'"""
    for (source, target, attrs) in edges_with_data:
        if 'label' in attrs:
            yield (quote_for_pydot(source), quote_for_pydot(target),
                   {'label': quote_for_pydot(attrs['label'])})
        else:
            yield (quote_for_pydot(source), quote_for_pydot(target), {})
580916
def count_neighbours(mask, radius=1):
    ''''''

    height, width = mask.shape

    f = 2.0*radius+1.0

    w = -1.0/numpy.sqrt(f)
    kernel = [w]*radius + [w] + [w]*radius

    result = mask * f

    for y in range(height):
        result[y,:]  = numpy.convolve(result[y,:], kernel, 'same')

    for x in range(width):
        result[:,x] = numpy.convolve(result[:, x], kernel, 'same')

    return result - mask
609758
function buildSideFaces() {

		var layeroffset = 0;
		sidewalls( contour, layeroffset );
		layeroffset += contour.length;

		for ( h = 0, hl = holes.length; h < hl; h ++ ) {

			ahole = holes[ h ];
			sidewalls( ahole, layeroffset );

			//, true
			layeroffset += ahole.length;

		}

	}
488809
function buildSideFaces() {

			var start = verticesArray.length / 3;
			var layeroffset = 0;
			sidewalls( contour, layeroffset );
			layeroffset += contour.length;

			for ( h = 0, hl = holes.length; h < hl; h ++ ) {

				ahole = holes[ h ];
				sidewalls( ahole, layeroffset );

				//, true
				layeroffset += ahole.length;

			}


			scope.addGroup( start, verticesArray.length / 3 - start, 1 );


		}
541102
def edges
	    points = self.vertices
	    points.each_cons(2).map {|p1,p2| Edge.new(p1,p2) } + [Edge.new(points.last, points.first)]
	end
1304485
def val_to_edge(edges, x):
    """"""
    edges = np.array(edges)
    w = edges[1:] - edges[:-1]
    w = np.insert(w, 0, w[0])
    ibin = np.digitize(np.array(x, ndmin=1), edges - 0.5 * w) - 1
    ibin[ibin < 0] = 0
    return ibin
453519
function next(edge) {
  return edge.face.halfEdges[(edge.slot + 1) % edge.face.length]
}
948125
def del_edge(self, edge):
        
        u, v = edge
        self.node_neighbors[u].remove(v)
        self.del_edge_labeling((u, v))  
        if (u != v):
            self.node_neighbors[v].remove(u)
            self.del_edge_labeling((v, u))
335392
function EdgeShape(v1, v2) {
  if (!(this instanceof EdgeShape)) {
    return new EdgeShape(v1, v2);
  }

  EdgeShape._super.call(this);

  this.m_type = EdgeShape.TYPE;
  this.m_radius = Settings.polygonRadius;

  // These are the edge vertices
  this.m_vertex1 = v1 ? Vec2.clone(v1) : Vec2.zero();
  this.m_vertex2 = v2 ? Vec2.clone(v2) : Vec2.zero();

  // Optional adjacent vertices. These are used for smooth collision.
  // Used by chain shape.
  this.m_vertex0 = Vec2.zero();
  this.m_vertex3 = Vec2.zero();
  this.m_hasVertex0 = false;
  this.m_hasVertex3 = false;
}
1280327
def add_edge(self, u, v, **attr):
        
        if u not in self.vertices:
            self.vertices[u] = []
        if v not in self.vertices:
            self.vertices[v] = []
        vertex = (u, v)
        self.edges[vertex] = {}
        if attr:
            self.edges[vertex].update(attr)
        self.vertices[u].append(v)
        self.vertices[v].append(u)
695404
def add_edges(self, edges, *args, **kwargs):
        
        for edge in edges:
            self.add_edge(edge, *args, **kwargs)