Skip to content

Instantly share code, notes, and snippets.

Avatar

Philip Belesky philipbelesky

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am philipbelesky on github.
  • I am philipbelesky (https://keybase.io/philipbelesky) on keybase.
  • I have a public key whose fingerprint is 7427 CF02 819A 0753 19CE 426A B7BF 838F 4B82 A206

To claim this, I am signing this object:

@philipbelesky
philipbelesky / gist:9472982
Created Mar 10, 2014
An attempt at easier GhPython Profiling
View gist:9472982
import rhinoscriptsyntax as rs
if debug:
# debug is a Boolean input I use for each GhPython component - it toggles messages/debug info
from System.Diagnostics import Stopwatch as sw
profiling = ['========']
timing = 0
total = sw.StartNew()
class Timer(object):
@philipbelesky
philipbelesky / RhinoOnLoad.rvb
Created Aug 24, 2015
Automatically open a Rhino file and Grasshopper file upon load
View RhinoOnLoad.rvb
'Automatically open a Rhino file and Grasshopper file upon start
'Setup via File > Properties > Rhino Options > RhinoScript > Startup Scripts
Call Rhino.Command("_Open C:\Users\YourName\TheRhinoDocument.3dm")
Call Rhino.Command("_Grasshopper")
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.DisableBanner()
Call GH.ShowEditor()
Call Rhino.Print("Loaded:" & GH.IsEditorLoaded())
Call Rhino.Print("Visible:" & GH.IsEditorVisible())
@philipbelesky
philipbelesky / moult.py
Created Nov 23, 2015
Traverses a Grasshopper XML definition(.ghx) and extracts VB/C#/Python components to separate individual .vb/.cs/.py files
View moult.py
from xml.etree.ElementTree import ElementTree
import os
def ProcessGHXFile(definition_path, base_filename):
# Loads the file and sets up the XML parser
the_file = open(definition_path)
the_directory = os.path.dirname(definition_path)
the_tree = ElementTree()
the_tree.parse(the_file)
IsolateTheScript(the_tree, the_directory, base_filename)
View flow-lines.txt
THESIS
#1
IF EQ -1 P 0: $ 7
P.N T; X P 0; Y P 1; Z P 2
$ 2; T + T 1
IF == T PARAM: T 0
T 0
View flow-lines-setup
THESIS GRID SETUP
#1
#2
X 0; Y 0; Z 0; A 0; B 12
L 0 83: $ 5