Arch OBJ/fr: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 2: | Line 2: | ||
{{docnav/fr|[[Arch DAE/fr|DAE]]|[[Arch JSON/fr|JSON]]|[[Arch_Module/fr|Arch Module]]}} |
{{docnav/fr|[[Arch DAE/fr|DAE]]|[[Arch JSON/fr|JSON]]|[[Arch_Module/fr|Arch Module]]}} |
||
== Description == |
|||
<div class="mw-translate-fuzzy"> |
|||
En plus de la norme d'exportation FreeCAD '''[http://fr.wikipedia.org/wiki/Objet_3D_(format_de_fichier) .OBJ]''', |
En plus de la norme d'exportation FreeCAD '''[http://fr.wikipedia.org/wiki/Objet_3D_(format_de_fichier) .OBJ]''', |
||
le [[Arch Module/fr|module Arch]] dispose d'une solution alternative d'exportation, qui exporte les faces coplanaires des faces comme faces '''.OBJ''', au lieu de la triangulation [[Part Module|Shape (forme)]] des objets de base, comme le fait l'exportateur standard. |
le [[Arch Module/fr|module Arch]] dispose d'une solution alternative d'exportation, qui exporte les faces coplanaires des faces comme faces '''.OBJ''', au lieu de la triangulation [[Part Module|Shape (forme)]] des objets de base, comme le fait l'exportateur standard. |
||
</div> |
|||
== Exporting without GUI == |
|||
Exporting without the graphical interface is possible from the command line, using the [[Mesh_Workbench|Mesh Workbench]] exporter only. |
|||
In this example, a STEP file is imported, the colors of the [[Shape|Shape]] are saved, then a mesh is created from it, the colors of the original object are re-applied to the faces of the new mesh, which is then exported to OBJ format. Since this is done with the Mesh Workbench, the result is a triangulated mesh. |
|||
{{Code|code= |
|||
import Mesh |
|||
import MeshPart |
|||
import Import |
|||
data = Import.open("example.stp") |
|||
shape = data[0][0].Shape |
|||
shape_colors = data[0][1] |
|||
mesh = MeshPart.meshFromShape(Shape=shape, LinearDeflection=0.1, Segments=True) |
|||
face_colors = [(0, 0, 0)] * mesh.CountFacets |
|||
for i in range(mesh.countSegments()): |
|||
color = shape_colors[i] |
|||
segm = mesh.getSegment(i) |
|||
for j in segm: |
|||
face_colors[j] = color |
|||
mesh.write(Filename="new_example.obj", Material=face_colors, Format="obj") |
|||
}} |
|||
== More information == |
|||
* [https://forum.freecadweb.org/viewtopic.php?f=8&t=37452 Convert STEP to Wavefront OBJ with colors of faces] |
|||
==Tutoriels== |
==Tutoriels== |
||
Line 10: | Line 46: | ||
{{docnav/fr|[[Arch DAE/fr|DAE]]|[[Arch JSON/fr|JSON]]|[[Arch_Module/fr|Arch Module]]}} |
{{docnav/fr|[[Arch DAE/fr|DAE]]|[[Arch JSON/fr|JSON]]|[[Arch_Module/fr|Arch Module]]}} |
||
{{Arch Tools navi{{#translation:}}}} |
{{Arch Tools navi{{#translation:}}}} |
||
{{Userdocnavi{{#translation:}}}} |
{{Userdocnavi{{#translation:}}}} |
||
[[Category:File Formats{{#translation:}}]] |
[[Category:File Formats{{#translation:}}]] |
Revision as of 18:55, 10 September 2020
Description
En plus de la norme d'exportation FreeCAD .OBJ, le module Arch dispose d'une solution alternative d'exportation, qui exporte les faces coplanaires des faces comme faces .OBJ, au lieu de la triangulation Shape (forme) des objets de base, comme le fait l'exportateur standard.
Exporting without GUI
Exporting without the graphical interface is possible from the command line, using the Mesh Workbench exporter only.
In this example, a STEP file is imported, the colors of the Shape are saved, then a mesh is created from it, the colors of the original object are re-applied to the faces of the new mesh, which is then exported to OBJ format. Since this is done with the Mesh Workbench, the result is a triangulated mesh.
import Mesh
import MeshPart
import Import
data = Import.open("example.stp")
shape = data[0][0].Shape
shape_colors = data[0][1]
mesh = MeshPart.meshFromShape(Shape=shape, LinearDeflection=0.1, Segments=True)
face_colors = [(0, 0, 0)] * mesh.CountFacets
for i in range(mesh.countSegments()):
color = shape_colors[i]
segm = mesh.getSegment(i)
for j in segm:
face_colors[j] = color
mesh.write(Filename="new_example.obj", Material=face_colors, Format="obj")
More information
Tutoriels
Arch
- Éléments : Mur, Structure, Mur-rideau, Fenêtre, Toiture, Espace, Escalier, Équipement, Ossature, Clôture, Treillis, Profilé, Conduite, Raccord
- Renforcements : Armature droite, Armature en U, Armature en L, Armature en étrier, Armature cintrée, Armature hélicoïdale, Rebar Armature en colonne, Rebar Poutre, Rebar Renfort de dalle, Rebar Renfort de semelle, Armature personnalisée
- Panneaux : Panneau, Découpe de panneau, Feuille de panneaux, Calepinage
- Matériaux : Matériau, Matériaux multiples
- Organisations : Partie de bâtiment, Projet, Site, Bâtiment, Étage, Référence externe, Plan de coupe, Nomenclature
- Axes : Axes, Système d'axes, Grille
- Modifications : Couper suivant un Plan, Ajouter un composant, Enlever un composant, Prendre des cotes
- Utilitaires : Composant, Cloner un composant, Diviser un maillage, Maillage vers une forme, Sélection de maillages non-manifold, Supprimer la forme, Fermer les trous, Fusionner des murs, Vérification, Bascule marqueur Brep IFC, Explorateur IFC, 3 vues depuis un maillage, Tableur IFC, Bascule des sous composants
- Additionnels : Préférences, Préférences Import-Export (IFC, DAE, OBJ, JSON, 3DS, SHP), IfcOpenShell, IfcPlusPlus, Arch API
Hub utilisateurs
- Démarrer avec FreeCAD
- Installation : Téléchargements, Windows, Linux, Mac, Logiciels supplémentaires, Docker, AppImage, Ubuntu Snap
- Bases : À propos de FreeCAD, Interface, Navigation par la souris, Méthodes de sélection, Objet name, Préférences, Ateliers, Structure du document, Propriétés, Contribuer à FreeCAD, Faire un don
- Aide : Tutoriels, Tutoriels vidéo
- Ateliers : Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test