2010-04-13から1日間の記事一覧

vtkで任意の向きの円柱をつくる

actorの例として, 円柱を作ってみる. def create_cylinder(radius, height, res=30): cylinder = vtk.vtkCylinderSource() cylinder.SetResolution(res) cylinder.SetHeight(height) cylinder.SetRadius(radius) mapper = vtk.vtkPolyDataMapper() mapper.Se…

Pythonでvtkを使ってみる

以下のリンクを参考にvtkなど使っている. 詳しく無いのでこのやり方が正しいのかどうかはわからないが, とりあえず動く. http://home.hiroshima-u.ac.jp/~tyoshida/pyukiwiki/?vtk import vtk renderer = vtk.vtkRenderer() for actor in actors: renderer.A…