Importowanie plików STL lub OBJ

From FreeCAD Documentation
Revision as of 20:40, 8 April 2019 by Tomaszkowalczyk94 (talk | contribs) (Created page with "== Czyszczenie i naprawianie pliku STL/OBJ w celu przygotowania go do importu == FreeCAD może zaimportować każdy plik STL/OBJ. Ale naszym celem jest storzenie bryły któr...")
Tutorial
Topic
Importowanie plików STL lub OBJ
Level
Beginner
Time to complete
30 minutes
Authors
r-frank, tłumaczenie: tomaszkowalczyk94
FreeCAD version
0.16.6703
Example files
See also
None

Wprowadzenie

W tym tutorialu omówimy jak importować pliki STL/OBJ do FreeCAD-a. Ponieważ formaty STL/OBJ są opisane przez siatkę wielokątów i nie posiadają przypisanych konkretnych jednostek wielkości, FreeCAD przyjmuje że wszystkie wartości podane w pliku są podane w mm. Jeśli jest inaczej, trzeba zeskalować model w aplikacji w której został stworzony (przed jego wyeksportowaniem) lub zeskalować model w FreeCAD po jego zaimportowaniu i konwersji do bryły.

Przykładowy plik

Dla tego przykładu możesz użyć swojego pliku STL lub stworzyć plik demo w ten sposób:

  • Otwórz FreeCAD
  • Stwórz nowy dokument
  • Zmień warsztat na mesh workbench
  • Dodaj torus przez MeshesFile:Mesh RegularSolid.png Regular solid... wyberają opcje:
    • Radius1: 10 mm
    • Radius2: 2 mm
    • Sampling: 50
  • kliknij Create and then on Close
  • Zapisz plik za pomocą File Save


Aby zaimportować plik STL lub OBJ, stwórz nowy dokument DreeCAD i wybierz File Import z górnego menu.

Czyszczenie i naprawianie pliku STL/OBJ w celu przygotowania go do importu

FreeCAD może zaimportować każdy plik STL/OBJ. Ale naszym celem jest storzenie bryły która może być potem modyfikowana (dodając pads/pockets). Aby konwersja z siatki wielokątów do bryły się powiodła, musimy mieć pewność że siatka(mesh) jest "wodoszczelna" (nie zawiera dziur) lub nie ma żadnych innych błędów.
Warto pamiętać że FreeCAD nie jest dobrym edytorem siatki wielokątów, jest on zaprojektowany do pracy z bryłami. FreeCAD ma pewne funkcje do operacji na siatce 3d w warsztacie mesh i OpenSCAD (niektóre operacje wymagają zainstalowanego i skonfigurowanego OpenSCAD)
Niektórzy użytkownicy lubią używać innych zewnętrznych narzędzi do naprawienia siatki wielokątów np:

  • Netfabb Basic (Windows/Linux/Mac) - darmowy do użytku domowego (dostępne automatyczne naprawianie siatki)
  • Meshlab (Windows/Linux/Mac) - Open Source


W tym tutorialu użyjemy warsztatu mesh dostępnego standardowo w FreeCAD do czyszczenia/naprawiania/weryfikowania naszego przykładowego pliku.

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