FreeCAD Logo FreeCAD 1.0
  • English Afrikaans Arabic Belarusian Catalan Czech German Greek Spanish Spanish Basque Finnish Filipino French Galician Croatian Hungarian Indonesian Italian Japanese Kabyle Korean Lithuanian Dutch Norwegian Bokmal Polish Portuguese Portuguese Romanian Russian Slovak Slovenian Serbian Swedish Turkish Ukrainian Valencian Vietnamese Chinese Chinese
  • Features
  • Download
  • Blog
  • Documentation
    Documentation index Getting started Users documentation The FreeCAD manual Workbenches documentation Python coding documentation C++ coding documentation Tutorials Frequently asked questions Privacy policy About FreeCAD
  • Contribute
    How to help Sponsor Report a bug Make a pull request Jobs and funding Contribution guidelines Developers handbook Translations
  • Community
    Code of conduct Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendar
  • ♥ Donate

Donate

$
SEPA Information
Please set up your SEPA bank transfer to:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Bank agency: BNP Paribas Fortis
Address: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

The FreeCAD source code

The FreeCAD source code is managed with git, and is public, open and available under the LGPL license. It can be copied, downloaded, read, analyzed, redistributed and modified by anyone. If you plan to make modifications that you wish to see included into the official code itself, remember that your changes will need to be approved by the FreeCAD developers, so it is wise to discuss first your intents and ideas on the forum, to avoid the risk to have your changes rejected for some reason you didn\'t foresee.

Below are some clues and useful information to get you on tracks if you are interested in exploring the FreeCAD code.

  • The FreeCAD code is programmed mainly in C++, but relies heavily on Python. A very large part of its functionality provides associated Python bindings, and it is part of the core philosophy of the FreeCAD development to always offer python access to any new feature implemented in C++. To obtain this, CPython (the C interfacing tools provided by Python itself) and specially PyCXX are heavily used throughout FreeCAD. Many templates and custom tools are also provided in the FreeCAD code itself to turn the building of associated python bindings very easy. Some more high-level parts of the FreeCAD code are coded fully in Python.

  • The FreeCAD source code is fully multi-platform, and great care is taken to allow to use the application on a biggest possible number of platforms and configurations, and not put existing users in difficult situations. Therefore, as much as possible, new versions of needed components are avoided while they are not widely and easily available on all platforms, and backwards compatibility (the ability to open a file produced with an old version of FreeCAD on a newer version) is an important priority.

  • Almost all the functionality of FreeCAD is separated in two different parts, named App and Gui. This separation is reflected everywhere in the files structure of the source code. App contains all the functionality that needs to run in pure console mode (no GUI). As FreeCAD can be compiled and run without its Graphical User Interface, the code in App is independent of any GUI-related library. Gui contains all the code needed to run in GUI mode, and is built around the App functionality.

  • Most of FreeCAD\'s functionality is implemented in Modules. FreeCAD without its module is a simple container window that can just open and save a file. All the geometry tools and workbenches are implemented in Modules. Modules can be written in C++, in Python, or combining the best of the two worlds. They can be hybrid C++/Python modules, where solid core functionality is programmed in C++ and end-user tools are written in Python making them easier to extend and adapt by FreeCAD users. Each module usually defines and creates a Workbench in the FreeCAD interface, when used in GUI mode, usually with the same name, but it is not mandatory for modules to contain a workbench.

  • FreeCAD modules often depend on other modules. Most modules that use solid geometry depend on the Part module, which is the most fundamental module of FreeCAD, and implements most of the interfacing with OpenCascade. Although other module can use OpenCascade functionality directly, they often rely on higher-level functions provided by Part.

  • Modules are always initialized from Python. Even if they are written fully in C++, they always contain a minimal Python/CPython structure.

  • FreeCAD is an avid user of other open-source libraries. Besides Python and Qt, used by the core and almost all of the modules, the two heavyweight libraries used throughout most modules are OpenCascade Technology (OCCT) and Coin3D. OpenCascade is used to create and manage all the solid geometry of FreeCAD, while coin3D is used to manage the 3D view. OpenCascade is used mainly in the App world, and coin3D exclusively in the Gui world. A basic understanding of OpenCascade is fundamental to do any geometry-related work with FreeCAD. More specific modules make use of more specific libraries, and since there are usually no restrictions on that point apart from these libraries to be easily available on all platforms, the list of dependencies of a full FreeCAD installation with all its modules can be quite large.

  • FreeCAD\'s document objects, which are all the objects contained in a FreeCAD document, are what appear in the Tree View in the GUI and in FreeCAD.ActiveDocument.Objects() in Python. They may or may not have any geometrical data, and may or may not show anything in the 3D view. They are always separated in App and Gui parts. The Gui part is not loaded when running in console mode. Standard geometrical objects, such as those found in Part or PartDesign, have their OpenCascade-based geometry defined in their App counterpart, while the Gui counterpart (also usually called \"View Provider\") is responsible for creating a coin3D representation of that geometry, which will be inserted into the main coin3D scene graph of the 3D view.

  • The basic directory structure of the source code is organized like this:

    • App: contains the FreeCAD console-mode application, defines basic structures and base classes for document objects, that are used by modules to build their own.
    • Base: contains core functionality commonly used everywhere in FreeCAD: 3D vectors, units, matrices, placements, etc.
    • Gui: contains the FreeCAD GUI-mode application, defines the 3D view, contains many tools and functions to be used by workbenches to interact with the interface and with the 3D view, defines base classes for view providers.
    • Doc: contains mainly an all-in-one Qt help file generated from this wiki.
    • Mod: contains all the modules, themselves further separated into App and Gui (except for python modules, which don\'t always follow that rule so clearly).

Related

  • Source Code Management
  • The Power users hub contains a lot of documentation about modules, OpenCascade and Coin3D, mainly for the Python programmer. However, as the functionality is similar, these pages will be of interest to the C++ programmer as well.
  • FCStd - the FreeCAD file format

⏵ documentation index > Developer Documentation > The FreeCAD source code

This page is retrieved from https://github.com/FreeCAD/FreeCAD-documentation/blob/main/wiki/The_FreeCAD_source_code.md

Get in touch!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD Team. Homepage image credits (top to bottom): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

This project is supported by: , KiCad Services Corp. and other sponsors

GitHubImprove this page on GitHub