Last active
May 6, 2017 13:01
-
-
Save DavidGeorge528/ff99dc5a8a8c9a9d0e942042c9d2c8c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
edges = {} | |
F = meshes[0]["Faces"].copy() | |
F.sort(1) | |
nf = F.shape[0] | |
for i in range(nf): | |
edges.setdefault(tuple(F[i,:2]), []).append(i) | |
edges.setdefault(tuple(F[i,1:3]), []).append(i) | |
edges.setdefault(tuple(F[i,[0,2]]), []).append(i) | |
neighbours = {} | |
for e in edges.values(): | |
neighbours.setdefault(e[0], []).append(e[1]) | |
neighbours.setdefault(e[1], []).append(e[0]) | |
neighbours = array(list(neighbours.values())) | |
neighbours.sort(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment