Skip to content

Instantly share code, notes, and snippets.

View ameliemaia's full-sized avatar
🦋

Amelie Maia ameliemaia

🦋
View GitHub Profile
Util =
calculate_resize: (image_width, image_height, win_width, win_height) ->
window_ratio = win_width / win_height
image_ratio1 = image_width / image_height
image_ratio2 = image_height / image_width
if window_ratio < image_ratio1
@ameliemaia
ameliemaia / three-examples-converter.js
Last active November 26, 2018 03:32
Convert threejs examples js to es6 - slightly hacky but works
var fs = require('fs');
require('shelljs/global');
const EXAMPLES_DIR = './node_modules/three/examples/js'
const DEST_DIR = './src/js/lib/three/examples'
mkdir('-p', DEST_DIR);
const files = [
`${EXAMPLES_DIR}/loaders/GLTFLoader.js`,
@ameliemaia
ameliemaia / particle_dynamics_to_mesh.py
Last active August 29, 2015 13:56
A particle simulation setup for Maya.
import pymel.core as pm
# Set the animation playback range
pm.playbackOptions(animationEndTime = 500, maxTime = 500, loop = 'once')
# Create sphere container which will act as the collider for the particles
sphere = pm.polySphere(r = 15, subdivisionsX = 32, subdivisionsY = 32)
@ameliemaia
ameliemaia / d.py
Created April 10, 2013 18:14
Two Python scripts that generate a generative sculpture of Digit London's 'D' in Maya.
"""
D sculpture
"""
import pymel.core as pm
import random
from pointset import *
sets = 2
points = [ ]
@ameliemaia
ameliemaia / jerusalem_cube.py
Last active December 15, 2015 17:29
Jerusalem styled cube with Forms in Maya
from forms.geometry import hexahedron
holes = [ 7, 11, 12, 13, 17, 27, 32, 35, 36, 37, 38, 39, 42, 47, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 77, 81, 82, 83, 85, 86, 87, 88, 89, 91, 92, 93, 97, 107, 111, 112, 113, 117 ]
x = hexahedron.Sierpinski().generate( size = 40, iterations = 2, grid = 5, holes = holes )