''' scale function for surfaces
''' —-

Function scalesurface (strsurface, xScale, yScale, zScale)

Dim strscale, domu, domv, paramu, paramv

domu = Rhino.SurfaceDomain(strsurface,0) 'gets the surface domain
domv = Rhino.SurfaceDomain(strsurface,1)

paramu = domu(0) + ((domu(1) - domu(0)) / 2)
paramv = domv(0) + ((domv(1) - domv(0)) / 2)

Dim centerpt: centerpt = Rhino.EvaluateSurface(strsurface, Array(paramu, paramv))
'calculate the surface centerpoint
Call Rhino.AddPoint (centerpt)

Call Rhino.ScaleObject (strsurface, centerpt, Array(xScale, yScale, zScale), False)
'scales the surfaces

End Function

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License