Grasshopper

algorithmic modeling for Rhino

I'm scripting in python and I'm trying to extract the vertices of the polysurface. Does anyone know command to extract the vertices of a polysurface or a single surfaces? or a way around it?

I know this can be done with the explode component in grasshopper but I need to do it inside the python component.


thanks,

M

Views: 1247

Replies to This Discussion

I figured it out.

surfaces = rs.ExplodePolysurfaces(primitive)

crv = []
pts = []
for i in range(0,len(surfaces)):
crv_extract = rs.DuplicateEdgeCurves(surfaces[i])
crv.extend(crv_extract)

for i in range(0,len(crv)):
domain = rs.CurveDomain(crv[i])
pt_start = rs.EvaluateCurve(crv[i],domain[0])
pt_end = rs.EvaluateCurve(crv[i],domain[1])
pts.append(pt_start)
pts.append(pt_end)

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service