mikolalysenko / simplicial-complex-boundary

Extracts the boundary of a simplicial complex
MIT License
8 stars 5 forks source link

Example in readme broken #2

Open tomka opened 8 years ago

tomka commented 8 years ago

The example given in the readme file does not work:

var boundary = require('simplicial-complex-boundary')
var cells = [
  [0,1,2],
  [1,2,3]
]
boundary(cells)

results in

[ [ 0, 1 ], [ 2, 0 ], [ 1, 2 ], [ 1, 2 ], [ 3, 1 ], [ 2, 3 ] ]

but according to the reamde it should result in

[ [ 0, 1 ], [ 0, 2 ], [ 1, 3 ], [ 2, 3 ] ]

The problem seems to be that the module expects the cells to be oriented the same. This, however isn't the case in the example, but it is also nowhere noted that the library expects this. If one fixes the orientation in the input (using e.g. var cells = [[0,1,2], [3,2,1]];), the expected result shows up.

mikolalysenko commented 8 years ago

You're right. If you want to send a PR I'll merge it in.