Description of Defects in migrationScript2 and migrationScript4:
Several additional issues have been identified in the Assembly
functions migrationScript4 and migrationScript2, beyond those fixed in
patch 71f0104bb2.
One common problem is that the Joint property Reference1 or Reference2
can be set to an invalid format. For example, user can manually cause
this issue by assigning an incorrect reference (e.g., the Z-axis) to
these properties via the FreeCAD GUI. When this happens, internal
errors (exceptions and their corresponding Python call stack) are
reported in the Report View. However, such information is not helpful
for the user to fix their 3D model.
Issues with the Current Implementation (Using migrationScript4 as
Reference):
- Lack of Type Validation for Reference1 and Reference2:
The script does not check whether joint.Reference1[1] or
joint.Reference2[1] is a sequence. If this condition is not met,
statements like:
sub1 = joint.Reference1[1][0]
will throw an exception, printing the Python call stack.
- Lack of Length Validation for Sequences:
The script does not ensure that the sequence length is sufficient
for indexing. For example, joint.Reference1 and joint.Reference2
must each have at least two elements to allow:
joint.Reference1[1][1]
joint.Reference2[1][1]
Without validation, such calls can result in exceptions, printing the
Python call stack.
- No Feedback on Problematic Joint:
The user is not informed about which Assembly joint in the object
hierarchy has an invalid Reference1 or Reference2. Depending on the
size of the 3D model, identifying the defect can be time-consuming
and frustrating without proper feedback.
This patch is focused on:
- Reporting Problematic Joint Path:
A new function has been added to retrieve the full path to the
Assembly joint. The return value (a string) is used to report the
issue.
- Improved Exception Handling:
Instead of adding more conditional checks (see above), exception
handling is implemented. AttributeError, IndexError, and TypeError
exceptions are caught. The exception message (excluding the call
stack) is displayed at the end of a user-friendly warning.
- User-Friendly Warnings in the Report View:
A single-line warning is now shown in the Report View, containing
the following details:
- Source of Warning: 'Assembly joint'
- Location in the 3D Model: e.g., 'Assembly_XY.object_XY.joint_XY'
- Problematic Attribute: e.g., 'ReferenceXY'
- Exception Message: e.g., 'list index out of range'
- Refactoring and Optimization:
The functions were refactored and optimized at the end of the
conversion process.
Advantages:
- Cleaner Report View:
Internal errors (e.g., Python call stacks) are no longer logged in
the Report View, as they are not useful for end users. Only the
exception message is displayed.
- Improved User Feedback:
Users can now identify the problematic Assembly joint in the object
hierarchy, saving significant time and effort.
- Robust and Concise Code:
The solution simplifies the code while increasing its robustness.
Your own 3D parametric modeler
Website • Documentation • Forum • Bug tracker • Git repository • Blog
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 to change its parameters.
-
Create 3D from 2D and back FreeCAD lets 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, programmer, experienced CAD user, student or teacher.
-
Cross platform FreeCAD runs on Windows, macOS and Linux operating systems.
-
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 packages for stable releases are available for Windows, macOS and Linux on the Releases page.
On most Linux distributions, FreeCAD is also directly installable from the software center application.
For development releases visit the weekly-builds page.
Other options are described on the wiki Download page.
Compiling
FreeCAD requires several dependencies to correctly compile for development and production builds. The following pages contain updated build instructions for their respective platforms:
Reporting Issues
To report an issue please:
- Consider posting to the Forum, Discord channel, or Reddit to verify the issue;
- Search the existing issues for potential duplicates;
- Use the most updated stable or development versions of FreeCAD;
- Post version info from
Help > About FreeCAD > Copy to clipboard; - Restart FreeCAD in safe mode
Help > Restart in safe modeand try to reproduce the issue again. If the issue is resolved it can be fixed by deleting the FreeCAD config files. - Start recording a macro
Macro > Macro recording...and repeat all steps. Stop recording after the issue occurs and upload the saved macro or copy the macro code in the issue; - Post a Step-By-Step explanation on how to recreate the issue;
- Upload an example file (FCStd as ZIP file) to demonstrate the problem;
For more details see:
Note
The FPA offers developers the opportunity to apply for a grant to work on projects of their choosing. Check jobs and funding to know more.
Usage & Getting Help
The FreeCAD wiki contains documentation on general FreeCAD usage, Python scripting, and development. View these pages for more information:
The FreeCAD forum is a great place to find help and solve specific problems when learning to use FreeCAD.
This project receives generous infrastructure support from
and KiCad Services Corp.