Hello,
In Python, I have an object of the following type:
your_mesh
<stl.mesh.Mesh object at 0x7fb108f06160>
>>> your_mesh.points
array([[ 250., -475., -100., -250., -475., -100., -250., -475., 1900.],
[ 250., -475., -100., -250., -475., 1900., 250., -475., 1900.],
[ 250., -515., -100., 250., -475., -100., 250., -475., 1900.],
[ 250., -515., -100., 250., -475., 1900., 250., -515., 1900.],
[-250., -515., -100., 250., -515., -100., 250., -515., 1900.],
[-250., -515., -100., 250., -515., 1900., -250., -515., 1900.],
[-250., -475., -100., -250., -515., -100., -250., -515., 1900.],
[-250., -475., -100., -250., -515., 1900., -250., -475., 1900.],
[-250., -515., -100., 250., -475., -100., 250., -515., -100.],
[-250., -475., -100., 250., -475., -100., -250., -515., -100.],
[ 250., -475., 1900., -250., -515., 1900., 250., -515., 1900.],
[ 250., -475., 1900., -250., -475., 1900., -250., -515., 1900.]],
dtype=float32)
>>> your_mesh.normals
array([[ 0., 1000000., 0.],
[ 0., 1000000., -0.],
[ 80000., 0., 0.],
[ 80000., 0., 0.],
[ 0., -1000000., 0.],
[ 0., -1000000., 0.],
[ -80000., 0., 0.],
[ -80000., 0., 0.],
[ 0., 0., -20000.],
[ 0., 0., -20000.],
[ 0., 0., 20000.],
[ 0., 0., 20000.]], dtype=float32)
And I was wondering if there is any short way to convert it to a vtkPolyData format, using Python. Something like:
import vtk
myData = vtk.vtkPolyData(your_mesh.points, your_mesh.normals)
Thanks in advance!