Paraview 使用 "width" 数据从 CSV 创建线段

Paraview create line segments from CSV with "width" data

我想在 Paraview 中创建线段。每条线段的输入数据格式如下: x0,y0,z0,x1,y1,z1,宽度 我尝试使用“Line”命令,例如:

    for i in range(600):
      l = Line(Point1=(uniform(0,100),uniform(0,100),0),Point2=(uniform(0,100),uniform(0,100),0))

但是,我找不到指定每条线段宽度的方法。 非常感谢您的帮助。 最好的祝福, 哈米德·拉贾比。

Line 对象不知道 width。它只是连接点的列表。 width 是表示的参数。你可以尝试这样的事情:

# get active view
renderView1 = GetActiveViewOrCreate('RenderView')

for i in range(600):
  l = Line(Point1=(uniform(0,100),uniform(0,100),0),Point2=(uniform(0,100),uniform(0,100),0))
  # get display properties
  line1Display = GetDisplayProperties(l, view=renderView1)

  # Properties modified on line1Display
  line1Display.LineWidth = 4.0