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
void drawPoly(float x, float y, float radius, int numEdges) { | |
float arc = TWO_PI / numEdges; | |
beginShape(); | |
for (int i=0; i<numEdges; i++) { | |
float a = arc * i; | |
float px = x + cos(a) * radius; | |
float py = y + sin(a) * radius; |
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
### Module | |
from robofab.world import OpenFont | |
### Functions | |
def drawCon(con): | |
bezierPath = BezierPath() | |
# Iteration over segments | |
for seg in con: |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
################################################# | |
# Organizing images by dominant colors with PIL # | |
################################################# | |
### Modules | |
from PIL import Image, ImageStat | |
import os |
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
################################ | |
# Gaze positions visualization # | |
################################ | |
### Modules | |
import numpy | |
import sys | |
from operator import itemgetter | |
### Functions |
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
# Copyright (c) 2013, Federico Antonini e Roberto Arista | |
# MIT License | |
# Hapax script | |
### Opening libraries | |
import string | |
import re | |
import sys | |
from operator import itemgetter |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
############# | |
# Zip ufos! # | |
############# | |
### Modules | |
import zipfile | |
import os |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
################# | |
# Color manager # | |
################# | |
### Modules | |
from vanilla import Window, Group, ColorWell, TextBox, HorizontalLine | |
from AppKit import NSColor |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
##################### | |
# Adding smart sets # | |
##################### | |
### Modules | |
import os | |
from mojo.UI import SmartSet, addSmartSet |
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
############################## | |
# Draw Wiggles using Drawbot # | |
############################## | |
""" | |
Script by Roberto Arista, you can find the related tutorial here: https://medium.com/@roberto_arista/how-to-draw-a-wiggle-between-two-points-with-python-and-drawbot-788006c18fb0 | |
You can find drawbot here: http://www.drawbot.com/ | |
Code distributed with no guarantee, use at your own risk | |
""" |
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 fontParts.world as fp | |
from fontTools.pens.cocoaPen import CocoaPen | |
def drawGlyph(glyph): | |
pen = CocoaPen(glyph.getParent()) | |
glyph.draw(pen) | |
path = pen.path | |
glyphPath = BezierPath(path=path) | |
drawPath(glyphPath) | |
OlderNewer