大家好,如图是目前的rhino中的一个mesh,我的问题是:
如何取出该mesh的控制点,并简化至千数级个点
目前我想到的方法是将mesh转为nurbs曲面,并用以下的python语言进行取点,
# Creates an array of points on a surface
import rhinoscriptsyntax as rs
def ArrayPointsOnSurface():
# Get the surface object
surface_id = rs.GetObject("Select surface", rs.filter.surface)
if surface_id is None: return
# Get the number of rows
rows = rs.GetInteger("Number of rows", 2, 2)
if rows is None: return
# Get the number of columns
columns = rs.GetInteger("Number of columns", 2, 2)
if columns is None: return
# Get the domain of the surface
U = rs.SurfaceDomain(surface_id, 0)
V = rs.SurfaceDomain(surface_id, 1)
if U is None or V is None: return
# Add the points
for i in xrange(0,rows):
param0 = U[0] + (((U[1] - U[0]) / (rows-1)) * i)
for j in xrange(0,columns):
param1 = V[0] + (((V[1] - V[0]) / (columns-1)) * j)
point = rs.EvaluateSurface(surface_id, param0, param1)
rs.AddPoint(point)
# Check to see if this file is being executed as the "main" python
# script instead of being used as a module by some other python script
# This allows us to use the module which ever way we want.
if __name__ == "__main__":
# call the function defined above
ArrayPointsOnSurface()
但是苦于mesh与nurbs之间的转化,并且我也不确定我的想法是否合适?
不知道大家有没有更好的想法? 或者其他的建议?
谢谢!





