Skip to content

Instantly share code, notes, and snippets.

View zeffii's full-sized avatar

Dealga McArdle zeffii

View GitHub Profile
import bpy
import json
def sv_main(scale=75.0, verticals=0.005):
verts_out = []
edges_out = []
in_sockets = [
['s', 'scale', scale],
['s', 'verticals', verticals]
import bpy
import json
def sv_main(scale=0.3):
verts_out = []
edges_out = []
in_sockets = [
['s', 'scale', scale]
]
import math
from math import sin, cos, pi
def sv_main(w=2.2, h=6.0, radius=0.3):
verts_out = []
faces_out = []
in_sockets = [
['s', 'width', w],
['s', 'height', h],
import math
from math import sin, cos, pi
def sv_main(w=2.2, h=6.0, radius=0.3):
verts_out = []
faces_out = []
in_sockets = [
['s', 'width', w],
['s', 'height', h],
@zeffii
zeffii / pest.js
Created February 15, 2015 21:49 — forked from anonymous/pest.js
function inputs(){
var obj = {};
obj.r = {min: 1.0, max:100.0, default: 5.0, step: 0.1};
obj.g = 14;
obj.b = 21;
return obj
}
function jazz(r, g, b){
# BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@zeffii
zeffii / punga.py
Created February 15, 2015 09:16 — forked from anonymous/punga.py
def mouse_change(func):
def add_mouse_change(*args):
print('mouse wait')
func(*args)
print('mouse normal')
return add_mouse_change
@mouse_change
def monkey_business(a, b, c):
print('a={0}, b={1}, c={2}'.format(a, b, b))
@zeffii
zeffii / daft.js
Last active August 29, 2015 14:15 — forked from anonymous/daft.js
function gen_verts(r1, r2, num_verts, ramp){
var tv = [];
var edges = [];
// # verts
for (var i=0; i<num_verts; i+=1){
var tamp = i/num_verts * 14 * Math.PI;
var theta = i/num_verts * 2 * Math.PI;
var x = (Math.sin(theta)*r1) + (Math.sin(tamp) * ramp),
y = (Math.cos(theta)*r2) + (Math.cos(tamp) * ramp),
@zeffii
zeffii / daft.js
Last active August 29, 2015 14:15 — forked from anonymous/daft.js
function gen_verts(r1, r2, num_verts, ramp){
var tv = [];
var edges = [];
// # verts
for (var i=0; i<num_verts; i+=1){
var tamp = i/num_verts * 14 * Math.PI;
var theta = i/num_verts * 2 * Math.PI;
var x = (Math.sin(theta)*r1) + (Math.sin(tamp) * ramp),
y = (Math.cos(theta)*r2) + (Math.cos(tamp) * ramp),
@zeffii
zeffii / bio_logic.py
Last active August 29, 2015 14:14 — forked from anonymous/bio_logic.py
# lookup sidechain parents
def bondLookUp(atom, amac):
if atom in {"O", "OXT"}:
parent = ["C", C]
elif atom in {"CB", "HA", "HA2", "HA3"}:
parent = ["CA", C]
elif (atom == "SG" or "HB" in atom or "OG" in atom or "CG" in atom):
parent = ["CB", C]