Import from STL or OBJ: Difference between revisions
m (png to svg) |
(Category:Formats -> Category:File_Formats) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 11: | Line 11: | ||
}} |
}} |
||
== Introduction == <!--T: |
== Introduction == <!--T:12--> |
||
In this tutorial we will cover how to import STL/OBJ files in FreeCAD. |
|||
⚫ | |||
Since the mesh-format STL/OBJ is dimensionless, FreeCAD will assume on import that the units used in the model are mm. |
In this tutorial we will cover how to import STL/OBJ files in FreeCAD. Since the mesh-format STL/OBJ is dimensionless, FreeCAD will assume on import that the units used in the model are mm. |
||
If this is not the case you have to scale your model either in the application it was created with (before exporting it) or you |
|||
have to scale your model in FreeCAD after import and conversion to a solid. |
If this is not the case you have to scale your model either in the application it was created with (before exporting it) or you have to scale your model in FreeCAD after import and conversion to a solid. |
||
== Sample part == <!--T:3--> |
== Sample part == <!--T:3--> |
||
Line 22: | Line 22: | ||
*Create a new document |
*Create a new document |
||
*Switch to the mesh workbench |
*Switch to the mesh workbench |
||
*Insert a torus by clicking on {{KEY| |
*Insert a torus by clicking on {{KEY|Meshes}} → {{KEY|[[Image:Mesh_BuildRegularSolid.svg|32px]] Regular solid...}}, choosing settings like: |
||
**Radius1: 10 mm |
**Radius1: 10 mm |
||
**Radius2: 2 mm |
**Radius2: 2 mm |
||
**Sampling: 50 |
**Sampling: 50 |
||
*Click on {{KEY| |
*Click on {{KEY|Create}} and then on {{KEY|Close}} |
||
*Save your file with {{KEY| |
*Save your file with {{KEY|File}} → {{KEY|Save}} to get a FreeCAD-File containing a mesh object |
||
<br /> |
<br /> |
||
For importing a STL or OBJ file into FreeCAD, create a new FreeCAD document und choose |
For importing a STL or OBJ file into FreeCAD, create a new FreeCAD document und choose {{KEY|File}} → {{KEY|Import}} from the top menu. |
||
{{KEY| File}} → {{KEY| Import}} from the top menu. |
|||
== Cleaning and repairing the STL/OBJ-File for preparing import == <!--T:4--> |
== Cleaning and repairing the STL/OBJ-File for preparing import == <!--T:4--> |
||
Basically, FreeCAD would import any STL/OBJ-File. But our goal is to have a solid which can be measured and changed (adding pads/pockets ..). For a successful conversion from mesh to solid we need to make sure that the mesh is “water-tight” (has no holes) or doesn’t have any other errors. |
|||
Basically, FreeCAD would import any STL/OBJ-File. |
|||
But our goal is to have a solid which can be measured and changed (adding pads/pockets ..). |
|||
For a successful conversion from mesh to solid we need to make sure that the mesh is “water-tight” |
|||
(has no holes) or doesn’t have any other errors. |
|||
<br /> |
<br /> |
||
FreeCAD’s aim is not to be a good mesh modeler, it is designed to be a solid modeler. |
FreeCAD’s aim is not to be a good mesh modeler, it is designed to be a solid modeler. 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). |
||
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). |
|||
<br /> |
<br /> |
||
Some users like to use third-party software for cleaning and repairing meshes, for example |
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://meshlab.sourceforge.net/ Meshlab] (Windows/Linux/Mac) - Open Source |
||
<br /> |
<br /> |
||
In this tutorial we will use the mesh workbench within FreeCAD to clean/repair/verify the mesh of our sample file. |
In this tutorial we will use the mesh workbench within FreeCAD to clean/repair/verify the mesh of our sample file. |
||
Line 52: | Line 46: | ||
*Switch to mesh workbench |
*Switch to mesh workbench |
||
*Make sure that your mesh object is selected in the tree view |
*Make sure that your mesh object is selected in the tree view |
||
*Choose {{KEY| |
*Choose {{KEY|Meshes}} → {{KEY|Analyze}} → {{KEY|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 |
*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 {{KEY| |
*With the last point in the list reading "All above tests together" click on {{KEY|Analyze}} |
||
*The texts beside the tick boxes will change to reflect results of the different tests |
*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 {{KEY| |
*If errors had been detected the corresponding check-boxes will be ticked and you will be able to select {{KEY|Repair}} |
||
*Choose {{KEY| |
*Choose {{KEY|Close}} to close the menu |
||
===Harmonizing normals=== <!--T:6--> |
===Harmonizing normals=== <!--T:6--> |
||
Harmonizing normals of a mesh object can be done by |
Harmonizing normals of a mesh object can be done by |
||
*Selecting your mesh object in the tree view |
*Selecting your mesh object in the tree view |
||
*Choose {{KEY| |
*Choose {{KEY|Meshes}} → {{KEY|[[Image:Mesh_HarmonizeNormals.svg|32px]] Harmonize normals}} from the top menu. |
||
⚫ | |||
Tip: |
|||
⚫ | |||
"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. |
If the normals point into the mesh the triangle will be shown in black. |
||
Line 71: | Line 63: | ||
You can also manually close holes in your mesh object by |
You can also manually close holes in your mesh object by |
||
*Selecting your mesh object in the tree view |
*Selecting your mesh object in the tree view |
||
*Choose {{KEY| |
*Choose {{KEY|Meshes}} → {{KEY|Fill holes...}} from the top menu |
||
*Specify maximum number of edges to be filled (3 is default) |
*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 |
*Since STL and OBJ are meshes consisting of triangles the default number of edges should be sufficient |
||
Line 77: | Line 69: | ||
Another method of manually closing holes in your mesh object would be |
Another method of manually closing holes in your mesh object would be |
||
*Selecting your mesh object in the tree view |
*Selecting your mesh object in the tree view |
||
*Choose {{KEY| |
*Choose {{KEY|Meshes}} → {{KEY|[[Image:Mesh_FillInteractiveHole.svg|32px]] Close hole}} from the top menu |
||
*Select one of the edges of the hole in the mesh object in the 3D view |
*Select one of the edges of the hole in the mesh object in the 3D view |
||
*Right-Click in 3D view and choose {{KEY| |
*Right-Click in 3D view and choose {{KEY|Leave hole-filling mode}} to exit the command |
||
== Conversion mesh to solid == <!--T:8--> |
== Conversion mesh to solid == <!--T:8--> |
||
*Switch to [[Image:Workbench_Part.svg|24px]] [[Part Workbench]] |
*Switch to [[Image:Workbench_Part.svg|24px]] [[Part_Workbench|Part Workbench]] |
||
*Make sure your mesh object is selected in the tree view, otherwise select it |
*Make sure your mesh object is selected in the tree view, otherwise select it |
||
*Choose {{KEY| |
*Choose {{KEY|Part}} → {{KEY|[[Image:Part_ShapeFromMesh.svg|32px]] Create shape from mesh ...}} from top menu |
||
*Specify tolerance for sewing shape (0,1 is default) |
*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) |
*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 |
*Select the newly created object in the tree view |
||
*Choose {{KEY| |
*Choose {{KEY|Part}} → {{KEY|Create a copy}} → {{KEY|[[Image:Part_RefineShape.svg|32px]] Refine shape}} from the top menu |
||
*A new object will be created in the tree view and the previous one will be made invisible |
*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 |
*Select the newly created object in the tree view |
||
*Choose {{KEY| |
*Choose {{KEY|Part}} → {{KEY|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 |
*A new object will be created in the tree view, bearing "(Solid)" in its name, to indicate it is a solid |
||
<br /> |
<br /> |
||
Since the created solid has no history and no editable features (like a simple copy in FreeCAD) |
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 ... |
||
you could delete all previous objects from the tree view. |
|||
This would keep your file size small ... |
|||
==Links== <!--T: |
==Links== <!--T:13--> |
||
⚫ | |||
⚫ | |||
<!--T: |
<!--T:9--> |
||
⚫ | |||
[[Category:Formats]] |
|||
⚫ | |||
⚫ | |||
⚫ | |||
</translate> |
</translate> |
||
⚫ | |||
[[Category:File_Formats{{#translation:}}]] |
|||
{{clear}} |
{{clear}} |
Latest revision as of 17:29, 19 December 2020
Tutorial |
Topic |
---|
Import from STL or OBJ |
Level |
Beginner |
Time to complete |
30 minutes |
Authors |
r-frank |
FreeCAD version |
0.16.6703 |
Example files |
See also |
None |
Introduction
In this tutorial we will cover how to import STL/OBJ files in FreeCAD. Since the mesh-format STL/OBJ is dimensionless, FreeCAD will assume on import that the units used in the model are mm. If this is not the case you have to scale your model either in the application it was created with (before exporting it) or you have to scale your model in FreeCAD after import and conversion to a solid.
Sample part
For this tutorial you can use your own STL file or create a demo file by doing this:
- Open FreeCAD
- Create a new document
- Switch to the mesh workbench
- Insert a torus by clicking on Meshes → Regular solid..., choosing settings like:
- Radius1: 10 mm
- Radius2: 2 mm
- Sampling: 50
- Click on Create and then on Close
- Save your file with File → Save to get a FreeCAD-File containing a mesh object
For importing a STL or OBJ file into FreeCAD, create a new FreeCAD document und choose File → Import from the top menu.
Cleaning and repairing the STL/OBJ-File for preparing import
Basically, FreeCAD would import any STL/OBJ-File. But our goal is to have a solid which can be measured and changed (adding pads/pockets ..). For a successful conversion from mesh to solid we need to make sure that the mesh is “water-tight” (has no holes) or doesn’t have any other errors.
FreeCAD’s aim is not to be a good mesh modeler, it is designed to be a solid modeler. 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).
Some users like to use third-party software for cleaning and repairing meshes, for example
- Netfabb Basic (Windows/Linux/Mac) - free for personal use (automatic mesh repair available)
- Meshlab (Windows/Linux/Mac) - Open Source
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
- 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
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 → Create 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 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
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub