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
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
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
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
""" | |
usage: mks_901p.py [-h] [--find_baud] [--baud BAUD] [-unit] serial_port | |
positional arguments: | |
serial_port the Windows COM port or path to a linux serial port | |
optional arguments: | |
-h, --help show this help message and exit | |
--find_baud tries to access the sensor over all supported baud rates, | |
prints which is successful |
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
__license__ = """ | |
This library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Lesser General Public License as | |
published by the Free Software Foundation; either version 2.1 of the | |
License, or (at your option) any later version. | |
As a special exception, the copyright holders of this library | |
hereby recind Section 3 of the GNU Lesser General Public License. This | |
means that you MAY NOT apply the terms of the ordinary GNU General | |
Public License instead of this License to any given copy of the |
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
# -*- coding: utf-8 -*- | |
""" | |
Convert a dir of image files to a GDS file, all packed in together | |
""" | |
import os | |
import cv2 | |
import sys | |
import math | |
from gdsCAD import * |
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
#!/usr/bin/python | |
""" image 2 FIB and FIB 2 image | |
Usage: | |
convert_fib_str.py fromstr <str> [--video] [--out=<out_file_path>] | |
convert_fib_str.py tostr <image> [--out=<out_file_path>] [--stretch] [--invert] | |
""" | |
# from __future__ import print_function | |
import traceback | |
import sys | |
import math |
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 python_brlcad_tcl.brlcad_tcl import * | |
class rounded_cube(BrlCadModel): | |
def __init__(self, brl_db): | |
super(rounded_cube, self). __init__(brl_db) | |
self.center_name = None | |
self.edge = 10 | |
c1 = [0, 0, 0] | |
c2 = [self.edge, self.edge, self.edge] |
NewerOlder