[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    [vtkusers] numpy_to_vtk and vtkPolyData
From:       Philip Winston <pwinston () gmail ! com>
Date:       2011-10-29 20:48:39
Message-ID: CA+bxaPQdtf6CqkHF5uCaZn0xEc1jtQXkWnKt7SewzwUiEnzRgA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Are there any examples showing how to populate a vtkPolyData with
verts/triangles from numpy arrays?

I have a solution right now where I loop through by hand adding points and
triangles, but it is slow.

I see there is a numpy_to_vtk utility function, but I'm not clear how to
setup my numpy arrays and what vtkPolyData functions I need to call.  I'm
imagining I want one Nx3 array with a vert per row (X Y Z).  And a second
Nx3 array of vert indexes with one triangle per row (v1 v2 v3)?  But I can
create whatever numpy arrays are needed, I just need help slurping them
into a vtkPolyData.

Thanks!

-Philip

[Attachment #5 (text/html)]

<div>Are there any examples showing how to=A0populate a vtkPolyData with ve=
rts/triangles from numpy arrays?=A0</div><div><br></div><div>I have a solut=
ion right now where I loop through by hand adding points and triangles, but=
 it is slow.</div>

<div><br></div><div>I see there is a numpy_to_vtk utility function, but I&#=
39;m not clear how to setup my numpy arrays and what vtkPolyData functions =
I need to call. =A0I&#39;m imagining I want one Nx3 array=A0with a vert per=
 row (X Y Z). =A0And a second Nx3 array of vert indexes with one triangle p=
er row (v1 v2 v3)? =A0But I can create whatever numpy arrays are needed, I =
just need help slurping them into a vtkPolyData.<br>

<br></div><div>Thanks!</div><div><br></div><div>-Philip</div><br>


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic