[Paraview-developers] stl writer(s)

Laurent Paul laurent.paul at uclouvain.be
Fri Feb 8 04:09:26 EST 2013


Hi Dev's

I found out that the issue was not the writer, but the data...
I had some data, but only points, and not triangles. So I could write 
them down to a .vtk file, but not .stl file.
Triangulate has done the job.
I have updates the code below if someone is interestd.

Thanks anyway!
Laurent.


________________
#Here is the code:

from paraview.simple import *
from paraview.vtk import *
from paraview.util import *
from math import *
import paraview.vtk.io as vtk_io

MathObject = vtk.vtkMath()

exportCylinderFilename = ""D:/Work/Axis.stl"

#1st method using paraview filters
LineSourcePV = Line(guiName = "Axis")
LineSourcePV.Point1 = LineUp[0],LineUp[1], LineUp[2] #points are OK
LineSourcePV.Point2 = LineDown[0],LineDown[1], LineDown[2]

tube = Tube()
tube.Radius = 2
tube.NumberofSides = 32
tube.UpdatePipeline()
tube.Capping = 1
SetActiveSource(tube)

Triangulate = Triangulate()
Triangulate.UpdatePipeline()
Show(Triangulate)

stlWriter = PSTLWriter()
stlWriter.FileName = exportCylinderFilename
stlWriter.Input = Triangulate
stlWriter.FileType = 1
stlWriter.UpdatePipeline()




-- 
Please consider environmental impact before printing documents
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20130208/1f14b108/attachment.htm>


More information about the Paraview-developers mailing list