Skip to content

Instantly share code, notes, and snippets.

@tmpvar
tmpvar / index.js
Last active August 29, 2015 14:13
requirebin sketch
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
Last active August 29, 2015 14:12
requirebin sketch
// click on the canvas to move the camera center
// -/+ subtracts/adds rays to be marched into the scene
var fc = require('fc');
var polygon = require('polygon');
var vec = require('vec2');
var arc = require('subdivide-arc');
var sign = require('signum');
var mat3 = require('gl-mat3');
@tmpvar
tmpvar / index.js
Last active August 29, 2015 14:12
requirebin sketch
// click on the canvas to move the camera center
// -/+ subtracts/adds rays to be marched into the scene
var fc = require('fc');
var polygon = require('polygon');
var vec = require('vec2');
var arc = require('subdivide-arc');
var sign = require('signum');
var mat3 = require('gl-mat3');
@tmpvar
tmpvar / index.js
Last active August 29, 2015 14:12
2d signed distance field surface detection test
var fc = require('fc');
var polygon = require('polygon');
var vec = require('vec2');
var arc = require('subdivide-arc');
var sign = require('signum');
var PI = Math.PI;
var TAU = PI*2;
var toTAU = function(rads) {
if (rads<0) {
@tmpvar
tmpvar / frag.glsl
Created December 25, 2014 03:12
lighting-tweaks frag.glsl
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D fbo;
uniform sampler2D ops;
uniform mat4 clipToWorld;
uniform vec2 resolution;
uniform float time;
G0 X23 Y23
G1 X23 Y19 Z-0.04
G1 X22 Y19 Z-0.05
G1 X22 Y23 Z-0.09
G1 X23 Y23 Z-0.1
G1 X23 Y19 Z-0.14
G1 X22 Y19 Z-0.15
G1 X22 Y23 Z-0.19
G1 X23 Y23 Z-0.2
G1 X23 Y19 Z-0.24
@tmpvar
tmpvar / dot-pin-1mm-pitch.gcode
Last active August 29, 2015 14:09
dot-pin 0,0 -> 50,50 @ 1mm pitch
G1 X0.00 Y0.00
G1 Z-1
G1 Z0
G1 X0.70 Y0.70
G1 Z-1
G1 Z0
G1 X1.41 Y1.41
G1 Z-1
G1 Z0
G1 X2.11 Y2.11
@tmpvar
tmpvar / package.json
Last active August 29, 2015 14:08
weather soap
{
"dependencies": {
"cli-table": "^0.3.1",
"microdom": "^0.2.2",
"optimist": "^0.6.1",
"sax": "^0.6.1",
"soap": "^0.6.0"
}
}
@tmpvar
tmpvar / cost.md
Last active August 29, 2015 14:08
tmpfire price thoughts
@tmpvar
tmpvar / bottom-offset
Last active August 29, 2015 14:07
tmpfire offsets
gcode-cleaner --x=60 --y=25 --z=-68.6
spacing: 60mm
array: y:4, x:2