Export to STL or OBJ: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
No edit summary
(28 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<languages/>
<translate>
<translate>
<!--T:1-->
<!--T:1-->
Line 12: Line 13:
== Introduction == <!--T:2-->
== Introduction == <!--T:2-->
In this tutorial we will cover how to export STL/OBJ-files from FreeCAD.
In this tutorial we will cover how to export STL/OBJ-files from FreeCAD.
Since the mesh-format STL/OBJ is dimensionless, FreeCAD will assume
The mesh-format STL/OBJ is dimensionless; FreeCAD will assume
on export that the units used in the model are in mm.
on export that the units used in the model are in mm.
If this is not the case you have to scale your model .
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]].


== Sample part == <!--T:3-->
== Sample part == <!--T:3-->
Line 20: Line 22:
*Opening FreeCAD
*Opening FreeCAD
*Create a new document
*Create a new document
*Switch to [[Image:Workbench_Part.svg|24px]] [[Part Module|Part Workbench]]
*Switch to part workbench
*Insert a cube by clicking on [[Image:Part_Box.png|32px]]
*Insert a cube by clicking on [[Image:Part_Box.svg|32px]] [[Part Box|Part Box/Cube]]
*Insert a cone by clicking on [[Image:Part_Cone.png|32px]]
*Insert a cone by clicking on [[Image:Part_Cone.svg|32px]] [[Part Cone]]
*Select all two objects in the tree view
*Select both objects in the [[tree view]]
*Apply a fusion by clicking on [[Image:Part_Fuse.png|32px]]
*Apply a fusion by clicking on [[Image:Part_Fuse.svg|32px]] [[Part Union]]
*Save your file
*Save your file


==Export Method 1: Using "File > Export"== <!--T:4-->
==Export Method 1: Using "File Export"== <!--T:4-->
*Select the solid to be exported in the tree view.
*Switch to mesh workbench or complete workbench
*Choose {{KEY| Edit}} → {{KEY| Preferences}} → {{KEY| Import-Export}} {{KEY| Mesh Formats}} from the top menu
*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}}.
*Here you can specify the maximum mesh deviation (0,1 mm is default) which controls how "fine" your mesh will get
*Close dialogue with {{KEY| OK}}
*Select the solid to be exported in the tree view
*Choose {{KEY| File}} → {{KEY| Export...}} and set file type to for example "STL mesh (*.stl *.ast)"
*Type in your file name and don't forget the extension, choose {{KEY| Save}}


==Export Method 2: Using the mesh workbench in FreeCAD== <!--T:5-->
==Export Method 2: Using the mesh workbench in FreeCAD== <!--T:5-->
*Switch to the [[Image:Workbench_Mesh.svg|24px]] [[Mesh Workbench|Mesh Workbench]]
*Switch to mesh workbench
*Select the solid to be meshed in the tree view
*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 top menu
*Choose {{KEY| Meshes}} → {{KEY|[[Image:Mesh_FromPartShape.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 info refer to [[Mesh MeshFromShape|this page (Mesh from Shape)]]
*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}} and the mesh object will be created in the tree view (with green mesh icon)
*Choose {{KEY| OK}}. The mesh object will be created in the tree view (with green mesh icon [[Image:Workbench_Mesh.svg|16px]]).
*Select the mesh object in the tree view and right click on mesh object in the tree view
*Right click the mesh object in the tree view and choose {{KEY|[[Image:Mesh_Export.svg|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.
*Choose {{KEY|[[Image:Mesh_ExportMesh.png|32px]] Export mesh}} to export mesh
*You will be promted to coose file name (default is the name of the mesh object) and the file type (default is "Binary STL (*.stl)")
*The default file type is "Binary STL (*.stl)". Change the type if you wish.
*Choose {{KEY| Save}} and you are finished
*Choose {{KEY| Save}}.


==Which Method to choose ?== <!--T:7-->
Method 2 is to be preferred. Among the reasons:
*When you have more than one Body to convert you can use Tools from [[Image:Workbench_Mesh.svg|24px]] [[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-->
* [[Import_from_STL_or_OBJ|Import from STL or OBJ]]
* [[Import Export]]


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

{{clear}}
{{clear}}
<languages/>

Revision as of 21:57, 22 February 2020

Tutorial
Topic
Export to STL or OBJ
Level
Beginner
Time to complete
20 minutes
Authors
r-frank
FreeCAD version
0.16.6703
Example files
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 could also create a quick test file by

Export Method 1: Using "File → Export"

  • Select the solid to be exported in the tree view.
  • Choose File 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 Save.

Export Method 2: Using the mesh workbench in FreeCAD

  • Switch to the Mesh Workbench
  • Select the solid to be meshed in the tree view.
  • Choose Meshes 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 from Shape.
  • Choose 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 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 Save.

Which Method to choose ?

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. 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 File Export..., the tessellation is controlled by the overall display tessellation set in Edit 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