public MeshEdge CreateMeshEdge(Vertex vertex1, Vertex vertex2, CreateOption createOption = CreateOption.ReuseExisting) { if (false) //!vertices.Contains(vertex1) || !vertices.Contains(vertex2)) { throw new ArgumentException("the two vertices must be in the vertices list before a mesh edge can be made between them."); } if (vertex1 == vertex2) { throw new ArgumentException("Your input vertices must not be the same vertex."); } if (createOption == CreateOption.ReuseExisting) { MeshEdge existingMeshEdge = vertex1.GetMeshEdgeConnectedToVertex(vertex2); if (existingMeshEdge != null) { return(existingMeshEdge); } } MeshEdge createdMeshEdge = new MeshEdge(vertex1, vertex2); MeshEdges.Add(createdMeshEdge); return(createdMeshEdge); }
public MeshEdge CreateMeshEdge(Vertex vertex1, Vertex vertex2, CreateOption createOption = CreateOption.ReuseExisting) { if (false)//!vertices.Contains(vertex1) || !vertices.Contains(vertex2)) { throw new ArgumentException("the two vertices must be in the vertices list before a mesh edge can be made between them."); } if (vertex1 == vertex2) { throw new ArgumentException("Your input vertices must not be the same vertex."); } if (createOption == CreateOption.ReuseExisting) { MeshEdge existingMeshEdge = vertex1.GetMeshEdgeConnectedToVertex(vertex2); if (existingMeshEdge != null) { return existingMeshEdge; } } MeshEdge createdMeshEdge = new MeshEdge(vertex1, vertex2); MeshEdges.Add(createdMeshEdge); return createdMeshEdge; }