Skip to content

Instantly share code, notes, and snippets.

@yasushisakai
Created November 27, 2013 16:53
Show Gist options
  • Save yasushisakai/7679119 to your computer and use it in GitHub Desktop.
Save yasushisakai/7679119 to your computer and use it in GitHub Desktop.
deletes short crap curves
import rhinoscriptsyntax as rs
threshold = 5 # curves under this length will be deleted
cnt = 0
for o in rs.AllObjects():
crv = rs.coercecurve(o)
if crv is not None:
length = rs.CurveLength(o)
if length < threshold:
rs.DeleteObject(o)
cnt += 1
print '...deleted %d short curves' % cnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment