Skip to content

Instantly share code, notes, and snippets.

Avatar

Roberto Arista roberto-arista

View GitHub Profile
@roberto-arista
roberto-arista / gazePosition_visualization.py
Last active Aug 29, 2015
A Python/Drawbot script able to visualize gaze_position.npy by Pupil Capture eye-tracker
View gazePosition_visualization.py
################################
# Gaze positions visualization #
################################
### Modules
import numpy
import sys
from operator import itemgetter
### Functions
@roberto-arista
roberto-arista / dominanti_cromatiche.py
Last active Aug 29, 2015
This script helps you dividing raster images by dominant colors. You can modify the benchmark_colors dictionary as you wish. Dependencies: PIL
View dominanti_cromatiche.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#################################################
# Organizing images by dominant colors with PIL #
#################################################
### Modules
from PIL import Image, ImageStat
import os
@roberto-arista
roberto-arista / typefaceOrientedGrid.py
Last active Sep 12, 2020
Typeface Oriented Grid Generator – open with Drawbot and launch!
View typefaceOrientedGrid.py
####################################
# Typeface oriented grid generator #
####################################
"""
Usage:
- open .py file with Drawbot (drawbot.readthedocs.org) and launch
- use what the script prints out to set your InDesign document
"""
@roberto-arista
roberto-arista / fromUfoToDrawbot.py
Last active Aug 29, 2015
From UFO Robofab to Drawbot context
View fromUfoToDrawbot.py
### Module
from robofab.world import OpenFont
### Functions
def drawCon(con):
bezierPath = BezierPath()
# Iteration over segments
for seg in con:
View drawPoly.pde
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;