GithubHelp home page GithubHelp logo

5310 / aif-mesh Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 212 KB

A naïve and high-level implementation of the Adjacency and Incidence Framework mesh data-structure.

License: MIT License

JavaScript 100.00%

aif-mesh's Introduction

AIF Mesh

A naïve and high-level implementation of the Adjacency and Incidence Framework mesh data-structure.

Original papers by Frutuoso G. M. Silva & Abel J. P. Gomes:

Platform

The implementation is written in Javascript and uses Maps, Sets, and for-of statements that are part of the ECMAScript version 6 speicification still under development.

However, most modern browsers, and Node.js v0.11 with the --harmony flag, can run these just fine right now.

Transpiled ES5 versions have still been included for the UMD and CommonJS versions regardless. The CommonJS version, or rather, the NPM module, automatically loads the ES5 version if the ES6 one fails to. But the specific UMD version will have to be added to an HTML file manually.

UMD version exports the global namespace aifm.

Brief Outline

All the geometric elements of the mesh only contain references to their adjacent and incident elements.

These elements also have querying functions to retrieve their immediate and extrapolated references: $verts, $edges, $faces all respective return adjoint verts, edges, and faces of any vert, edge, or face.

Furthermore, each of these functions return the results in a special (Es6) Set-like object which has the same querying methods that it runs on all collected elements and return another such Set-like object. Queries can be chained with this.

The adjacency and incidence relations are all that the structure concerns itself with. Any other information, such as coordiantes of the verts, or metadata of a particular face, should go on the arbitrary object of the annotation property. The BasicMesh does exactly that.

The mesh object, however, does expose all its concent verts, edges, and faces as (ES6) Map objects for batch processing required by any algorithm that uses these structures.

Documentation, Tests, etc.

Having written this implementation for a quick prototype, I haven't had the chance to write any of it. If my prototype gets anywhere, I plan on cleaning it up with proper API documentation, tests, and usage examples.

( It'll still be a bit weird what with relying on ES6 features despite not being an ES6 module or using ES6 classes. In particular trying to extend the built-in Set class was an attempt in futility that the ES6 classes promise to fix. )

The source file aifm-es6.js should be sensible enough to infer usage, I think. Please take a look there if you want more!

Roadmap

  1. Add a cell element relations and naïve addVolume helpers.
    • Validating potentially degenerate arbitrary valence cells on SimpleMesh is out of the question! Let it focus on being a surface-mesh.
  2. Properly document API and usage.
  3. Add badges!
  4. Figure out why UMD builds cannot be required by other UMD builds. (set-algebra, in this case, when externalized.)
  5. Implement a tetra-mesh volume mesh with proper validation.

aif-mesh's People

Contributors

5310 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

musseffect

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.