Skip to content

Instantly share code, notes, and snippets.

Avatar

Roberto Arista roberto-arista

View GitHub Profile
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;
@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:
@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 / 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 / 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 / hapaxator.py
Last active Aug 29, 2015
This script is able to reorder by occurrences a txt file. It returns two different txt files, words and punctuation. It is possible to choose the direction of the ordering action: increasing or decreasing.
View hapaxator.py
# Copyright (c) 2013, Federico Antonini e Roberto Arista
# MIT License
# Hapax script
### Opening libraries
import string
import re
import sys
from operator import itemgetter
View zip_ufos.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#############
# Zip ufos! #
#############
### Modules
import zipfile
import os
@roberto-arista
roberto-arista / colorManager.py
Created Feb 25, 2015
Vanilla color manager for Robofont font editor
View colorManager.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#################
# Color manager #
#################
### Modules
from vanilla import Window, Group, ColorWell, TextBox, HorizontalLine
from AppKit import NSColor
@roberto-arista
roberto-arista / adding_smart_set.py
Created Feb 25, 2015
Adding smart sets to Robofont
View adding_smart_set.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#####################
# Adding smart sets #
#####################
### Modules
import os
from mojo.UI import SmartSet, addSmartSet
@roberto-arista
roberto-arista / drawWiggle.py
Created Apr 17, 2017
Draw wiggles using Python and Drawbot
View drawWiggle.py
##############################
# 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
"""