Function to scale according to the area ratio in rhinoscriptsyntax

I want to scale surface based on the area ratio.
I expect following function.
function(srf_id, area_ratio)
If I specify area_ratio = 0.5, returned geometry by this function have the half of the area compared to original one.

If you want to scale something you not only need a scale factor, you also need an origin point. The rhinoscriptsyntax method is rs.ScaleObject() - single guid, or rs.ScaleObjects() - guid list. the arguments are essentially the same.


All the rhinoscriptsyntax methods can be found here, or if you are in the editor, F1 will call the help.


Thank you for your answer.
I think these functions can scale the length. But what I want to find is the function which can scale the object based on the area. Say, if I want to scale down the object 1m2 to 0.5m2, the function gonna be something like below.

Do you have any idea whether I can find these function or create?

To get the length scale factor, you need the square root of the desired area scale factor:

import rhinoscriptsyntax as rs
from math import sqrt

obj=rs.GetObject("Select object to scale")
print "Orig. area: {}, New area: {} Area ratio: {}".format(a0,a1,a1/a0)


1 Like