Skip to content

Instantly share code, notes, and snippets.

View tedyapo's full-sized avatar
🏠
Looking for work

Teddy Yapo tedyapo

🏠
Looking for work
View GitHub Profile
@tedyapo
tedyapo / simple_dxf_polygon.py
Created February 28, 2024 18:30
create a DXF file containing a single polygon
import numpy as np
class DXFPolygon:
def __init__(self, x, y):
self.x = x
self.y = y
def write(self, filename):
x = self.x
y = self.y
with open(filename, 'wt') as fout:
// chirp screw: parameterized on 0 <= t <= 1
t_steps = 500;
major_d = 50;
major_facets = 71;
minor_d = 4;
minor_facets = 17;
#!/usr/bin/env python3
#
# excitation coil model
#
import loopfield as lf
# field object
field = lf.Field(length_units = lf.mm,
@tedyapo
tedyapo / decode-11801-screenshot.py
Last active December 20, 2019 22:20
Tektronix 11801 Screen Capture
#!/usr/bin/env python3
import sys
import re
import datetime
from PIL import Image
import serial
import subprocess
device = '/dev/ttyUSB0'
@tedyapo
tedyapo / bin2logisim.py
Last active April 5, 2024 20:09
Convert between logisim RAM/ROM data files and binary files
#!/usr/bin/env python3
#
# logisim <-> binary converter
#
# rename script to logisim2bin.py to convert the other way
#
# this software is in the public domain
#