==============================================
Take advantage of PropertyGeometryList setValues() move overload in order to make code more readable and prevent
memory leaks (mostly by inadvertedly not deleting cloned geometry and constraints).
PropertyGeometryList and PropertyConstraintList are vectors of heap allocated pointers. Copying a vector
makes a shallow copy, not a deep copy (the pointers are the same in the copy).
For property management, setValues() function taking a const reference effectively make a deep copy of all
pointed objects. This means that heap allocated pointers of the client class passed to these functions must be
released by the client. While this sounds sensible, forgetting to is easy. In the cases where the developer
remembered to release these pointers, extra code is needed just for memory management.
This commit does not seek a substantial performance increase that would justify rewritting the code, although code
may be slightly faster sometimes.
Functions where setValues() is conditional are not changed to move semantics, as it makes no sense to make a deep copy to sometimes
perform a second deep copy later on. This code still uses const ref setValues().
CHECKS performed to refactored functions with this commit:
1) That the vector is NOT used after moving its content.
2) That whereever there is a clone(), there must be EITHER
-a std::move if using rvalue setValues()
OR
- a delete to free the heap memory after setValues if using the const ref setValues()
3) That memory is released if an exception occurred.
N.B.: A couple of memory leaks are fixed in this commit too.
Your own 3D parametric modeler
Website • Documentation • Forum • Bug tracker • Git repository
This project receives generous infrastructure support from
Overview
-
Freedom to build what you want FreeCAD is an open-source parametric 3D modeler made primarily to design real-life objects of any size. Parametric modeling allows you to easily modify your design by going back into your model history and changing its parameters.
-
Create 3D from 2D & back FreeCAD allows you to sketch geometry constrained 2D shapes and use them as a base to build other objects. It contains many components to adjust dimensions or extract design details from 3D models to create high quality production ready drawings.
-
Designed for your needs FreeCAD is designed to fit a wide range of uses including product design, mechanical engineering and architecture. Whether you are a hobbyist, a programmer, an experienced CAD user, a student or a teacher, you will feel right at home with FreeCAD.
-
Cross platform FreeCAD runs on Windows, Mac and Linux
-
Underlying technology
- OpenCASCADE A powerful geometry kernel, the most important component of FreeCAD
- Coin3D library Open Inventor-compliant 3D scene representation model
- Python FreeCAD offers a broad Python API
- Qt Graphical User Interface built with Qt
Installing
Precompiled (installable) packages are available for Windows and Mac on the Releases page.
On most Linux distributions, FreeCAD is directly installable from the software center application.
Other options are described at the wiki Download page.
Build Status 
| Master | 0.18 | Translation |
|---|---|---|
Compiling
Compiling FreeCAD requires installation of several libraries and their development files such as OpenCASCADe, Coin and Qt, listed in the pages below. Once this is done, FreeCAD can be simply compiled with cMake. On Windows, these libraries are bundled and offered by the FreeCAD team in a convenient package. On Linux, they are usually found in your distribution's repositories, and on Mac OSX and other platforms you will usually need to compile them yourself.
The pages below contain up-to-date build instructions:
Usage & Getting help
The FreeCAD wiki contains documentation on general FreeCAD usage, Python scripting, and development. These pages might help you get started:
The FreeCAD forum is also a great place to find help and solve specific problems you might encounter when learning to use FreeCAD.
