Thu Mar 17 07:57:57 CDT 2011
Python's built-in `set` class removes duplicates automatically (if you
make sure to sort the indices so that each edge always has the same
edges = set()
def add_edge(v1, v2):
edges.add((min(v1, v2), max(v1, v2))
for i in xrange(x.nsimplex):
You can then iterate over edges directly, or call `list(edges)` if you
need them in an ordered list.
On Thu, Mar 17, 2011 at 5:20 AM, Dan Richards <D.Richards@mmu.ac.uk> wrote:
> Thanks Pauli, Dan and Rob, this is excellent!
> I will look into writing my own brute force algorithm to remove duplicate
> edges/faces as your example.
> Thanks again, much appreciated.
> "Before acting on this email or opening any attachments you should read the Manchester Metropolitan University email disclaimer available on its website http://www.mmu.ac.uk/emaildisclaimer "
> SciPy-User mailing list
More information about the SciPy-User