This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
greek_alphabet = { | |
u'\u0391': 'Alpha', | |
u'\u0392': 'Beta', | |
u'\u0393': 'Gamma', | |
u'\u0394': 'Delta', | |
u'\u0395': 'Epsilon', | |
u'\u0396': 'Zeta', | |
u'\u0397': 'Eta', | |
u'\u0398': 'Theta', | |
u'\u0399': 'Iota', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from mathutils import Vector | |
listOfVectors = [((0,0,0,1)),((1,0,0,1)),((2,0,0,1)),((2,3,0,1)),((0,2,0,1))] | |
# create a spline curve from a number of points | |
def MakePolyLine(objname, curvename, cList): | |
curvedata = bpy.data.curves.new(name=curvename, type='CURVE') | |
curvedata.dimensions = '2D' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from mathutils import Vector | |
listOfVectors = [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))] | |
shapes = [ [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))], | |
[((0,0,0,1)),((2,0,0,1)),((1,1,0,1)),((0,1,0,1))], | |
[((0,0,0,1)),((1,0,0,1)),((1,2,0,1)),((0,1,0,1))], | |
[((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((-1,1,0,1))] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from mathutils import Vector | |
listOfVectors = [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))] | |
shapes = [ [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))], | |
[((0,0,0,1)),((2,0,0,1)),((1,1,0,1)),((0,1,0,1))], | |
[((0,0,0,1)),((1,0,0,1)),((1,2,0,1)),((0,1,0,1))], | |
[((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((-1,1,0,1))] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from mathutils import Vector | |
listOfVectors = [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))] | |
shapes = [ [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))], | |
[((0,0,0,1)),((2,0,0,1)),((1,1,0,1)),((0,1,0,1))], | |
[((0,0,0,1)),((1,0,0,1)),((1,2,0,1)),((0,1,0,1))], | |
[((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((-1,1,0,1))] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// super class | |
import java.util.ArrayList; | |
class GraphicsObject { | |
PVector pos; | |
int overthreshold = 2; | |
GraphicsObject(PVector _pos) { | |
pos = _pos; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xml.dom import minidom | |
from urllib.parse import urlencode | |
from urllib.request import urlopen | |
import base64 | |
import os | |
def upload_image(path_to_image): | |
url = 'http://api.imgur.com/2/upload.xml' | |
apikey = '-------- your API key ---------' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to_hash = (pairs) -> | |
hash = {} | |
hash[key] = value for [key, value] in pairs | |
hash | |
# usage: | |
to_hash ([n, n * n] for n in [0..5]) # {0:0, 1:1, 2:4, 3:9, 4:16, 5:25} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vertex_color_from_z_height.py | |
import bpy | |
import random | |
from mathutils import Color, Vector | |
def remap(current, lower_old, upper_old, lower_new, upper_new): | |
''' | |
Remaps one range of values to another range of values, types must be float | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.linuxhomenetworking.com/forums/showthread.php/1095-Linux-console-Colors-And-Other-Trick-s | |
def printWarning(input): | |
print("\033[31m%s\033[0m" % input) | |
def funkyprint(input): | |
print("\033[36m%s\033[0m" % input) |
OlderNewer