Skip to content

Instantly share code, notes, and snippets.

import rhinoscriptsyntax as rs
import Rhino
import scriptcontext as sc
import System.Drawing.Color
import itertools
class ConnectorConduit(Rhino.Display.DisplayConduit):
def __init__(self, lines):
self.lines = lines
import rhinoscriptsyntax as rs
import Rhino
import scriptcontext as sc
import math
import System
def CalculateTargets(Grevs, srf, crv):
pi = math.pi
tPlanes = []
import rhinoscriptsyntax as rs
import Rhino
import scriptcontext as sc
import System.Drawing as drawing
def SubCrvFromMid():
crvColor = Rhino.ApplicationSettings.AppearanceSettings.TrackingColor
oRef = rs.GetObject("Select a curve to shorten.",4, preselect=True, subobjects=True)
if not oRef: return
import Rhino
import scriptcontext as sc
import rhinoscriptsyntax as rs
import math
class GO_FilterPrevious(Rhino.Input.Custom.GetObject):
#Make sure not to allow selection of previously
#dogboned curves in the same run of the script
def __init__(self, ids):
self.m_ids = ids
@pgolay
pgolay / SelOuterPoints.py
Last active June 7, 2019 17:26
Select the outer user set number of points from a curve or surface, optionally the inverse
import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc
def SelOuterPoints():
ids = None
while True:
maxPts = 1
if sc.sticky.has_key('MAX_OUTER_PTS'):
maxPts = sc.sticky['MAX_OUTER_PTS']
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
import math
def SetArcRadians():
pi = math.pi
def arc_filter( rhino_object, geometry, component_index):
return geometry.IsArc()
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
def SetArcDegrees():
def arc_filter( rhino_object, geometry, component_index):
return geometry.IsArc()
looped = False
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
def SetArcLength():
def arc_filter( rhino_object, geometry, component_index):
return geometry.IsArc()
looped = False
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
def SetLineLength():
def line_filter( rhino_object, geometry, component_index):
if geometry.IsLinear():
return True
return False
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
def ChamferCorner():
tol = sc.doc.ModelAbsoluteTolerance
def VertexFilter( rhino_object, geometry, component_index):
if component_index.ComponentIndexType == Rhino.Geometry.ComponentIndexType.BrepVertex:
return True