RhinoでGrasshopperでPythonを使う1-2

ランダムを使う、スライダーの数値を使う

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
import random as rdm

lines = []
for i in range(0,int(x)):
    p2 = rg.Point3d(rdm.uniform(0,640), rdm.uniform(0,640), rdm.uniform(0,640))
    p1 = rg.Point3d(rdm.uniform(0,640), rdm.uniform(0,640), rdm.uniform(0,640))
    line = rs.AddLine(p1,p2)
    lines.append(line)

a = lines

Comments are closed.