Wednesday, April 25, 2012

ANALYSE SURFACE WITH POINTS




###SCRIPT ABOUT ANALYSE CURVE WITH POINTS###

import rhinoscriptsyntax as rs

from math import*
from System.Drawing import Color

#TO DRAW SURFACE FROM POINTS
#rs.AddSrfPtGrid()

#TO SAMPLE SURFACE
#rs.EvaluateSurface(SURFACE, U , V )

#rs.SurfaceDomain()

xy=360/20,60-5
Count01 = 0

Pts=[]
for i in range(0,360,20):
    Pts01 = []
    Count02=0
    for j in range(5,60):
        x = j
        y = cos(j)
        z = i/(2*j)
        Pts.append([x,y,z])
        Count02 = Count02+1
    Count01 = Count01+1
#i needed to put counters in order to make the tuple needed
# count

Surf = rs.AddSrfPtGrid((Count01,Count02),Pts)

NewLay = rs.AddLayer("surfaces",Color.Red)
SurfLay = rs.ObjectLayer(Surf,"surfaces")

DomainU = rs.SurfaceDomain(Surf,0)
DomainV = rs.SurfaceDomain(Surf,1)

U = DomainU[1]/10
V = DomainV[1]/30

Pts = []

for i in range(0,10+1):
    for j in range(0,30+1):
        EvalSurf = rs.EvaluateSurface(Surf,i*U,j*V)
        Pts = rs.AddPoint(EvalSurf)

No comments:

Post a Comment