#! python 2 # coding=UTF8 import rhinoscriptsyntax as rs import random as ran allobjs = rs.AllObjects() #alle objekte in einer Variable hinein Plaziert rs.DeleteObjects(allobjs) #delete everything and start from scratch bsize = 10 #side length of box dist = 1 #distance between boxes offs = bsize + dist # offstet of boxes num = 10 # number of boxes in one row rs.EnableRedraw(False) #create a box corners = [(0,0,0), (bsize,0,0), (bsize,bsize,0), (0,bsize,0), (0,0,bsize), (bsize,0,bsize), (bsize,bsize,bsize), (0,bsize,bsize)] """ my_c = rs.AddLine((0,0,0), (200,30,0)) my_c = rs.AddCurve([[0,0,0],[100,200,0],[200,-200,0],[300,200,300],[500,-300,0],[800,100,0]],3) pts = rs.DivideCurve(my_c,50,True,True) #Anzahl an Punkten wird hier mehr oder weniger gemacht point0 = (0,0,0) point1 = (0,0,80) pitch = 1 turns = 15 radius0 = 5.0 radius1 = 20.0 rs.AddSpiral(point0, point1, pitch, turns, radius0, radius1) for p in pts: mybox = rs.AddBox(corners) rs.MoveObject(mybox,(-bsize/2,-bsize/2,0)) #zentrum der punkte sind die boxen rs.MoveObject(mybox, p) """ myblob = rs.ObjectsByLayer("blob")[0] plane = rs.WorldXYPlane() for i in range (100): #die zahl in (zahl) ist wie oft sollen die boxen da sien xran = ran.randint(0,100) yran = ran.randint(0,300) zran = 0 if not(rs.PointInPlanarClosedCurve([xran,yran,zran],myblob,plane,0)): mybox = rs.AddBox(corners) rs.MoveObject(mybox, [xran,yran,zran])