Paraview create line segments from CSV with “width” data

假如想象 提交于 2021-01-07 03:55:46

问题


I want to create line segments in Paraview. The format of my input data for each line segment is as: x0,y0,z0,x1,y1,z1,width I have tried using "Line" command like:

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

But, I can't find a way to specify the width to each line segment. Your help will be much appreciated. Best Regards, Hamid Rajabi.


回答1:


The Line object does not know about the width. It is only a list of connected points. The width is a parameter of the representation. You can try something like that:

# 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


来源:https://stackoverflow.com/questions/64139157/paraview-create-line-segments-from-csv-with-width-data

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