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

Next revision
Previous revision
doc:user:geometry:import:stp2e [2013/07/12 14:56] – created jorisdoc:user:geometry:import:stp2e [2016/03/30 15:23] (current) – external edit 127.0.0.1
Line 1: Line 1:
-===== Introduction =====+====== 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.
  
 +<note important>This converter provides only a partial translation of STEP files. Some CAD entity are ignored.</note>
  
 +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.
  
-Afin de pouvoir traiter des géométries complexes dans Metafor, un programme a été créé afin de transformer des fichiers STEP (extension ''.stp'') en fichiers Python (extension ''.py''écrits au format MetaforLe programme qu'on utilise est totalement indépendant de MetaforIl scanne le fichier STEP et traduit ce qu'il peutAutrement ditaujourd'hui si on veut créer une géométrie complexe, il //suffit// de la créer dans Catia, ensuite de l'exporter en format STEP et mouliner le fichier dans le programme.+  import toolbox.stp2py 
 +  thedir = os.path.dirname(os.path.abspath(__file__)) 
 +  mod = toolbox.stp2py.stp2py(os.path.join(thedir, 'cont2.stp')) 
 +  mod.fillImportedStp(domain) 
  
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-===== Utilisation ===== 
- 
- 
-//Pour la compilation du programme voir [[commit:2006:10_27b]].// 
- 
-Pour lancer la moulinette et transformer le fichier STEP en fichier ''.py'' il suffit d'utiliser l'exécutable ''stp2e.exe'' et de l'appliquer au fichier STEP qui sera cité **sans** son extension. 
- 
-<code>$ ./stp2e rep/fich</code> 
- 
-Si tout se passe bien un résumé s'affiche et un fichier ''.py'' est créé. Ici le fichier créé sera ''fichstp.py'' (''nom_du_fichier'' + ''stp.py''). Il ne reste plus qu'à importer le fichier ''.py'' dans Metafor en faisant par exemple : 
- 
-<code> 
-import apps.rep.fichstp 
-apps.rep.fichstp.fillImportedStp(domain, parameters) 
-</code> 
doc/user/geometry/import/stp2e.1373633797.txt.gz · Last modified: 2016/03/30 15:22 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki