Hi Thiago & Thomas,
Thanks for your replies.
Acturally I got that 'my.iges' file. The STL file I opened is located
differently from the folder where I run CADViewer.
iges_writer.Write("my.iges") wrote the 'my.iges' file in that STL file folder.
But when I opened this 'my.iges' file, it looks the same as a STL file and
can't make a mesh on it.
Follow the same logical, I tried to export a STEP file. It looks like a solid
one and can be meshed. Quite excited to get a FEA result.
The only problem now is that STEP file also keep the lines of the surface
triangle. The FEA mesh doesn't look good.
Don't know how could I remove the surface lines from the STEP file.
Regards,
Cean
>
>
> 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.
>
_________________________________________________________________
一张照片的自白――Windows Live照片的可爱视频介绍
http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users