簡體   English   中英

具有特定半徑的球體的 VTK/Paraview 可編程源

[英]VTK/Paraview Programmable source for spheres with specific radius

我想可視化一個球體列表,每個球體都有其特定的半徑。 我遇到了同樣的問題,但我用@Nico vuaille 的https://stackoverflow.com/users/10219194/nico-vuaille回答解決了這個問題:

import vtk
from random import uniform
points = vtk.vtkPoints()
lines = vtk.vtkCellArray()
widths = vtk.vtkDoubleArray()
widths.SetName("width")

for i in range(60):
  pt1 = points.InsertNextPoint(uniform(0, 100), uniform(0, 100), 0)
  pt2 = points.InsertNextPoint(uniform(0, 100), uniform(0, 100), 0)
  w = uniform(0,3)
  widths.InsertNextValue(w)
  widths.InsertNextValue(w)
  lines.InsertNextCell(2, [pt1, pt2])

output.SetPoints(points)
output.GetPointData().AddArray(widths)
output.SetLines(lines)

但是,我無法對球體做同樣的事情,因為我找不到“球體”過濾器。 預先感謝您的幫助,最好的問候,哈米德·拉賈比。

在 ParaView 中,您可以使用Glyph過濾器。 它在給定點上顯示預定義的幾何圖形。 您可以使用預定義的形狀(例如球體)。 或者您也可以通過使用Glyph with custom Source來使用您自己的幾何圖形。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM