Skip to content

Commit

Permalink
Merge pull request #4 from G-E-O-F/www
Browse files Browse the repository at this point in the history
The Space Pope gave us its blessing.
  • Loading branch information
thure committed Dec 6, 2014
2 parents aa26704 + c60e7c7 commit 9d10714
Show file tree
Hide file tree
Showing 22 changed files with 881 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -6,6 +6,9 @@ logs
*.iml
.idea

# Web intermediate build
www/dist

# Runtime data
pids
*.pid
Expand Down
84 changes: 84 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,84 @@
var path = require('path');

module.exports = function(grunt) {

require('load-grunt-tasks')(grunt);

var watchPort = 35729;

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
options: {
livereload: watchPort
},
scripts: {
files: ['www/src/**/*.js'],
tasks: ['browserify']
},
styles: {
files: 'www/src/**/*.less',
tasks: ['styles']
}
},
browserify: {
main: {
src: './www/src/main.js',
dest: './www/dist/main.js'
}
},
less: {
main: {
options: {
paths: ['./'],
lineNumbers: true
},
files: {
'www/dist/main.css': 'www/src/main.less'
}
}
},
autoprefixer: {
options: {
browsers: ['last 2 versions']
},
main: {
src: 'www/dist/main.css',
dest: 'www/dist/main.css'
}
},
copy: {
disthtml: {
src: './www/src/index.html',
dest: './www/dist/index.html'
},
prodhtml: {
src: './www/dist/index.html',
dest: './www/index.html'
}
},
uglify: {
prod: {
files: {
'./www/main.js': './www/dist/main.js'
}
}
},
cssmin: {
prod: {
files: {
'./www/main.css': './www/dist/main.css'
}
}
}
});

grunt.registerTask('default', ['dist']);
grunt.registerTask('styles', ['less', 'autoprefixer']);
grunt.registerTask('dist:copy', ['copy:disthtml']);
grunt.registerTask('dist', ['styles', 'browserify', 'dist:copy']);
grunt.registerTask('prod:copy', ['copy:prodhtml']);
grunt.registerTask('prod', ['dist', 'uglify:prod', 'cssmin:prod', 'prod:copy']);

};
36 changes: 34 additions & 2 deletions README.md
@@ -1,7 +1,39 @@
<img src="http://i.imgur.com/TFW6FJq.png" height="123" title="GEOF.core.peels"/>
<img src="https://rawgit.com/G-E-O-F/peels/www/docs/assets/geof-peels.svg" height="120" title="GEOF.core.peels"/>
<img src="https://rawgit.com/G-E-O-F/peels/www/docs/assets/geof8.min.svg" height="120" title="GEOF.core" align="right"/>

[![Build Status](https://travis-ci.org/G-E-O-F/peels.svg)](https://travis-ci.org/G-E-O-F/peels)

A configurable spherical geodesic grid data model designed for simulations.

Based on the [Spherical Geodesic Grids technique](http://kiwi.atmos.colostate.edu/BUGS/geodesic/) described by Todd D. Ringler, Ross P. Heikes, and David A. Randall at the Department of Atmospheric Science at Colorado State University.
The literature extolling spherical geodesic grids as data models for simulations of 2½D spherical phenomena like oceanography and climate is enormous (see references below), but the algorithms for those simulations are often written for research-oriented platforms, making accessibility and portability a problem.

**Peels** is the first attempt at a JavaScript implementation of the spherical geodesic grid data model for use in browsers or Node. While it was developed as the first component of [GEOF](http://github.com/G-E-O-F), Peels has no gaming-specific functionality and should be useful for other goals as well.

## Usage

First, install:

npm install --save g-e-o-f/peels

Next, make a sphere:

var Sphere = require('peels'),
sphere = new Sphere({divisions: 8});

Peels is still in development; bear in mind the API is likely to change in the near future.

### `Sphere`

The constructor takes an `options` argument.

#### `options.divisions`

When constructing a sphere, you can specify its resolution by passing `divisions: [integer]` in the constructor's options. ‘Divisions’ is the number of times the edges of the sphere's initial icosahedron will be divided. This metric is directly (exponentially) related to the model’s memory consumption.

In the body of research on spherical geodesic grids, resolution is usually described in terms of ‘level’ of division, where each level yields 2<sup><i>n</i></sup> fields along each edge. `divisions` is not this metric; each increment of `divisions` yields <i>n</i> + 1 fields along each edge, allowing much finer control of the sphere's resolution.

## References

- Peels is largely based on the [Spherical Geodesic Grids technique](http://kiwi.atmos.colostate.edu/BUGS/geodesic/) described by Todd D. Ringler, Ross P. Heikes, and David A. Randall at the Department of Atmospheric Science at Colorado State University. Similar implementations exist, but their description was the most helpful.

-
146 changes: 146 additions & 0 deletions docs/assets/geof-peels.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9d10714

Please sign in to comment.