Created
October 8, 2011 16:52
-
-
Save sbaer/1272538 to your computer and use it in GitHub Desktop.
ghpython script for creating data trees
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rhinoscriptsyntax as rs | |
import Rhino | |
import clr | |
clr.AddReference("grasshopper") | |
import Grasshopper as gh | |
DomainU = rs.SurfaceDomain(srf, 0) | |
DomainV = rs.SurfaceDomain(srf, 1) | |
flatlist = [] | |
tree = gh.DataTree[Rhino.Geometry.Point3d]() | |
for i in range(U): | |
path = gh.Kernel.Data.GH_Path(i) | |
for j in range(V): | |
ParamU = DomainU[0] + i*(DomainU[1] - DomainU[0])/(U+1) | |
ParamV = DomainV[0] + j*(DomainV[1] - DomainV[0])/(V+1) | |
point = rs.EvaluateSurface(srf, ParamU, ParamV) | |
flatlist.append(point) | |
tree.Add(point,path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment