Importar STL ou OBJ

From FreeCAD Documentation
Revision as of 17:06, 1 September 2023 by Cartola (talk | contribs) (Created page with "== Limpeza e Reparo do Arquivo STL/OBJ para Preparar a Importação == Basicamente, o FreeCAD importaria qualquer arquivo STL/OBJ. Mas nosso objetivo é ter um sólido que possa ser medido e modificado (adicionar cortes, furos etc). Para uma conversão bem-sucedida de malha para sólido, precisamos garantir que a malha esteja "selada" (não tenha buracos) ou não tenha outros erros. O objetivo do FreeCAD não é ser um bom modelador de malhas; ele é projetado para ser...")
Tutorial
Topic
Importar STL ou OBJ
Level
Iniciante
Time to complete
30 minutos
Authors
r-frank
FreeCAD version
0.16.6703
Example files
See also
None

Introdução

Neste tutorial, cobriremos como importar arquivos STL/OBJ no FreeCAD. Como o formato de malha STL/OBJ é sem dimensões, o FreeCAD assumirá, ao importar, que as unidades usadas no modelo são milímetros. Se isso não for verdade, você precisará redimensionar seu modelo no aplicativo em que foi criado (antes de exportá-lo) ou redimensionar seu modelo no FreeCAD após a importação e conversão em um sólido.

Peça de Exemplo

Para este tutorial, você pode usar seu próprio arquivo STL ou criar um arquivo de demonstração fazendo o seguinte:

  • Abra o FreeCAD
  • Crie um novo documento
  • Mude para a bancada de trabalho de malha (Mesh)
  • Insira um toro clicando no menu Malhas Sólido regular..., escolhendo configurações como:
    • Raio1: 10 mm
    • Raio2: 2 mm
    • Amostragem: 50
  • Clique em Criar e depois em Fechar
  • Salve seu arquivo com ArquivoSalvar para obter um arquivo FreeCAD contendo um objeto de malha


Para importar um arquivo STL ou OBJ no FreeCAD, crie um novo documento no FreeCAD e escolha ArquivoImportar no menu superior.

Limpeza e Reparo do Arquivo STL/OBJ para Preparar a Importação

Basicamente, o FreeCAD importaria qualquer arquivo STL/OBJ. Mas nosso objetivo é ter um sólido que possa ser medido e modificado (adicionar cortes, furos etc). Para uma conversão bem-sucedida de malha para sólido, precisamos garantir que a malha esteja "selada" (não tenha buracos) ou não tenha outros erros.

O objetivo do FreeCAD não é ser um bom modelador de malhas; ele é projetado para ser um modelador de sólidos. O FreeCAD possui algumas capacidades para operações de malha na bancada de trabalho de malha (Mesh) e na bancada de trabalho do OpenSCAD (algumas operações exigem que o OpenSCAD esteja instalado e configurado nas preferências do FreeCAD).

Alguns usuários preferem usar software de terceiros para limpar e reparar malhas, por exemplo:

  • Netfabb Basic (Windows/Linux/Mac) - gratuito para uso pessoal (reparo automático de malha disponível)
  • Meshlab (Windows/Linux/Mac) - Código Aberto

Neste tutorial, usaremos a bancada de trabalho de malha dentro do FreeCAD para limpar/reparar/verificar a malha do nosso arquivo de exemplo.

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 MeshesAnalyzeEvaluate & 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 MeshesFill 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 PartCreate a copy 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 PartConvert 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