Personal tools
You are here: Home Forum Use Can Salome be used to convert a mesh , STL to a surface , IGES file?

Can Salome be used to convert a mesh , STL to a surface , IGES file?

Up to Use

Can Salome be used to convert a mesh , STL to a surface , IGES file?

Posted by stephen Cimarelli at August 20. 2012

cheers, Steve

Re: Can Salome be used to convert a mesh , STL to a surface , IGES file?

Posted by Saint Michael at August 20. 2012

Hello Steve

Yes, it's easy. See the script

St.Michael

Attachments

Re: Can Salome be used to convert a mesh , STL to a surface , IGES file?

Posted by stephen Cimarelli at August 21. 2012

Thanks, St.

if i get this error does it mean the stl file has to many faces?

 

Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32

type help to get general information on environment

>>> execfile(r"C:/Users/stephenc.VLA/Downloads/stl_to_iges.py")

Traceback (most recent call last):

File "<input>", line 1, in <module>

File "C:/Users/stephenc.VLA/Downloads/stl_to_iges.py", line 27, in <module>

geompy.ExportIGES( shape, "/tmp/geom.igs")

File "C:\Users\stephenc.VLA\Downloads\SALOME-6.5.0-WIN32\SALOME-6.5.0-WIN32\MODULES\GEOM\bin\salome\geompyDC.py", line 7208, in ExportIGES

return self.Export(theObject, theFileName, "IGES")

File "C:\Users\stephenc.VLA\Downloads\SALOME-6.5.0-WIN32\SALOME-6.5.0-WIN32\MODULES\GEOM\bin\salome\geompyDC.py", line 7186, in Export

raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()

RuntimeError: Export : Standard_MMgrRaw::Allocate(): malloc failed

>>> execfile(r"C:/Users/stephenc.VLA/Downloads/stl_to_iges.py")

Traceback (most recent call last):

File "<input>", line 1, in <module>

File "C:/Users/stephenc.VLA/Downloads/stl_to_iges.py", line 19, in <module>

faces.append( geompy.MakeFace( wire, isPlanarWanted=True ))

File "C:\Users\stephenc.VLA\Downloads\SALOME-6.5.0-WIN32\SALOME-6.5.0-WIN32\MODULES\GEOM\bin\salome\geompyDC.py", line 2907, in MakeFace

anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)

File "C:\Users\stephenc.VLA\Downloads\SALOME-6.5.0-WIN32\SALOME-6.5.0-WIN32\MODULES\GEOM\bin\salome\GEOM_Gen_idl.py", line 1064, in MakeFace

return _omnipy.invoke(self, "MakeFace", _0_GEOM.GEOM_IShapesOperations._d_MakeFace, args)

omniORB.CORBA.UNKNOWN: CORBA.UNKNOWN(omniORB.UNKNOWN_UserException, CORBA.COMPLETED_MAYBE)

>>> execfile(r"C:/Users/stephenc.VLA/Downloads/stl_to_iges.py")

Traceback (most recent call last):

File "<input>", line 1, in <module>

File "C:/Users/stephenc.VLA/Downloads/stl_to_iges.py", line 13, in <module>

vertices.append( geompy.MakeVertex( x,y,z ))

MemoryError

>>> 

Re: Can Salome be used to convert a mesh , STL to a surface , IGES file?

Posted by Saint Michael at August 21. 2012
Yes, this error is due to memory lack.

Then you can use pure OpenCASCADE, namely DRAWEXE test harness, for this conversion (using the attached script). To run DRAWEXE  you can replace in run_salome.bat "START runSalome" by "START DRAWEXE". Launch run_salome.bat; when a prompt (Draw[1]>;) appears in the opened window, type "source path_to/stl_2_iges.tcl.
That's all.

St.Michael

Attachments

Re: Can Salome be used to convert a mesh , STL to a surface , IGES file?

Posted by Yves Pousset at October 11. 2013

Merci !

Powered by Ploneboard
Document Actions