计算闭合曲面或多重曲面的体积惯性距。获取更多信息,请参考 Rhino 帮助文件中体积质量属性的部分。
rhinoscriptsyntax.SurfaceVolumeMoments (surface_id)
rhinoscript.surface.SurfaceVolumeMoments (surface_id)
surface_id |
必须参数。字符串或 Guid。物件的 ID 。 |
元组 |
执行成功返回包含体积力矩信息的元组。数组包含以下信息:
|
||||||||||||||||||||||||||||||||||||||||||
None |
如果执行不成功或出错,返回空值。 |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a surface", rs.filter.polysurface)
if rs.IsPolysurfaceClosed(obj):
massprop = rs.SurfaceVolumeMoments(obj)
if massprop:
print "Volume Moments of Inertia about the World Coordinate Axes:", massprop[6]