Headless FreeCAD: Difference between revisions

From FreeCAD Documentation
(Simplified the "Searching FreeCAD Modules" paragraph. There is no need to copy the help text.)
(Marked this version for translation)
 
Line 3: Line 3:
<translate>
<translate>


== Introduction ==
== Introduction == <!--T:1-->


<!--T:2-->
This wiki page will document various aspect of running FreeCAD in the console without enabling the GUI (Graphical User Interface) or what is called 'headless'.
This wiki page will document various aspect of running FreeCAD in the console without enabling the GUI (Graphical User Interface) or what is called 'headless'.


== Scenegraph Representation ==
== Scenegraph Representation == <!--T:3-->


<!--T:4-->
As it's not possible to create or access the [[Viewprovider|view provider]] in headless mode. What's possible is to load {{incode|FreeCADGui}} in headless mode but there is no way to access the GUI document because it won't be created and consequently there exist no view providers.
As it's not possible to create or access the [[Viewprovider|view provider]] in headless mode. What's possible is to load {{incode|FreeCADGui}} in headless mode but there is no way to access the GUI document because it won't be created and consequently there exist no view providers.


<!--T:5-->
However, what's possible is to create a [[Scenegraph|scenegraph]] representation of an object:
However, what's possible is to create a [[Scenegraph|scenegraph]] representation of an object:


Line 26: Line 29:
<translate>
<translate>


<!--T:6-->
See: [https://forum.freecadweb.org/viewtopic.php?f=10&t=55794&p=481586#p481586 forum thread].
See: [https://forum.freecadweb.org/viewtopic.php?f=10&t=55794&p=481586#p481586 forum thread].


== Examples ==
== Examples == <!--T:7-->


=== Searching FreeCAD Modules ===
=== Searching FreeCAD Modules === <!--T:8-->


<!--T:9-->
# Open the terminal and type:
# Open the terminal and type:
#:{{incode|$ /path/to/FreeCAD -c}}
#:{{incode|$ /path/to/FreeCAD -c}}
Line 40: Line 45:
# Type {{incode|modules freecad}}.
# Type {{incode|modules freecad}}.


== Related ==
== Related == <!--T:10-->


<!--T:11-->
* [[Embedding_FreeCAD#Using_FreeCAD_without_GUI|Embedding FreeCAD]]
* [[Embedding_FreeCAD#Using_FreeCAD_without_GUI|Embedding FreeCAD]]
* [[Start_up_and_Configuration#Running_FreeCAD_without_GUI_(headless)|Start up and Configuration]]
* [[Start_up_and_Configuration#Running_FreeCAD_without_GUI_(headless)|Start up and Configuration]]

Latest revision as of 09:37, 20 November 2021

Other languages:

Introduction

This wiki page will document various aspect of running FreeCAD in the console without enabling the GUI (Graphical User Interface) or what is called 'headless'.

Scenegraph Representation

As it's not possible to create or access the view provider in headless mode. What's possible is to load FreeCADGui in headless mode but there is no way to access the GUI document because it won't be created and consequently there exist no view providers.

However, what's possible is to create a scenegraph representation of an object:

import FreeCADGui as Gui
from pivy import coin

Gui.setupWithoutGUI()
doc = App.newDocument()
obj = doc.addObject("Part::Box","Box")
doc.recompute()
view = Gui.subgraphFromObject(obj)

See: forum thread.

Examples

Searching FreeCAD Modules

  1. Open the terminal and type:
    $ /path/to/FreeCAD -c
    or
    $ /path/to/FreeCADCmd
  2. A python shell will start with a prompt. Type help().
  3. A help text is displayed.
  4. Type modules freecad.

Related