Giter Club home page Giter Club logo

grid-mesh's Introduction

grid-mesh

Creates a triangulated orthogonal grid. This is not the same as grid-graph, since:

  • It only works for 2D meshes (though they can be embedded in arbitrary dimensional space)
  • It fills in the faces

Usage

Install using npm:

npm install grid-mesh

And use as follows:

console.log(require("grid-mesh")(100, 100))

require("grid-mesh")(nx, ny[, origin, dx, dy])

Creates an nx by ny sized grid mesh.

  • nx the number of subdivisions along the dx axis
  • ny the number of subdivisions along the dy axis
  • origin is the start coordinate for the mesh (Default: [0,0])
  • dx the step vector along the x direction (Default: [1,0])
  • dy the step vector along the y direction (Defulat: [0,1])

Returns A json object with the following properties:

  • cells the cells of the mesh
  • positions the positions of the mesh

Credits

(c) 2013 Mikola Lysenko. MIT License

grid-mesh's People

Contributors

mikolalysenko avatar

Watchers

James Cloos avatar

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.