create multiple polylines given a set of points using vtk

时间秒杀一切 提交于 2019-12-04 16:59:23

The problem is in the iteration logic:

for i in range(indStart, indEnd):
    aPolyLine.GetPointIds().SetId(i, i)

Must be changed to the following:

for i in range(indStart, indEnd):
    aPolyLine.GetPointIds().SetId(i - indStart, i)

The original code was calling SetId with an incorrect index. Also, note the shadowed variable i. Although that's not what's causing the issue, if you use i after the second for loop, the result may not be what you'd be expecting.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!