Option Explicit
run Rhino.GetObject("select a surface", 8)
FUNCTION run(sf)
DIM i,j,p(),mm,nn,uDomain,vDomain,spanMM,spanNN
mm=8 : nn=10 '分段数
uDomain=Rhino.SurfaceDomain (sf, 0)
vDomain=Rhino.SurfaceDomain (sf, 1)
REDIM p((mm+1)*(nn+1)-1)
spanMM=(uDomain(1)-uDomain(0))/mm
spanNN=(vDomain(1)-vDomain(0))/nn
FOR i=0 TO mm
FOR j=0 TO nn
p(i*(nn+1)+j)=Rhino.EvaluateSurface (sf, Array(i*spanMM,j*spanNN))
Rhino.AddSphere p(i*(nn+1)+j), 3
NEXT
NEXT
'横杆
FOR i=0 TO mm
FOR j=0 TO nn-1
Rhino.AddCylinder p(i*(nn+1)+j), p(i*(nn+1)+j+1), 0.7
NEXT
NEXT
'斜杆
FOR i=0 TO mm-1
FOR j=0 TO nn-1
Rhino.AddCylinder p(i*(nn+1)+j), p((i+1)*(nn+1)+j+1), 0.7
NEXT
NEXT
'纵杆
FOR i=0 TO mm-1
FOR j=0 TO nn
Rhino.AddCylinder p(i*(nn+1)+j), p((i+1)*(nn+1)+j), 0.7
NEXT
NEXT
Rhino.DeleteObject sf
END FUNCTION