Export to STL or OBJ: Difference between revisions

From FreeCAD Documentation
No edit summary
(Marked this version for translation)
 
(30 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:1-->
<!--T:1-->
{{TutorialInfo
{{TutorialInfo
|Topic= Export to STL or OBJ
|Topic=Export to STL or OBJ
|Level= Beginner
|Level=Beginner
|Time= 20 minutes
|Time=20 minutes
|Author=r-frank
|Author=r-frank
|FCVersion=0.16.6703
|FCVersion=0.16.6703
|Files=
}}
}}


== Introduction == <!--T:2-->
== Introduction == <!--T:10-->

In this tutorial we will cover how to export STL/OBJ-files from FreeCAD.
<!--T:2-->
The mesh-format STL/OBJ is dimensionless; FreeCAD will assume
In this tutorial we will cover how to export STL/OBJ-files from FreeCAD. The mesh-format STL/OBJ is dimensionless; FreeCAD will assume on export that the units used in the model are in mm. If this is not the case you have to scale your model. One way to do this is using [[Image:Draft_Scale.svg|24px]] [[Draft_Scale|Draft Scale]].
on export that the units used in the model are in mm.

If this is not the case you have to scale your model.
== Sample part == <!--T:11-->
One way to do this is using [[Draft_Scale|Draft_Scale]].

<!--T:3-->
You can use your own FreeCAD file, but you can also create a quick test file:
# Open FreeCAD.
# Create a new document.
# Switch to [[Image:Workbench_Part.svg|24px]] [[Part_Workbench|Part Workbench]].
# Insert a cube by clicking on [[Image:Part_Box.svg|24px]] [[Part_Box|Part Box/Cube]].
# Insert a cone by clicking on [[Image:Part_Cone.svg|24px]] [[Part_Cone|Part Cone]].
# Select both objects in the [[Tree_view|tree view]].
# Apply a fusion by clicking on [[Image:Part_Fuse.svg|24px]] [[Part_Fuse|Part Fuse]].
# Save your file.

== Export Method 1: Using "File Export" == <!--T:12-->

<!--T:16-->
# With the default settings, this method creates a mesh with noticeably jagged curves. To get a smoother finish when e.g. 3D printing, the mesh resolution should be configured:
## Make sure the [[Image:Workbench_Mesh.svg|24px]] [[Mesh_Workbench|Mesh Workbench]] has been loaded (it is not loaded by default).
## Go to {{MenuCommand|Edit → Preferences... → Import-Export → Mesh Formats}}.
## Change {{MenuCommand|Maximum mesh deviation}}. A lower value will produce a mesh with a higher resolution.
# Select the solid to be exported in the tree view.
# Choose {{MenuCommand|File → Export...}} and set the file type to {{MenuCommand|STL mesh (*.stl *.ast)}}.
# Enter your file name. The default extension is {{FileName|.stl}}. You must include the extension {{FileName|.ast}} to produce an {{FileName|.ast}} file.
# Choose {{Button|Save}}.

== Export Method 2: Using the Mesh Workbench in FreeCAD == <!--T:13-->


== Sample part == <!--T:3-->
<!--T:5-->
# Switch to the [[Image:Workbench_Mesh.svg|24px]] [[Mesh_Workbench|Mesh Workbench]].
You can use your own FreeCAD file, but you could also create a quick test file by
# Select the solid to be meshed in the tree view.
*Opening FreeCAD
# Choose {{MenuCommand|Meshes → [[Image:Mesh_FromPartShape.svg|24px]] Create Mesh from shape...}} from the main (top) menu.
*Create a new document
# Select one of the available meshers and specify the available options. For more information refer to [[Mesh_FromPartShape|Mesh from Shape]].
*Switch to part workbench
# Choose {{Button|OK}}. The mesh object will be created in the tree view (with a green mesh icon [[Image:Workbench_Mesh.svg|16px]]).
*Insert a cube by clicking on [[Image:Part_Box.png|32px]]
# Right click the mesh object in the tree view and choose {{MenuCommand|[[Image:Mesh_Export.svg|24px]] Export mesh...}}.
*Insert a cone by clicking on [[Image:Part_Cone.png|32px]]
# Fill in the file name, the extension is not necessary. The extension will be set based on the file type. If you include an extension which does not match the selected file type, an extension for the selected type will be added when the file is saved.
*Select both objects in the tree view
# The default file type is {{MenuCommand|Binary STL (*.stl)}}. Change the type if you wish.
*Apply a fusion by clicking on [[Image:Part_Fuse.png|32px]]
# Choose {{Button|Save}}.
*Save your file


==Export Method 1: Using "File Export"== <!--T:4-->
== Which Method to choose ? == <!--T:14-->
*Select the solid to be exported in the tree view.
*Choose {{KEY| File}} {{KEY| Export...}} and set file type to "STL mesh (*.stl *.ast)".
*Enter your file name. The default extension is ".stl". You must include the extension ".ast" in the file name to produce a .ast file. Choose {{KEY| Save}}.


<!--T:7-->
==Export Method 2: Using the mesh workbench in FreeCAD== <!--T:5-->
* Method 1 can be used for most situations where a mesh file is needed.
*Switch to the [[Mesh Workbench]].
* With method 2 you can verify the mesh in FreeCAD. And if you have more than one solid to convert you can use Tools from the [[Mesh_Workbench|Mesh Workbench]]. For example, you can fuse meshes before exporting.
*Select the solid to be meshed in the tree view.
*Choose {{KEY| Meshes}}{{KEY|[[Image:Mesh_Mesh_from_Shape.svg|32px]] Create Mesh from shape...}} from the main (top) menu.
*Select one of the three available meshers and specify the available options. For more information refer to [[Mesh FromPartShape|Mesh from Shape]].
*Choose {{KEY| OK}}. The mesh object will be created in the tree view (with green mesh icon).
*Right click the mesh object in the tree view and choose {{KEY|[[Image:Mesh_ExportMesh.png|32px]] Export mesh...}}.
*Fill in the file name; the extension is not necessary. The extension will be set based on the file type. If you include an extension which does not match the selected file type, an extension for the selected type will be added when the file is saved. If you include an extension which matches the file type, no additional extension will be added.
*The default file type is "Binary STL (*.stl)". Change the type if you wish.
*Choose {{KEY| Save}}.


==Which Method to choose ?== <!--T:7-->
== Links == <!--T:15-->
Method 2 is to be preferred. Among the reasons:
*When you have more than one Body to convert you can use Tools from [[Mesh Workbench|Mesh Workbench]]. For example, you can fuse meshes before exporting.
*Curved surfaces are represented in STL as a series of straight-line segments, generated via tessellation. This results in slightly under-sized inside dimensions for curved surfaces. If you are exporting to use in 3D-printing, this may result in an under-sized hole, for example. In such cases you may need a finer tessellation value. When exporting from another workbench using {{KEY| File}} → {{KEY| Export...}}, the tessellation is controlled by the overall display tessellation set in {{KEY| Edit}} → {{KEY| Preferences...}} → Part Design → Shape view. However, because those parameters control the tessellation used to render shapes on the display, decreasing them will slow down display rendering, often significantly. In addition, exporting immediately after changing the display tessellation preference value will not have the desired effect because display tessellation is not updated immediately. One must force a change in the underlying model to cause the tessellation to be recomputed -- for example, by editing a sketch parameter (Setting it to its original value will suffice).


==Links== <!--T:6-->
<!--T:6-->
* [[Import_from_STL_or_OBJ|Import from STL or OBJ]]
* [[Import_from_STL_or_OBJ|Import from STL or OBJ]]
* [[Import_Export|Import Export]]




</translate>
</translate>
{{Userdocnavi{{#translation:}}}}
{{clear}}
[[Category:File_Formats{{#translation:}}]]

Latest revision as of 10:06, 1 December 2023

Tutorial
Topic
Export to STL or OBJ
Level
Beginner
Time to complete
20 minutes
Authors
r-frank
FreeCAD version
0.16.6703
Example files
None
See also
None

Introduction

In this tutorial we will cover how to export STL/OBJ-files from FreeCAD. The mesh-format STL/OBJ is dimensionless; FreeCAD will assume on export that the units used in the model are in mm. If this is not the case you have to scale your model. One way to do this is using Draft Scale.

Sample part

You can use your own FreeCAD file, but you can also create a quick test file:

  1. Open FreeCAD.
  2. Create a new document.
  3. Switch to Part Workbench.
  4. Insert a cube by clicking on Part Box/Cube.
  5. Insert a cone by clicking on Part Cone.
  6. Select both objects in the tree view.
  7. Apply a fusion by clicking on Part Fuse.
  8. Save your file.

Export Method 1: Using "File → Export"

  1. With the default settings, this method creates a mesh with noticeably jagged curves. To get a smoother finish when e.g. 3D printing, the mesh resolution should be configured:
    1. Make sure the Mesh Workbench has been loaded (it is not loaded by default).
    2. Go to Edit → Preferences... → Import-Export → Mesh Formats.
    3. Change Maximum mesh deviation. A lower value will produce a mesh with a higher resolution.
  2. Select the solid to be exported in the tree view.
  3. Choose File → Export... and set the file type to STL mesh (*.stl *.ast).
  4. Enter your file name. The default extension is .stl. You must include the extension .ast to produce an .ast file.
  5. Choose Save.

Export Method 2: Using the Mesh Workbench in FreeCAD

  1. Switch to the Mesh Workbench.
  2. Select the solid to be meshed in the tree view.
  3. Choose Meshes → Create Mesh from shape... from the main (top) menu.
  4. Select one of the available meshers and specify the available options. For more information refer to Mesh from Shape.
  5. Choose OK. The mesh object will be created in the tree view (with a green mesh icon ).
  6. Right click the mesh object in the tree view and choose Export mesh....
  7. Fill in the file name, the extension is not necessary. The extension will be set based on the file type. If you include an extension which does not match the selected file type, an extension for the selected type will be added when the file is saved.
  8. The default file type is Binary STL (*.stl). Change the type if you wish.
  9. Choose Save.

Which Method to choose ?

  • Method 1 can be used for most situations where a mesh file is needed.
  • With method 2 you can verify the mesh in FreeCAD. And if you have more than one solid to convert you can use Tools from the Mesh Workbench. For example, you can fuse meshes before exporting.

Links