#RhinoPython
Explore tagged Tumblr posts
Text
scripted scribble 03
15 notes
·
View notes
Text
[sk.01]_PointCloud to Interpolated Lines Sketch
Pulling data from the random library to set up point cloud.
Connecting the dots between them using Interpolated lines. The sketch is a simple code which generates 3D forms.
import rhinoscriptsyntax as rs import Rhino.Geometry as rg import random as rn
pts = []
for i in range (50): xpos = rn.random() * 25 ypos = rn.random() * 25 zpos = rn.random() * 25 pts.append( (xpos, ypos, zpos) )
pointcloud = rs.AddPointCloud(pts) selObj = rs.SelectObject(pointcloud) rs.Command(“_explode _Enter”) curves = rs.AddInterpCurve(rs.SelectedObjects() ) rs.DeleteObjects(rs.SelectedObjects() ) rs.AddPipe(curves, 0, 4)
0 notes
Text
#-RunPythonScript (K:\PythonPlugins\SelBlockInstancePick.py) import rhinoscriptsyntax as rs blocknames=[] object_ids = rs.GetObjects(message="Pick block instance", filter=4096, preselect=True, select=True, custom_filter=None) for object_id in object_ids: blocknames.append(rs.BlockInstanceName(object_id)) blocknames = set(blocknames) #print blocknames for blockname in blocknames: blocklist = rs.BlockInstances(blockname) rs.EnableRedraw(False) rs.SelectObjects(blocklist) rs.EnableRedraw(True) print blockname+'= '+str(len(blocklist))
0 notes
Photo
#reptileskin #python #code #rhinopython #complexsurface
2 notes
·
View notes
Photo
I have started using rhinopython to bring data into rhino! it's so pretty. this is a map of the free wifi spots in nyc.
0 notes
Photo
Playing with surfaces.
0 notes
Text
scripted scribble 02
1 note
·
View note
Text
#populate blocks import rhinoscriptsyntax as rs objs = rs.GetObjects(message='Select objects to orient: ', filter=0, group=True, preselect=True, select=False, objects=None, minimum_count=1, maximum_count=0, custom_filter=None ) object_Reference_id=rs.GetObject(message='Block of Reference: ', filter=4096, preselect=True, select=False, custom_filter=None, subobjects=False) xform_Reference = rs.BlockInstanceXform(object_Reference_id) plane_Reference = rs.PlaneTransform (rs.WorldXYPlane(), xform_Reference) object_ToPlace_ids=rs.GetObjects(message='Blocks to orient to: ', filter=4096, preselect=False, select=False, custom_filter=None) rs.EnableRedraw(False) for object_ToPlace_id in object_ToPlace_ids: xform_ToPlace = rs.BlockInstanceXform(object_ToPlace_id) plane_ToPlace = rs.PlaneTransform (rs.WorldXYPlane(), xform_ToPlace) transform = rs.XformRotation1(plane_Reference,plane_ToPlace) rs.TransformObjects( objs, transform, True ) rs.EnableRedraw(True)
0 notes
Text
#shuffles selected objects and divides them into n nr of groups import rhinoscriptsyntax from random import shuffle, randint x = rhinoscriptsyntax.GetObjects(message=None, filter=0, group=True, preselect=True, select=False, objects=None, minimum_count=1, maximum_count=0, custom_filter=None) shuffle(x) n = 3 num = float(len(x))/n l = [ x [i:i + int(num)] for i in range(0, (n-1)*int(num), int(num))] l.append(x[(n-1)*int(num):]) for i in range(0,n): randomnumber=randint(0,99999999999) name = rhinoscriptsyntax.AddGroup("NewGroup"+str(randomnumber)) rhinoscriptsyntax.AddObjectsToGroup(l[i],name)
0 notes
Text
#select all instances of a picked block import rhinoscriptsyntax as rs object_id = rs.GetObject(message="Pick block instance", filter=4096, preselect=False, select=False, custom_filter=None, subobjects=False) blockname = rs.BlockInstanceName(object_id) blocklist = rs.BlockInstances(blockname) rs.SelectObjects(blocklist) print blockname
0 notes
Text
#pick existent block and insert it uniformly scaled import rhinoscriptsyntax as rs object_id = rs.GetObject(message="Pick block instance", filter=4096, preselect=False, select=False, custom_filter=None, subobjects=False) blockname = rs.BlockInstanceName(object_id) point = rs.GetPoint(message="Pick inset point:", base_point=None, distance=None, in_plane=False) rs.InsertBlock(blockname, point)
0 notes
Text
rotate blocks by insert point
import rhinoscriptsyntax as rs objects = rs.SelectedObjects() for object in objects: if rs.IsBlockInstance(object): insertpoint = rs.BlockInstanceInsertPoint(object) rs.RotateObject(object,insertpoint,180)
0 notes
Photo
#reptileskin #python #code #rhinopython #complexsurface soft variation
0 notes
Photo
#reptileskin #python #code #rhinopython #complexsurface
0 notes
Photo
Sunday #Rhinopython session #reptileskin #tesselation
0 notes