我有一个导航网(如所附图片所示)。导航网格由曲线和数组修饰符组成。因为它有一个数组修饰符,所以它由平面字符串组成(当我切换到“编辑模式”时我会看到它)。
我的问题是,我能在导航网格上迭代得到导航网格中每个小平面的长度和中心坐标吗?如果是,请给我一些基于python的例子。提前感谢!

发布于 2015-09-29 11:32:48
每个小平面都是网格的面,遍历对象网格数据上的多边形提供了对面部中心坐标的访问。
import bpy, mathutils
plane = bpy.data.objects["Plane"]
previous = None
for poly in plane.data.polygons:
center = mathutils.Vector(poly.center)
if previous:
previous -= center
#print length and center
print(previous.length, center)
previous = centerhttps://stackoverflow.com/questions/31605829
复制相似问题