Skip to content

Instantly share code, notes, and snippets.

Thomas Roughton troughton

Block or report user

Report or block troughton

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
View Steam System Information
Computer Information:
Manufacturer: Apple
Model: iMacPro1,1
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Xeon(R) W-2150B CPU @ 3.00GHz
CPU Family: 0x6
troughton / main.swift
Last active Nov 30, 2018
Swift Tromino Algorithm - Windows Test
View main.swift
import Swift
struct Position : Hashable {
let x : Int
let y : Int
var hashValue: Int {
return 31 &* x &+ y
View AmbientDice.cpp
struct Vertex {
vec3 value;
vec3 directionalDerivativeU;
vec3 directionalDerivativeV;
void AmbientDice::hybridCubicBezierWeights(u32 i0, u32 i1, u32 i2, float b0, float b1, float b2, VertexWeights *w0Out, VertexWeights *w1Out, VertexWeights *w2Out) const {
const float alpha = 0.5f * sqrt(0.5f * (5.0f + sqrt(5.0f))); // 0.9510565163
const float beta = -0.5f * sqrt(0.1f * (5.0f + sqrt(5.0f))); // -0.4253254042
troughton /
Last active Apr 5, 2019
Swift Cross-Compilation on Windows 10

Cross-compiling Swift for Windows through the Linux Subsystem for Windows

This tutorial will walk you through the process of compiling your own native programs for Windows using the Ubuntu on Windows. While the development environment and Swift compiler used here will be the standard toolchain for Linux, you'll also be able to cross-compile programs that run natively on Windows like any other executable.

Required Environment

This tutorial assumes a computer running an up-to-date 64-bit version of Windows 10 (at the time of writing, the Fall Creators' Update was the most recent build).

You'll also need Visual Studio 2017; the Community Edition is sufficient, since we'll only be using the SDKs that come with it and some command line tools.

troughton /
Created Mar 9, 2017
Maya script to extrude along a curve.
import maya.cmds as cmds
import math
import numpy
def basisToEuler(tangent, bitangent, normal):
#Adapted from
m = [tangent, bitangent, normal]
if abs(m[2][0]) != 1:
theta = -math.asin(m[2][0])
View .purview_helper.js
// note: this file is poorly named - it can generally be ignored.
// helper functions below for supporting blocks/purview
function saveBlocksImages(doZoom) {
if(doZoom == null) {
doZoom = false;
// generate 960x500 preview.jpg of entire canvas
troughton / .block
Last active Oct 6, 2016 — forked from dribnet/.block
Dimensional Glyph
View .block
license: mit
troughton / .block
Last active Oct 11, 2016 — forked from dribnet/.block
Painterly Weatherbot
View .block
license: mit
troughton / .block
Last active Oct 6, 2016 — forked from dribnet/.block
Feral – A Parametric Font
View .block
license: mit
troughton / .block
Last active Oct 6, 2016 — forked from dribnet/.block
Parameterised Cartoon Faces
View .block
license: mit
You can’t perform that action at this time.