Power users hub: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
(Marked this version for translation)
(14 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<languages/>
<translate>
<translate>


Line 8: Line 9:


<!--T:3-->
<!--T:3-->
These pages are in early stage of development. If you can't find the information you are looking for, or have found useful information somewhere we have not linked to, then please leave a comment on [[Talk:Power_users_hub|the talk page]], or, why not? [[Help_FreeCAD| Add some more content here yourself!]]
These pages are in early stage of development. If you can't find the information you are looking for, or have found useful information somewhere we have not linked to, then please leave a comment on the [http://forum.freecadweb.org/ forum], or, why not? [[Help_FreeCAD| Add some more content here yourself!]]


<!--T:4-->
<!--T:4-->
Line 20: Line 21:


<!--T:6-->
<!--T:6-->
* [[Interface Customization]]: Starting with the beginning: Toolbars and shortcuts
* [[Interface Customization|Interface Customization]]: Starting with the beginning: Toolbars and shortcuts
* [[Macros|Working with Macros]]: Easily record often repeated tasks or Python code
* [[Macros|Working with Macros]]: Easily record often repeated tasks or Python code
* [[Macros_recipes|Macros recipes]]
* [[Customize_Toolbars|Customize Toolbars]]
* [[Installing_more_workbenches|Installing more workbenches]]
* [http://forum.freecadweb.org/viewtopic.php?t=10556 Plugin Loader]
* [https://github.com/FreeCAD/FreeCAD-addons Addons installer.FCMacro]


== Scripting in FreeCAD == <!--T:7-->
== Scripting in FreeCAD == <!--T:7-->


===General=== <!--T:8-->
===General=== <!--T:8-->
* [[Introduction to Python]] - See also other Python tutorials at the bottom of this page
* [[Introduction to Python|Introduction to Python]] - See also other Python tutorials at the bottom of this page
* [[Python scripting tutorial|FreeCAD scripting tutorial]] - A general look at python scripting in FreeCAD
* [[Python scripting tutorial|FreeCAD scripting tutorial]] - A general look at python scripting in FreeCAD
* [[FreeCAD Scripting Basics]]: Well, the basics...
* [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]]: Well, the basics...
* [[Gui Command]] : Adding custom commands to the GUI
* [[Gui Command|Gui Command]] : Adding custom commands to the GUI
* Using mixed [[Units]] in FreeCAD
* Using mixed [[Units|Units]] in FreeCAD


=== Modules === <!--T:28-->
=== Modules === <!--T:28-->


<!--T:29-->
<!--T:29-->
As the functionality of FreeCAD is separated in Modules which deal with special data types and applications. FreeCAD has built-in modules and Extension Modules (plug-ins). Once plugin modules are installed, they become availible to you as easily as the built-in modules. The modules described below are the default modules, includeed in every FreeCAD installation.
The functionality of FreeCAD is separated in Modules which deal with special data types and applications. FreeCAD has built-in modules and Extension Modules (plug-ins). Once plugin modules are installed, they become availible to you as easily as the built-in modules. The modules described below are the default modules, includeed in every FreeCAD installation.


<!--T:30-->
<!--T:30-->
* The [[Builtin modules]] are the principal FreeCAD modules. They contain tools for manipulating general FreeCAD configurations, documents and their contents.
* The [[Builtin modules|Builtin modules]] are the principal FreeCAD modules. They contain tools for manipulating general FreeCAD configurations, documents and their contents.
* [[Workbench creation|Workbench creation]] shows you how to create your own workbench


===Working with Meshes=== <!--T:9-->
====Working with Meshes==== <!--T:9-->
* [[Mesh Scripting]]: How to interact with the [[Mesh Module]]
* [[Mesh Scripting|Mesh Scripting]]: How to interact with the [[Mesh Module|Mesh Module]]


===Working with Parts=== <!--T:10-->
====Working with Parts==== <!--T:10-->
* [[Part Module|The Part Module]]: How [http://en.wikipedia.org/wiki/Open_CASCADE Open CASCADE Technology] tools and structure is used in FreeCAD
* [[Part Module|The Part Module]]: How [http://en.wikipedia.org/wiki/Open_CASCADE Open CASCADE Technology] tools and structure is used in FreeCAD
* [[Topological data scripting]]: How to interact with the Part Module
* [[Topological data scripting|Topological data scripting]]: How to interact with the Part Module
* [[PythonOCC]]: How to unleash the whole Open CASCADE power
* [[PythonOCC|PythonOCC]]: How to unleash the whole Open CASCADE power
* [[Mesh to Part]]: Converting between object types
* [[Mesh to Part|Mesh to Part]]: Converting between object types


===Accessing the Coin scenegraph=== <!--T:11-->
====Accessing the Coin scenegraph==== <!--T:11-->
* [[Scenegraph|The Coin/Inventor scenegraph]]: How the FreeCAD scene representation works
* [[Scenegraph|The Coin/Inventor scenegraph]]: How the FreeCAD scene representation works
* [[Pivy]]: How to access and modify the scenegraph
* [[Pivy|Pivy]]: How to access and modify the scenegraph


===Controlling the Qt interface=== <!--T:12-->
===Controlling the Qt interface=== <!--T:12-->
* [[PySide]]: How to access the interface, and modify its contents
* [[PySide|PySide]]: How to access the interface, and modify its contents
* [[Embedding FreeCADGui|Using the FreeCAD GUI]] in another Qt application with PyQt
* [[Embedding FreeCADGui|Using the FreeCAD GUI]] in another Qt application with PyQt


===Working with parametric objects=== <!--T:13-->
===Working with parametric objects=== <!--T:13-->
* [[Scripted objects]]: How to make 100% Python-scripted objects in FreeCAD
* [[Scripted objects|Scripted objects]]: How to make 100% Python-scripted objects in FreeCAD
* [[Drawing Module]]: Automating the 3D-to-2D process
* [[Drawing Module|Drawing Module]]: Automating the 3D-to-2D process


===Examples=== <!--T:14-->
===Examples=== <!--T:14-->
* [[Code snippets]] : A collection of pieces of FreeCAD Python code, to serve as ingredients in your scripts...
* [[Code snippets|Code snippets]] : A collection of pieces of FreeCAD Python code, to serve as ingredients in your scripts...
* [[Line drawing function]]: How to build a simple tool to draw lines
* [[Line drawing function|Line drawing function]]: How to build a simple tool to draw lines
* [[Dialog creation]]: How to construct dialogs with Qt designer, and use them in FreeCAD
* [[Dialog creation|Dialog creation]]: How to construct dialogs with Qt designer, and use them in FreeCAD
* [[Embedding FreeCAD]]: How to import FreeCAD as a Python module in other applications
* [[Embedding FreeCAD|Embedding FreeCAD]]: How to import FreeCAD as a Python module in other applications
* The [[Draft Module]] adds basic 2d drawing functions to freecad. It is written entirely in Python, so it can be a good example if you want to write your own modules.
* The [[Draft Module|Draft Module]] adds basic 2d drawing functions to freecad. It is written entirely in Python, so it can be a good example if you want to write your own modules.
* [[FreeCAD vector math library]] : A couple of handy functions to manipulate FreeCAD vectors. This library is also included in the Draft module.
* [[FreeCAD vector math library|FreeCAD vector math library]] : A couple of handy functions to manipulate FreeCAD vectors. This library is also included in the Draft module.


== API Functions == <!--T:15-->
== API Functions == <!--T:15-->


<!--T:16-->
<!--T:16-->
The complete API description can be found [[:Category:API|here]]. Note that it can be incomplete, since we still didn't find a way to include it automatically on this wiki. For more accurate information, browse the modules directly from FreeCAD.
The complete API documentation of FreeCAD is located at http://www.freecadweb.org/api/ . It contains both C++ and Python APIs, and is not totally well formatted yet, which can be confusing when looking for python-only code. An easier to browse version can be found [[:Category:API|here]]. Note that it can be incomplete, since it is updated manually. For more accurate information, browse the modules directly from FreeCAD's Python console.

<!--T:34-->
Related: [[Exposing_C%2B%2B_to_Python|Exposing C++ to Python]]


== Advanced modification == <!--T:17-->
== Advanced modification == <!--T:17-->


<!--T:18-->
<!--T:18-->
* [[Start up and Configuration]]: Startup and command line options
* [[Start up and Configuration|Start up and Configuration]]: Startup and command line options
* [[Install on Windows]]: Using the windows installer
* [[Install on Windows|Install on Windows]]: Using the windows installer
* [[CompileOnWindows|Compiling FreeCAD on Windows]] and [[CompileOnUnix|Compiling FreeCAD on Unix]]
* [[CompileOnWindows|Compiling FreeCAD on Windows]] and [[CompileOnUnix|Compiling FreeCAD on Unix]]
* [[Branding]]: Simple modifications you can do to the source code to change some aspects of FreeCAD
* [[Branding|Branding]]: Simple modifications you can do to the source code to change some aspects of FreeCAD
* [[Extra python modules]] : Extend the FreeCAD python interpreter with these powerful modules!
* [[Extra python modules|Extra python modules]] : Extend the FreeCAD python interpreter with these powerful modules!


== Python tutorials == <!--T:19-->
== Python tutorials == <!--T:19-->
Line 90: Line 100:
<!--T:21-->
<!--T:21-->
'''Python'''
'''Python'''
* [http://docs.python.org/tut/tut.html Official python tutorial] - A very complete tutorial for discovering python
* [https://docs.python.org/2.7/tutorial/index.html Official python tutorial] - A very complete tutorial for discovering python
* [http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python Non-programmer tutorial for python] - an excellent wikibook
* [http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python Non-programmer tutorial for python] - an excellent wikibook
* [http://npt.cc.rsu.ru/user/wanderer/ODP/Python_for_Newbies.htm Python for newbies] - one big tutorial covering all the basics
* [http://npt.cc.rsu.ru/user/wanderer/ODP/Python_for_Newbies.htm Python for newbies] - one big tutorial covering all the basics
Line 110: Line 120:
<!--T:23-->
<!--T:23-->
'''Pivy''' - How to interact with FreeCAD's 3D scenes
'''Pivy''' - How to interact with FreeCAD's 3D scenes
* [http://pivy.coin3d.org/documentation/pycon Basic Pivy tutorial] : A very simple tutorial form the official Pivy site
* [http://pivy.coin3d.org/documentation/pycon Basic Pivy tutorial] : A very simple tutorial from the official Pivy site
* [http://www.google.com.br/url?sa=U&start=3&q=http://studierstube.icg.tu-graz.ac.at/doc/pdf/PivyStudierstubeTutorial.pdf&ei=XyC1Sc2wOeCKmQem_eHnBQ&usg=AFQjCNEYhb-0DcUc6OxFVijAe1epBb-4aA Introducing Pivy into studierstube] : A document that is not really a tutorial, but that illustrates well how Pivy works
* [http://www.google.com.br/url?sa=U&start=3&q=http://studierstube.icg.tu-graz.ac.at/doc/pdf/PivyStudierstubeTutorial.pdf&ei=XyC1Sc2wOeCKmQem_eHnBQ&usg=AFQjCNEYhb-0DcUc6OxFVijAe1epBb-4aA Introducing Pivy into studierstube] : A document that is not really a tutorial, but that illustrates well how Pivy works


Line 116: Line 126:


<!--T:25-->
<!--T:25-->
On the [[FreeCAD Community Portal|Community portal]], you can find other FreeCAD-based projects run by the FreeCAD users community. If you are starting a new FreeCAD project, be sure to list it there! We also have a page with things you can do if you would like to [[Help FreeCAD]].
On the [[FreeCAD Community Portal|Community portal]], you can find other FreeCAD-based projects run by the FreeCAD users community. If you are starting a new FreeCAD project, be sure to list it there! We also have a page with things you can do if you would like to [[Help FreeCAD|Help FreeCAD]].

<!--T:32-->
{{Userdocnavi}}


<!--T:27-->
<!--T:27-->
[[Category:Hubs]]
[[Category:Hubs]]

<!--T:33-->
[[Category:Poweruser Documentation]]
[[Category:Poweruser Documentation]]


</translate>
</translate>

<languages/>

Revision as of 21:35, 16 June 2019

150
150

This is the place to come if you want to have a deeper insight into FreeCAD. Here you can learn about customizing FreeCAD for your needs.

These pages are in early stage of development. If you can't find the information you are looking for, or have found useful information somewhere we have not linked to, then please leave a comment on the forum, or, why not? Add some more content here yourself!

One of the nicest features of FreeCAD is that you can script and extend it extremely far without the need to compile anything or touch the source code. All the scripting part is done in Python, a very powerful but simple programming language. With simple Python scripts, you have total access to about any part of FreeCAD. For example, you can:

  • Create and modify geometry: Is there a special object you need that's not present in the default FreeCAD installation? You can easily create a new object type, either from scratch or by adapting an existing type.
  • Create custom tools and commands: At the moment, FreeCAD already has extensive functionality, but there aren't many convenient tools and commands for the final user yet. But it is already easy to create your own sets of tools.
  • Modify the interface: The FreeCAD user interface is still very basic at this stage. But everything is there for you to extend it to your needs. You can, for example, create toolbars to put your own tools, create special panels for interacting with your tools, etc.
  • Modify the scene representation: FreeCAD has separate processes for building up and computing the geometry and displaying that geometry on your screen. You have full access to the way the scene contents are displayed on screen, therefore you can modify that representation, interact with it, or add all kinds of custom behaviours and screen widgets, like information, draggers, anchors or temporary entities.

Customizing FreeCAD

Scripting in FreeCAD

General

Modules

The functionality of FreeCAD is separated in Modules which deal with special data types and applications. FreeCAD has built-in modules and Extension Modules (plug-ins). Once plugin modules are installed, they become availible to you as easily as the built-in modules. The modules described below are the default modules, includeed in every FreeCAD installation.

  • The Builtin modules are the principal FreeCAD modules. They contain tools for manipulating general FreeCAD configurations, documents and their contents.
  • Workbench creation shows you how to create your own workbench

Working with Meshes

Working with Parts

Accessing the Coin scenegraph

Controlling the Qt interface

Working with parametric objects

Examples

  • Code snippets : A collection of pieces of FreeCAD Python code, to serve as ingredients in your scripts...
  • Line drawing function: How to build a simple tool to draw lines
  • Dialog creation: How to construct dialogs with Qt designer, and use them in FreeCAD
  • Embedding FreeCAD: How to import FreeCAD as a Python module in other applications
  • The Draft Module adds basic 2d drawing functions to freecad. It is written entirely in Python, so it can be a good example if you want to write your own modules.
  • FreeCAD vector math library : A couple of handy functions to manipulate FreeCAD vectors. This library is also included in the Draft module.

API Functions

The complete API documentation of FreeCAD is located at http://www.freecadweb.org/api/ . It contains both C++ and Python APIs, and is not totally well formatted yet, which can be confusing when looking for python-only code. An easier to browse version can be found here. Note that it can be incomplete, since it is updated manually. For more accurate information, browse the modules directly from FreeCAD's Python console.

Related: Exposing C++ to Python

Advanced modification

Python tutorials

These are good generic tutorials, not specific to FreeCAD, that might interest you if you are totally new to python.

Python

PySide - How to create and manage FreeCAD's Qt UI interface from python

The following two references are PyQt specific (not PySide) but may offer some information of use:

Pivy - How to interact with FreeCAD's 3D scenes

Community projects

On the Community portal, you can find other FreeCAD-based projects run by the FreeCAD users community. If you are starting a new FreeCAD project, be sure to list it there! We also have a page with things you can do if you would like to Help FreeCAD.