Metafor

ULiege - Aerospace & Mechanical Engineering

User Tools

Site Tools


doc:user:geometry:import:stp2e

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:user:geometry:import:stp2e [2014/08/10 13:33] jorisdoc:user:geometry:import:stp2e [2016/03/30 15:23] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Import a STEP geometry ======+====== Reading STEP files ====== 
 +{{:doc:user:ico-advanced.png?40 |Advanced}} 
 +It is possible to import STEP files generated by external CAD software such as Catia or FreeCAD. The function used to convert STEP files to python commands that are understandable by Metafor is defined in the ''toolbox.stp2py'' module. It uses the parser named ''stp2py.exe'' which is provided with Metafor.
  
-===== Introduction =====+<note important>This converter provides only a partial translation of STEP files. Some CAD entity are ignored.</note>
  
-To handle complex geometries un Metafor, a software which can convert STEP files (extension ''.stp''into Python format, readable by Metafor, (extension ''.py'') was createdThis software is independent of Metafor. It reads the STEP file, and converts what it can. Therefore, to create a complex geoemtry it Metafor, it is easier to create it in Catia, export it in STEP format and then convert it.+Here is an example (from ''apps.qs.cont2STEP''). The STEP file is ''cont2.stp''it is located in the same folder as the input file.
  
-===== Use =====+  import toolbox.stp2py 
 +  thedir os.path.dirname(os.path.abspath(__file__)) 
 +  mod toolbox.stp2py.stp2py(os.path.join(thedir, 'cont2.stp')) 
 +  mod.fillImportedStp(domain) 
  
  
-//For the software compilation, see [[commit:2006:10_27b]].// 
- 
-To convert from STEP to ''.py'', the executable ''stp2e.exe'' must be run and the corresponding STEP file introduced, **without** the extension. 
- 
-<code>$ ./stp2e rep/fich</code> 
- 
-If all goes well, a summary is displayed and a ''.py'' file is created. Here, the created file will be ''fichstp.py'' (name of the file + ''stp.py''). All that remains to do is to import this file in Metafor: 
- 
-<code> 
-import apps.rep.fichstp 
-apps.rep.fichstp.fillImportedStp(domain, parameters) 
-</code> 
doc/user/geometry/import/stp2e.1407670389.txt.gz · Last modified: 2016/03/30 15:22 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki