Import from STL or OBJ/fr: Difference between revisions

From FreeCAD Documentation
(Created page with "== Pièce d'échantillon == Pour ce tutoriel, vous pouvez utiliser votre propre fichier STL ou créer un fichier de démonstration en procédant comme suit: * Ouvrir FreeCAD *...")
(Created page with "== Nettoyage et réparation du fichier STL / OBJ pour la préparation de l'importation == Fondamentalement, FreeCAD importerait n'importe quel fichier STL / OBJ. Mais notre ob...")
Line 29: Line 29:
{{KEY | Fichier}} → {{KEY | Importer}} dans le menu supérieur.
{{KEY | Fichier}} → {{KEY | Importer}} dans le menu supérieur.


== Nettoyage et réparation du fichier STL / OBJ pour la préparation de l'importation ==
== Cleaning and repairing the STL/OBJ-File for preparing import ==
Basically, FreeCAD would import any STL/OBJ-File.
Fondamentalement, FreeCAD importerait n'importe quel fichier STL / OBJ.
Mais notre objectif est d'avoir un solide qui peut être mesuré et modifié (ajout de blocs / trou...).
But our goal is to have a solid which can be measured and changed (adding pads/pockets ..).
Pour une conversion réussie de maillage en solide, nous devons nous assurer que le maillage est "imperméable à l'eau"
For a successful conversion from mesh to solid we need to make sure that the mesh is “water-tight”
(n'a pas de trous) ou n'a pas d'autres erreurs.
(has no holes) or doesn’t have any other errors.
<br />
<br />
Le but de FreeCAD n'est pas d'être un bon modélisateur de maillage, il est conçu pour être un modélisateur de solide.
FreeCAD’s aim is not to be a good mesh modeler, it is designed to be a solid modeler.
FreeCAD dispose de certaines fonctionnalités pour l'opération de maillage dans un atelier de Maillage et un atelier OpenSCAD
FreeCAD has some capabilities for mesh operation in mesh workbench and OpenSCAD workbench
(some operations need OpenSCAD to be installed and configured in the FreeCAD-preferences).
(certaines opérations ont besoin d'OpenSCAD pour être installées et configurées dans les préférences FreeCAD).
<br />
<br />
Certains utilisateurs aiment utiliser un logiciel tiers pour nettoyer et réparer des mailles, par exemple
Some users like to use third-party software for cleaning and repairing meshes, for example
* [http://www.netfabb.com/downloadcenter.php?basic=1 Netfabb Basic] (Windows/Linux/Mac) - free for personal use (automatic mesh repair available)
* [http://www.netfabb.com/downloadcenter.php?basic=1 Netfabb Basic] (Windows / Linux / Mac) - gratuit pour un usage personnel (réparation de maillage automatique disponible)
* [http://meshlab.sourceforge.net/ Meshlab] (Windows/Linux/Mac) - Open Source
* [http://meshlab.sourceforge.net/ Meshlab] (Windows / Linux / Mac) - Open Source
<br />
<br />
Dans ce tutoriel, nous utiliserons le l'atelier de Maillage dans FreeCAD pour nettoyer/réparer/vérifier le maillage de notre fichier exemple.
In this tutorial we will use the mesh workbench within FreeCAD to clean/repair/verify the mesh of our sample file.


===Automatic testing and repairing===
===Automatic testing and repairing===

Revision as of 16:03, 28 September 2017

Tutoriel
Thème
Importation depuis STL ou OBJ
Niveau
Débutant
Temps d'exécution estimé
30 minutes
Auteurs
r-frank
Version de FreeCAD
0.16.6703
Fichiers exemples
Voir aussi
None

Introduction

Dans ce tutoriel, nous aborderons comment importer des fichiers STL / OBJ dans FreeCAD. Étant donné que le format de maille STL / OBJ est sans dimension, FreeCAD supposera à l'importation que les unités utilisées dans le modèle sont mm. Si ce n'est pas le cas, vous devez étaler votre modèle, soit dans l'application où il a été créé avec (avant de l'exporter) ou vous devez mettre à l'échelle votre modèle dans FreeCAD après l'importation et la convertir en un solide.

Pièce d'échantillon

Pour ce tutoriel, vous pouvez utiliser votre propre fichier STL ou créer un fichier de démonstration en procédant comme suit:

  • Ouvrir FreeCAD
  • Créer un nouveau document
  • Passer à l'atelier Maillage
  • Insérer un tor en cliquant sur Maillage File:Mesh RegularSolid.png Solide Régulier ..., en choisissant des paramètres comme:
    • Rayon 1: 10 mm
    • Radius2: 2 mm
    • Échantillonnage: 50
  • Cliquez sur Créer, puis sur Fermer
  • Enregistrez votre fichier avec Fichier Sauvegarder pour obtenir un fichier FreeCAD contenant un objet maillage


Pour importer un fichier STL ou OBJ dans FreeCAD, créez un nouveau document FreeCAD et choisissez Fichier Importer dans le menu supérieur.

Nettoyage et réparation du fichier STL / OBJ pour la préparation de l'importation

Fondamentalement, FreeCAD importerait n'importe quel fichier STL / OBJ. Mais notre objectif est d'avoir un solide qui peut être mesuré et modifié (ajout de blocs / trou...). Pour une conversion réussie de maillage en solide, nous devons nous assurer que le maillage est "imperméable à l'eau" (n'a pas de trous) ou n'a pas d'autres erreurs.
Le but de FreeCAD n'est pas d'être un bon modélisateur de maillage, il est conçu pour être un modélisateur de solide. FreeCAD dispose de certaines fonctionnalités pour l'opération de maillage dans un atelier de Maillage et un atelier OpenSCAD (certaines opérations ont besoin d'OpenSCAD pour être installées et configurées dans les préférences FreeCAD).
Certains utilisateurs aiment utiliser un logiciel tiers pour nettoyer et réparer des mailles, par exemple

  • Netfabb Basic (Windows / Linux / Mac) - gratuit pour un usage personnel (réparation de maillage automatique disponible)
  • Meshlab (Windows / Linux / Mac) - Open Source


Dans ce tutoriel, nous utiliserons le l'atelier de Maillage dans FreeCAD pour nettoyer/réparer/vérifier le maillage de notre fichier exemple.

Automatic testing and repairing

  • Open FreeCAD and the sample FreeCAD file containing the mesh object
  • Switch to mesh workbench
  • Make sure that your mesh object is selected in the tree view
  • Choose Meshes Analyze Evaluate & Repair mesh... from the top menu
  • Make sure the pull down menu on the top right corner displays the name of your mesh object
  • With the last point in the list reading "All above tests together" click on Analyze
  • The texts beside the tick boxes will change to reflect results of the different tests
  • If errors had been detected the corresponding check-boxes will be ticked and you will be able to select Repair
  • Choose Close to close the menu

Harmonizing normals

Harmonizing normals of a mesh object can be done by

  • Selecting your mesh object in the tree view
  • Choose Meshes Harmonize normals from the top menu.

Tip: By choosing the mesh object in the tree view, going to the view tab in the property view and changing "Lighting" from "Two Side" to "One Side" you can identify triangles with flipped normals. If the normals point into the mesh the triangle will be shown in black.

Closing holes

You can also manually close holes in your mesh object by

  • Selecting your mesh object in the tree view
  • Choose Meshes Fill holes... from the top menu
  • Specify maximum number of edges to be filled (3 is default)
  • Since STL and OBJ are meshes consisting of triangles the default number of edges should be sufficient


Another method of manually closing holes in your mesh object would be

  • Selecting your mesh object in the tree view
  • Choose Meshes Close hole from the top menu
  • Select one of the edges of the hole in the mesh object in the 3D view
  • Right-Click in 3D view and choose Leave hole-filling mode to exit the command

Conversion mesh to solid

  • Switch to part workbench
  • Make sure your mesh object is selected in the tree view, otherwise select it
  • Choose Part Create shape from mesh ... from top menu
  • Specify tolerance for sewing shape (0,1 is default)
  • A new object will be created in the tree view (with blue shape icon, instead of green mesh icon)
  • Select the newly created object in the tree view
  • Choose Part Refine shape from the top menu
  • A new object will be created in the tree view and the previous one will be made invisible
  • Select the newly created object in the tree view
  • Choose Part Convert to solid from the top menu
  • A new object will be created in the tree view, bearing "(Solid)" in its name, to indicate it is a solid


Since the created solid has no history and no editable features (like a simple copy in FreeCAD) you could delete all previous objects from the tree view. This would keep your file size small ...

Links