from file .ply to stl file

405 views
Skip to first unread message

katia

unread,
Apr 18, 2017, 8:22:28 AM4/18/17
to vmtk-users
Hello! I create a plane with this python code:

sourcer = vtk.vtkPlaneSource()
sourcer.SetXResolution(100);
    sourcer.SetYResolution(100);
    transformr = vtk.vtkTransform()
    transformr.Translate(-30, 0, -100)
    transFr = vtk.vtkTransformPolyDataFilter()
    transFr.SetInputConnection(sourcer.GetOutputPort())
    transFr.SetTransform(transformr)
    w = vtk.vtkPLYWriter()
    w.SetInputConnection(transFr.GetOutputPort())
    w.SetFileName('piano10cm')
    w.SetFileTypeToBinary()
    w.SetDataByteOrderToLittleEndian()
    w.SetColorModeToUniformCellColor()
    w.SetColor(255, 0, 0)
    w.Write()

It is possible to convert this plane in a stl format?

I have tried with:
w = vtk.vtkSTLWriter() instead of w = vtk.vtkPLYWriter()
but the vtk exception is that stl support only triangular mesh and the mesh output is quadratic.

Thanks,
Katia

Simone Manini

unread,
Apr 24, 2017, 8:30:09 AM4/24/17
to vmtk-users
Dear Katia,
the vtk exception has already solved your issue. 
You need to triangulate the mesh before exporting to STL.

You can learn how to use VTK and VTK filters here:

Best regards
Simone

--
You received this message because you are subscribed to the Google Groups "vmtk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vmtk-users+...@googlegroups.com.
To post to this group, send email to vmtk-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Simone Manini, Eng
Engineer, OROBIX Srl
via Camozzi 144, 24121 Bergamo, Italy

orobix:  www.orobix.com
web:     daron1337.github.io
twitter:  @daron1337
phone:  +39 035 0273786
             +39 035 0170561

"This message originates from Orobix Srl and its contents and attachments are privileged and confidential and are intended only for the individual(s) or entity(ies) named above. This message should not be forwarded, distributed or disclosed. Any unauthorized use, dissemination and duplication is strictly prohibited and may be unlawful. All personal messages express views solely of the sender, which are not to be attributed to Orobix Srl, and may not be copied or distributed without this disclaimer. If you are not the intended recipient or received this message in error, please delete this message and notify the sender by reply e-mail. Opinions, conclusions and other information in this message that do not relate to the official business of Orobix Srl shall be understood as neither given nor endorsed by it."
Reply all
Reply to author
Forward
0 new messages