Skip to content

Instantly share code, notes, and snippets.

Elijah Insua tmpvar

Block or report user

Report or block tmpvar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tmpvar
tmpvar / 2d-pbd.js
Last active Sep 16, 2019
2d-pbd experiment - run with budo
View 2d-pbd.js
const ctx = require('fc')(render, 1)
const center = require('ctx-translate-center')
const {vec2, vec3, mat2, mat3 } = require('gl-matrix')
const renderGrid = require('ctx-render-grid-lines')
const segseg = require('segseg')
const ndarray = require('ndarray')
const raySlab = require('ray-aabb-slab')
const particles = []
const constraints = []
View keybase.md

Keybase proof

I hereby claim:

  • I am tmpvar on github.
  • I am tmpvar (https://keybase.io/tmpvar) on keybase.
  • I have a public key ASDnoLe66_72oRYokyihcVYh5fOCT6WzjzKDPNYZPT-QXQo

To claim this, I am signing this object:

@tmpvar
tmpvar / index.js
Last active May 20, 2016
requirebin sketch
View index.js
var fc = require('fc')
var center = require('ctx-translate-center')
var grid = require('ctx-render-grid-lines')
var circle = require('ctx-circle')
var ndarray = require('ndarray')
var fillArray = require('ndarray-fill')
var marchingSquares = require('marching-squares')
var surfaceNets = require('surface-nets')
// where size is the bin size from 0..1
function createBinner(radius, width, height) {
@tmpvar
tmpvar / index.js
Created Apr 8, 2016
requirebin sketch
View index.js
var fc = require('fc')
var center = require('ctx-translate-center')
var grid = require('ctx-render-grid-lines')
var circle = require('ctx-circle')
var ndarray = require('ndarray')
var fillArray = require('ndarray-fill')
// where size is the bin size from 0..1
function createBinner(radius, width, height) {
var cx = Math.ceil(width/radius)
@tmpvar
tmpvar / index.js
Last active Apr 3, 2016
requirebin sketch
View index.js
var fc = require('fc');
var center = require('ctx-translate-center');
var poly = require('ctx-render-polyline');
var points = require('ctx-render-points');
var circle = require('ctx-circle');
var bounds2 = require('2d-bounds');
var gridlines = require('ctx-render-grid-lines');
var isect = require('robust-segment-intersect');
var createSDF = require('sdf-polygon-2d');
var area = require('2d-polygon-area');
@tmpvar
tmpvar / index.js
Created Apr 2, 2016
requirebin sketch
View index.js
var toPoly = require('pslg-to-poly')
var points = [
// loop 1
[-115, 100],
[ 103, 100],
[ 107, 50],
[-100, -100],
// loop 2
@tmpvar
tmpvar / index.js
Last active Jan 3, 2016
requirebin sketch
View index.js
var fc = require('fc')
var center = require('ctx-translate-center')
var min = Math.min;
var max = Math.max;
var abs = Math.abs;
function length(x, y) {
return Math.sqrt(x*x + y*y);
}
View add-math.h.patch
diff --git a/examples/opencl/histogram.cpp b/examples/opencl/histogram.cpp
index 4817efd..fb3c39b 100644
--- a/examples/opencl/histogram.cpp
+++ b/examples/opencl/histogram.cpp
@@ -18,6 +18,7 @@
#include <iterator>
#include <algorithm>
#include "cl_helpers.h"
+#include <math.h>
@tmpvar
tmpvar / index.js
Created Oct 23, 2015
requirebin sketch
View index.js
var fc = require('fc')
var center = require('ctx-translate-center');
var circle = require('ctx-circle');
var ndarray = require('ndarray')
var vec2 = require('gl-vec2');
var createRay = require('ray-aabb');
function sign(a) {
return typeof a === 'number' ? a ? a < 0 ? -1 : 1 : a === a ? 0 : 0 : 0
}
@tmpvar
tmpvar / index.js
Last active Oct 22, 2015
requirebin sketch
View index.js
var fc = require('fc')
var center = require('ctx-translate-center');
var circle = require('ctx-circle');
var ndarray = require('ndarray')
var vec2 = require('gl-vec2');
var createRay = require('ray-aabb');
function sign(a) {
return typeof a === 'number' ? a ? a < 0 ? -1 : 1 : a === a ? 0 : 0 : 0
}
You can’t perform that action at this time.