Skip to content

Instantly share code, notes, and snippets.

View zeffii's full-sized avatar

Dealga McArdle zeffii

View GitHub Profile
@zeffii
zeffii / PostScriptParsing_002.py
Created November 20, 2011 22:01
PostScrip Parser from Python to javascript.
'''
20 Nov, Dealga McArdle. 2011
This script is released under the MIT license. With no warranty/support of any kind.
PostScript to javascript/paperjs converter written in Python. It should be
obvious to anyone with a brain that Adobe and PostScript are registered trademarks.
The Adobe PostScript References, PLRM.pdf, is available for free from their site.
Their TOC implies that it's OK to write programs that parse their .ps filetype.
I plan to support commands as i encounter them.
@zeffii
zeffii / PostScriptParsing_003.py
Created November 21, 2011 14:29
Parses PostScripts and autosorts paths when in compoundPath mode
'''
20 Nov, Dealga McArdle. 2011
This script is released under the MIT license. With no warranty/support of any kind.
PostScript to javascript/paperjs converter written in Python. It should be
obvious to anyone with a brain that Adobe and PostScript are registered trademarks.
The Adobe PostScript References, PLRM.pdf, is available for free from their site.
Their TOC implies that it's OK to write programs that parse their .ps filetype. I plan
to support commands as i encounter them.
@zeffii
zeffii / drawing_hand3.ps
Created November 21, 2011 14:37
PostScript Example
%!PS-Adobe-3.0
%%Creator: cairo 1.10.2 (http://cairographics.org)
%%CreationDate: Sun Nov 20 23:46:08 2011
%%Pages: 1
%%BoundingBox: 0 0 757 126
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%DocumentMedia: 267x44mm 757 126 0 () ()
%%EndComments
%%BeginProlog
@zeffii
zeffii / PostScriptParsing_004.py
Created November 21, 2011 16:52
PostScript to javascript/paperjs using Python
'''
20 Nov, Dealga McArdle. 2011
This script is released under the MIT license. With no warranty/support of any kind.
PostScript to javascript/paperjs converter written in Python. It should be
obvious to anyone with a brain that Adobe and PostScript are registered trademarks.
The Adobe PostScript References, PLRM.pdf, is available for free from their site.
Their TOC implies that it's OK to write programs that parse their .ps filetype. I plan
to support commands as i encounter them.
@zeffii
zeffii / drawing_hand3.ps
Created November 21, 2011 16:59
different typeface for python demo
%!PS-Adobe-3.0
%%Creator: cairo 1.10.2 (http://cairographics.org)
%%CreationDate: Sun Nov 20 23:46:08 2011
%%Pages: 1
%%BoundingBox: 0 0 757 126
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%DocumentMedia: 267x44mm 757 126 0 () ()
%%EndComments
%%BeginProlog
@zeffii
zeffii / works
Created December 1, 2011 22:04
lame_sketch1
size(400,400);
background(0);
noFill();
stroke(255);
for (int i = 90; i < 270; i++){
PVector coordinate = new PVector(cos(radians(i))*150, sin(radians(i))*150);
point(coordinate.x+200, coordinate.y+200);
@zeffii
zeffii / lamesketch2
Created December 1, 2011 22:07
does not work
size(400,400);
background(0);
noFill();
stroke(255);
for (int i = 90; i < 270; i++){
PVector coordinate = getVectorFromDegree(i);
point(coordinate.x+200, coordinate.y+200);
@zeffii
zeffii / YAY
Created December 1, 2011 22:15
works
void setup() {
size(400, 400);
background(0);
noFill();
stroke(255);
}
void draw() {
beginShape();
for (int i = 90; i < 270; i++) {
@zeffii
zeffii / example_modified.pde
Created December 9, 2011 22:15
super class and inheritance
// super class
import java.util.ArrayList;
class GraphicsObject {
PVector pos;
int overthreshold = 2;
GraphicsObject(PVector _pos) {
pos = _pos;
}
@zeffii
zeffii / vtx.py
Created December 12, 2011 17:09
CAD tool
'''
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