Coder Social home page Coder Social logo

simplicial-complex-boundary's Introduction

simplicial-complex-boundary

Extracts the boundary of a simplicial complex.

Example

var boundary = require('simplicial-complex-boundary')

var cells = [
  [0,1,2],
  [1,2,3]
]

console.log(boundary(cells))

Output:

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

Install

npm i simplicial-complex-boundary

API

var bnd = require('simplicial-complex-boundary')(cells)

Computes the boundary of a simplicial complex

  • cells are the cells of a simplicial complex

Returns The boundary of the simplicial complex (in the Z/2 homology sense)

License

(c) 2015 Mikola Lysenko. MIT License

simplicial-complex-boundary's People

Contributors

mikolalysenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

simplicial-complex-boundary's Issues

Example in readme broken

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.

Duplicate faces in bounday of adjacent tetrahedrons

If I understood the purpose of this module correctly, the simplical complex boundary of two adjacent tetrahedrons (one shared face) should be their "outer" surface, i.e. the inner shared face would not be part of the result triangle set. If this is correct, it is not working as expected. Below I try to construct the boundary of two adjacent tetrahedrons, sharing triangle [2,3,1]:

bnd([[2, 3, 1, 4], [3, 1, 0, 2]]]

This results in

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

But I think should result in (shared face [2, 3, 1] removed):

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.