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
lexer grammar Lexer; | |
fragment WS: [\t ]+; | |
fragment NL: WS? ('\r'* '\n')+; | |
COLON_ATTRIBUTES: ('KeyId' | | |
'first key' | | |
'key' | | |
'key (interesting)' | | |
'key(# of 1second)' | | |
'key.subkey')+ -> mode(COLON_ATTRIBUTES_MODE); |
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
lexer grammar Lexer; | |
fragment WS: [\t ]+; | |
fragment NL: WS? ('\r'* '\n')+; | |
COLON_ATTRIBUTES: ('KeyId' | | |
'first key' | | |
'key' | | |
'key (interesting)' | | |
'key(# of 1second)' | | |
'key.subkey')+ -> mode(COLON_ATTRIBUTES_MODE); |
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 os.path | |
from gdsCAD import * | |
from PIL import Image, ImageDraw | |
#l = core.GdsImport(os.path.abspath("wafer.GDS"), verbose=True) | |
#l2, l4 = utils.split_layers(a, [2,4]) | |
l4_gds = core.GdsImport(os.path.abspath("die5_from_topleft_layer4_slits_shown.GDS"), verbose=True) | |
l2_gds = core.GdsImport(os.path.abspath("die5_from_topleft_layer2_shown.GDS"), verbose=True) |
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
# most of the following code is from here: https://github.com/WoLpH/numpy-stl#combining-multiple-stl-files | |
# but instead of combining STLs, I'm just copying and replicating the same one | |
import math | |
import stl | |
from stl import mesh | |
import numpy | |
# find the max dimensions, so we can know the bounding box, getting the height, width, length (because these are the step size)... | |
def find_mins_maxs(obj): |
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
from antlr4 import CommonTokenStream, InputStream, Token | |
# from mytool.parsers.error_listener import MyErrorListener | |
def getTokensFromText(input_string, MyLexer): | |
input_stream = InputStream(input_string) | |
lexer = MyLexer(input_stream) | |
# lexer.addErrorListener(MyErrorListener) | |
stream = CommonTokenStream(lexer) | |
stream.fill() |
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
''' | |
usage: | |
open_source_layerprops_converter.py /path/to/num_to_names.csv /path/to/output/layerprops.ext -out_format klayout/gds3d/calibre | |
example CSV (not including this line): | |
1,0,metal0,drawing | |
1,2,metal0,via | |
2,0,metal1,drawing | |
''' |
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
class _board(object): | |
def __getattr__(self, *args, **kwargs): | |
return 1 | |
from pyb import Pin as Pin | |
from pyb import I2C as I2C | |
from stm import mem32, mem16, mem8 |
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 xlrd | |
import sys | |
if __name__ == '__main__': | |
if len(sys.argv) != 2: | |
print "Usage: git-xlsx-textconv file.xslx" | |
excelFileName = sys.argv[1] | |
xlFile = xlrd.open_workbook(excelFileName) |
OlderNewer