Roy-043 c2484914f2 Draft: Update the Plane class (step 2)
Related issue:
#5603.

Previous PRs:
#10766
#10838

The remaining Plane class functions have been processed (some are unchanged):

`setup`
* Updated to use new functions.
* The `direction` etc. arguments are never used AFAICT.
* Added `from draftutils import gui_utils`.

`reset`
* Unchanged.

`setTop`
* Calls `super().set_to_top()`. That function does not use `align_to_point_and_axis` but specifies exact vectors for improved accuracy.
* `import FreeCADGui` already happens at the top of the file.
* The code block after `if FreeCAD.GuiUp:` was kept for now.

`setFront`
* Idem.

`setSide`
* This function sets the WP to the left side position, and not to the right side postion as in the Draft_SelectPlane command.
* Idem.

`getRotation`
* Revised.
* The function has an akward name as it returns a Placement.
* The special code for Arch active container is obsolete (was already commented out in other functions).

`getPlacement`
* The `rotated argument` is ignored now. It was only used in the context of the old `placement_from_face` algorithm. See `DraftGeomUtils.placement_from_face` for the new implementation.
* Calls `super().get_placement()`.

`getNormal`
* Basically unchanged.

`setFromPlacement`
* Revised to call `super()` functions.

`inverse`
* Unchanged.

`save`
* Unchanged.

`restore`
* More compact code, but basically unchanged.

`getLocalCoords`
* Calls `super().get_local_coords()` which does not rely on Draft code, but creates a matrix and returns `mtx.inverse().multVec(point)`.

`getGlobalCoords`
* Calls `super().get_global_coords()` which creates a matrix and returns `mtx.multVec(point)`.

`getLocalRot`
* Calls `super().get_local_coords()`.

`getGlobalRot`
* Calls `super().get_global_coords()`.

`getClosestAxis`
* Calls `super().get_closest_axis(vec)` which translates the vector to the WP coordinate system and then finds the closest axis by comparing the absolute coordinates of the vector.

`isGlobal`
* Not used anywhere AFAICT.
* Calls `super().is_global()` which also checks the `position` attribute.
* As before the function works without any tolerance.

`isOrtho`
* Not used anywhere AFAICT.
* The original algorithm did not work properly (there was a comment). All angles were measured relative to the global Y axis. If the WP was randomly rotated around that axis the function would still return `True`. The new algorithm, `super().is_ortho()`, uses rounded Yaw, Pitch and Roll angles to check for orthogonality.

`getDeviation`
* Not used anywhere AFAICT.
* Unchanged.

`getParameters`
* Calls `super().get_parameters()` which uses the local `_get_prop_list` function.

`setFromParameters`
* Calls `super().set_parameters()` which uses the local `_get_prop_list` function.

`_get_prop_list`
* Function used internally. Returns a list of attribute.
2023-10-04 14:40:33 +02:00
2023-03-07 14:05:58 +01:00
2023-09-28 15:25:29 -05:00
2023-02-13 15:46:28 +01:00
2023-08-23 14:49:34 -05:00
2023-08-02 03:34:40 +00:00
2023-08-05 11:29:31 -06:00

Your own 3D parametric modeler

WebsiteDocumentationForumBug trackerGit repositoryBlog

Release Crowdin Liberapay

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 check the weekly-builds page.

Other options are described at the wiki Download page.

Compiling

Compiling FreeCAD requires installation of several libraries and their development files such as OCCT (Open Cascade), Coin and Qt, listed in the pages below. Once this is done, FreeCAD can be 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 macOS and other platforms, you will usually have to compile them yourself.

The pages below contain up-to-date build instructions:

Reporting Issues

To report an issue please:

  • First post to forum to verify the issue;
  • Link forum thread to bug tracker ticket and vice-a-versa;
  • Use the most updated stable or development versions of FreeCAD;
  • Post version info from eg. Help > About FreeCAD > Copy to clipboard;
  • Post a Step-By-Step explanation on how to recreate the issue;
  • Upload an example file to demonstrate problem.

For more detail see:

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. 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.

This project receives generous infrastructure support from and KiCad Services Corp.

Description
No description provided
Readme LGPL-2.1 7.9 GiB
2026-02-27 16:25:02 +00:00
Languages
C++ 51.5%
Python 45.8%
C 1.3%
CMake 0.8%
NSIS 0.2%
Other 0.2%