Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thibauts/remove-degenerate-cells
Removes degenerate cells in a simplicial complex
https://github.com/thibauts/remove-degenerate-cells
Last synced: 21 days ago
JSON representation
Removes degenerate cells in a simplicial complex
- Host: GitHub
- URL: https://github.com/thibauts/remove-degenerate-cells
- Owner: thibauts
- License: mit
- Created: 2015-03-01T13:08:30.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-01T13:08:57.000Z (almost 10 years ago)
- Last Synced: 2024-11-21T07:47:13.173Z (about 1 month ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
remove-degenerate-cells
=======================
### Removes degenerate cells in a simplicial complexRemoves degenerate cells in a simplicial complex and reindexes the cells array.
Install
-------```bash
$ npm install remove-degenerate-cells
```Usage
-----Using cell indices alone
```javascript
var removeDegenerateCells = require('remove-degenerate-cells');var mesh = {
cells: [
[0, 1, 2],
[0, 1, 1]
],
positions: [
[0, 0, 0],
[1, 0, 0],
[0, 1, 0],
]
}mesh.cells = removeDegenerateCells(mesh.cells);
console.log(mesh);
/*
{
cells: [
[0, 1, 2]
],
positions: [
[0, 0, 0],
[1, 0, 0],
[0, 1, 0]
]
}
*/
```Using vertex positions
```javascript
var removeDegenerateCells = require('remove-degenerate-cells');var mesh = {
cells: [
[0, 1, 2],
[0, 1, 3]
],
positions: [
[0, 0, 0],
[1, 0, 0],
[0, 1, 0],
[0, 0, 0]
]
}mesh.cells = removeDegenerateCells(mesh.cells, mesh.positions);
console.log(mesh);
/*
{
cells: [
[0, 1, 2]
],
positions: [
[0, 0, 0],
[1, 0, 0],
[0, 1, 0],
[0, 0, 0]
]
}
*/
```