On Sat, Jul 3, 2010 at 1:27 PM, Thomas Paviot <tpav...@gmail.com> wrote: > 2010/7/3 Thiago Franco de Moraes <totonixs...@gmail.com> >> >> On 03-07-2010 09:27, Wangshiraz wrote: >> > Hi, >> > >> > I am trying to convert stl to iges using code CADViewer which is under >> > the samples\Tools folder. >> > after load the stl file: >> > >> > elif extension == "stl": >> > from OCC import TopoDS, StlAPI >> > shape = TopoDS.TopoDS_Shape() >> > stl_reader = StlAPI.StlAPI_Reader() >> > stl_reader.Read(shape,str(filename)) >> > >> > I added this: >> > >> > from OCC import IGESControl >> > i = IGESControl.IGESControl_Controller() >> > i.Init() >> > iges_writer = IGESControl.IGESControl_Writer() >> > iges_writer.AddShape(shape) >> > iges_writer.Write("my.iges") >> > print "added an object to the IGES file. " >> > >> > But I didn't get the output file - my.iges. >> > >> > stl_reader doesn't has GetOutput and 'import vtk' shows no vtk module. >> > >> > What can I do? >> > >> > Regards, >> > >> > Cean >> Hi, >> >> About VTK [1], it's another lib, you have compile or in distro like >> Fedora, Ubuntu, Debian have package from VTK. The stl_Reader from VTK >> has GetOutput, from Python-OCC doesn't. >> >> [1] - http://www.vtk.org/ >> > > Use rather the RWStl package (especially the ReadAscii or ReadBinary > methods) if you just want to parse the STL file and get the > vertices/triangles list. The Read* methods return StlMesh instances from > which you can get what you need. > http://api.pythonocc.org/toc-OCC.RWStl-module.html > http://api.pythonocc.org/toc-OCC.StlMesh-module.html > Best Regards, > Thomas > > _______________________________________________ > Pythonocc-users mailing list > Pythonocc-users@gna.org > https://mail.gna.org/listinfo/pythonocc-users
Hi Thomas, It was a test to try to from vtkPolydata generates a STEP file. Thanks! _______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users