Commit Graph

3912 Commits

Author SHA1 Message Date
Roy-043
a8757f7947 Draft: fix depency of patharray normal on view direction
Change normal calculation to use get_shape_normal
2026-02-13 11:47:44 -06:00
Roy-043
7912f84136 BIM+Draft: fix Placement task panel issue for Arch_SectionPlane and Draft_WorkingPlaneProxy (#27101)
* BIM+Draft: fix Placement Task Panel issue for Arch_SectionPlane and Draft_WorkingPlaneProxy

* BIM+Draft: fix Placement Task Panel issue for Arch_SectionPlane and Draft_WorkingPlaneProxy
2026-02-12 12:39:46 +00:00
Yash Suthar
3d14203fa4 Draft: fix Draft_Label MaxChars property (#27478)
* Draft: fix Draft_Label MaxChars property

Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>

* Minor tweak: moved/replaced call to self.onChanged

---------

Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2026-02-11 17:58:42 +00:00
Roy-043
54c0c2f83c Draft: fix ghost preview of Draft_Labels
Draft_Labels have a unique Placement implementation. A ghost preview therefore cannot be generated in the standard manner. This was missed in #18795 (my bad).
2026-02-10 11:43:22 -06:00
Caio Venâncio do Rosário
bf51a00dfd Draft: Fix switchUi method bug (#27422)
* Draft: Fix switchUi method bug

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-02-10 10:33:35 +01:00
freecad-gh-actions-translation-bot
e5d0e5316d Update translations from Crowdin 2026-02-09 05:39:43 +01:00
Roy-043
f9ab227459 Draft: title in default task panel in title case
See #27314.
2026-02-03 12:09:08 +01:00
Yash Suthar
8f2a3a4d7d Draft : Added knots support for snapping (#26571)
* Draft : Added knots support for snapping

Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>

* Use Special snap for knots and rename snapToBSpline to snapToBSplineKnots

---------

Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2026-02-02 17:11:20 +00:00
freecad-gh-actions-translation-bot
0b7da82433 Update translations from Crowdin 2026-02-02 11:49:57 +01:00
Roy-043
0f2bdf280f Draft: fix autogroup behavior if active group is a layer (#27102) 2026-01-29 15:38:55 +01:00
freecad-gh-actions-translation-bot
d574623a2e Update translations from Crowdin 2026-01-26 10:11:06 +01:00
Roy-043
fbf5cb7e11 Draft: fix snapping to geometry on image
Fixes #26965

`self.snapObjectIndex` should be increased if the object under the cursor is not 'snappable'. This is the same principle as is used in the `cycleSnapObject` function.
2026-01-20 20:54:34 +01:00
Roy-043
23ce17f4d0 Draft: fix DiscretizeEllipses preference inconsistency (#26953) 2026-01-19 10:51:19 -06:00
Roy-043
c858e09ca5 BIM: fix placement issue in BIM_View (#27015)
* BIM: fix placement issue in BIM_View

* BIM: fix placement issue in BIM_View
2026-01-19 16:30:04 +00:00
freecad-gh-actions-translation-bot
10a540b1bf Update translations from Crowdin 2026-01-19 08:10:24 +01:00
Roy-043
e4eebe50d0 Add AutoColor handling for sketches in gui_setstyle.py (#25781) 2026-01-14 15:53:31 +01:00
Furgo
6812de49a3 BIM: implement baseless walls creation (#24595)
* BIM: Implement smart base removal for Walls

Previously, removing the Base object from an Arch Wall would cause the
wall to reset its position to the document origin and could lead to
unintended geometric changes for complex walls.

This commit introduces a "smart debasing" mechanism integrated into the
Component Task Panel's "Remove" button:

- For walls based on a single straight line, the operation now preserves
  the wall's global position and parametric `Length`, making it an
  independent object.
- For walls with complex bases (multi-segment, curved), a warning dialog
  is now presented to the user, explaining the consequences (shape
  alteration and position reset) before allowing the operation to
  proceed.

This is supported by new API functions `Arch.is_debasable()` and
`Arch.debaseWall()`, which contain the core logic for the feature.

Fixes: https://github.com/FreeCAD/FreeCAD/issues/24453

* BIM: Move wall debasing logic into ArchWall proxy

The logic for handling the removal of a wall's base object was previously
implemented directly within the generic `ComponentTaskPanel` in
`ArchComponent.py`. This created a tight coupling, forcing the generic
component UI to have specific knowledge about the `ArchWall` type.

This commit refactors the implementation to follow a more object-oriented
and polymorphic design:

1.  A new overridable method, `handleComponentRemoval(subobject)`, has been
    added to the base `ArchComponent` proxy class. Its default implementation
    maintains the standard removal behavior.

2.  The `_Wall` proxy class in `ArchWall.py` now overrides this method. All
    wall-specific debasing logic, including the eligibility check and the
    user-facing warning dialog, now resides entirely within this override.

3.  The `ComponentTaskPanel.removeElement` method has been simplified. It is
    now a generic dispatcher that calls `handleComponentRemoval` on the
    proxy of the object being edited, with no specific knowledge of object types.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* BIM: Add interactive creation of baseless walls

Introduce a new workflow for creating Arch Walls without a dependency on
a baseline object (e.g., a Draft Line).

- The `Arch_Wall` command is enhanced with a "No baseline" mode, controlled
  by a new "Walls baseline" preference, allowing users to create
  placement-driven walls directly in the 3D view.
- The existing `debaseWall` function has been refactored for correctness
  and consistency with the new baseless wall geometry.

Co-authored-by: Yorik van Havre <yorik@uncreated.net>

* BIM: Refactor structure of the Arch Wall command

Refactor the `Arch_Wall` GUI command (`BimWall.py`) for improved
readability, maintainability, and architectural clarity.

- A `WallBaselineMode` Enum is introduced to replace the original
  integer values, making the code self-documenting.
- The monolithic `create_wall` method is broken down into smaller,
  single-responsibility helper functions for each creation mode.
- The `addDefault` method has been removed, with its logic
  integrated into the new structure.

* BIM: Add Draft Stretch support for baseless walls

This commit makes the new baseless Arch Walls graphically editable using
the `Draft_Stretch` tool.

- An API for stretching (`calc_endpoints` and `set_from_endpoints`)
  has been added to the `ArchWall` proxy.
- The `Draft_Stretch` tool is now aware of baseless walls and calls this
  new proxy API to perform the stretch operation, enabling users to
  stretch them.

Co-authored-by: Yorik van Havre <yorik@uncreated.net>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* BIM: address CodeQL warnings

* BIM: Fix wall alignment for GUI creation of baseless walls

Fixes an issue whereby creating a baseless wall from the GUI would
ignore the selected `Align` property, always resulting in a
center-aligned wall.

- The underlying geometry generation for baseless walls now correctly
  honors the `Align` property passed by the GUI and API.
- To ensure predictable behavior, the implementation uses the same
  geometric convention as walls built from a base object, making the
  `Align` property work uniformly for all wall types.
- This also corrects the behavior of the `Arch.makeWall` function for
  baseless walls.
- Update unit tests to test wall alignment.

* BIM: Refactor wall geometry generation for improved clarity and maintainability

Improves the internal logic for wall geometry creation, addressing CodeQL warnings and enhancing overall maintainability without changing external behavior.

- The `build_base_from_scratch` method is refactored to unify the separate logic paths for single- and multi-layer walls, reducing code duplication.
- A local helper function is introduced to create face geometry, for better modularity and readability.
- In the `_Wall.execute` method, the control flow that relied on implicit type checking is replaced with an explicit strategy pattern for fusing solids, making the logic more robust.
- Variable names are made more descriptive.
- A NumPy-style docstring is added to better document the function.

* Draft: fix stretching of rotated baseless walls

* BIM: add unit test for stretching baseless walls

* BIM: add regression tests for working-plane-relative coordinates and reuse of base sketches

* BIM: Fix baseless wall creation to respect the working plane

Corrects an issue where baseless walls were created using global
coordinates instead of being relative to the active Draft working plane.

The calculated local placement of the wall is now correctly transformed
into the global coordinate system by multiplying it with the working
plane's placement.

* BIM: Ensure unique baselines for subsequent wall creation

Fixes a bug where creating multiple walls with baselines would
incorrectly reuse the same underlying Sketch or Draft Line object.

The object retrieval logic after the `doCommand` call now correctly uses
`ActiveObject` to get a reliable reference to the new object instead of
relying on a hardcoded name.

* BIM: Make the wall's base object label translatable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* BIM: use singular for consistency with other labels

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Fix typo

* BIM: address reviewer's comments about improving object reference passing between Python and FreeCAD contexts, and functions

* BIM: remove defensive programming: the callback is only executed as a result of a user's GUI action

* BIM: use the params API to define WallBaseline parameter

* BIM: add Arch Wall tests for joining wall logic

* BIM: add joining logic

* BIM: re-add ArchSketch support

* BIM: re-add multimaterial support on wall creation

* BIM: address CodeQL warning, remove module duplication

* BIM: fix check for SketchArch module when creating sketch-based walls

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Yorik van Havre <yorik@uncreated.net>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2026-01-13 09:30:37 +01:00
Roy-043
2019ff051e Draft: fix constrain error if there is no new point (#26868)
* Add None check before constraining new_point

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-12 16:12:13 +01:00
freecad-gh-actions-translation-bot
7ddee25ec9 Update translations from Crowdin 2026-01-11 19:42:50 -06:00
Stanislav
a5f66f7240 Draft Workbench: Patch for import DXF without CODE30 (Z for POINT) (#26778)
* Patch for DXF without CODE30 (Z for POINT)

Time to time I use DXF file from measurement microscope without Z for POINT.
This patch help me for download this files without errors.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-09 11:00:36 +01:00
freecad-gh-actions-translation-bot
2592406b35 Update translations from Crowdin 2026-01-05 08:47:20 +01:00
Roy-043
34441b8101 Draft: fix regression in Pattern display (Refactor texture handling in view_base.py) 2026-01-01 14:04:27 +01:00
Roy-043
21e7fa1e8b Draft: fix regression in Pattern display (add find_coin_node_by_name function)
Adapted existing code attribution and added a new function to find a node by name.
2026-01-01 14:01:34 +01:00
freecad-gh-actions-translation-bot
7fe10f7436 Update translations from Crowdin 2025-12-29 11:31:39 +01:00
horseDeveloper
4892154faf Fixing Leftover references from migration from freecadweb.org (#26163) 2025-12-26 11:11:12 -06:00
Roy-043
4fe0dff1bc Draft: array task panels: add workaround for Building US unit system
Fixes #26276.
2025-12-23 22:01:11 -06:00
freecad-gh-actions-translation-bot
8b7ec488f0 Update translations from Crowdin 2025-12-22 12:40:21 +01:00
Louis Gombert
cead907a57 SVG export: improve performance (#26149)
* SVG export: use a set to match edges instead of a list

Lookup in edge list becomes O(1), significantly improving SVG export speed

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-12-20 22:23:55 +01:00
freecad-gh-actions-translation-bot
6c6cff7322 Update translations from Crowdin 2025-12-17 21:10:10 -06:00
Roy-043
e6e285315c Draft: make Draft_AnnotationStyleEditor dialog wider
Increase AnnotationStyleEditorWidth from 450 to 600 to mitigate #25983.
2025-12-15 11:16:28 -06:00
Roy-043
4b379c8e51 Draft: fix lag when snapping to face intersections
Fixes #25924.

The `snapToIntersection` function has been changed to an if-elif structure, and in case of face-edge intersection snap, only two sublements are checked. This ensures a reasonable speed, even if objects have many edges and faces. The change does mean you have to move the mouse over the correct face for it to be processed. But since face-edge intersection snap is new anyway, this is acceptable I think.
2025-12-11 17:32:44 +01:00
Roy-043
e1d77cc771 Remove maxSnapFaces parameter from params.py
Removed 'maxSnapFaces' parameter from settings.
2025-12-11 17:22:30 +01:00
PaddleStroke
7a8135d863 Core: Add getPlacementOf replacing previous getGlobalPlacement logic. (#26059)
* Core: Add getPlacementOf replacing previous getGlobalPlacement logic.

* Update src/App/DocumentObject.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update DocumentObject.cpp

* Fix error when called from python with targetObj == None

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-12-10 22:47:20 +01:00
freecad-gh-actions-translation-bot
f7483a08b4 Update translations from Crowdin 2025-12-08 22:31:48 -06:00
Roy-043
4eb110e861 Draft: fix X-axis reference for Draft_Arc_3Points 2025-12-01 17:01:31 +00:00
Roy-043
41c0621abb BIM: add parameter for BIM_Sketch view props (#25778)
* Add BIM parameters to param_dict

Add BIM parameters to param_dict for future use.

* BIM: add parameter for BIMSketch view props
2025-12-01 16:58:43 +00:00
github-actions
68cb0a3270 Update translations from Crowdin 2025-11-25 21:20:42 -06:00
Roy-043
98240a6de5 Draft: fix number_length for imperial dimensions (#25369)
* The number_length function did not take imperial dimensions into account. For `9" + 7/8"` it would return 1.
* In ArchRoof reference number_length function from DraftGui.py to avoid duplicate code.
2025-11-23 22:30:09 -06:00
luzpaz
10709bd467 Fix typos and grammar (#24827)
* Fix typos and grammar
Fixes typos and grammar in several files.

* fix missed typo

* Remove unnecessary line in LeadInOut.py

---------

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-11-13 19:53:35 +00:00
github-actions
8432fab0a9 Update translations from Crowdin 2025-11-11 23:44:18 -06:00
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Roy-043
ce0a3dd526 BIM: Fix human figure
Fixes #25084.

Instead of a brep file a point list is now used to generate the figure.

Additionally:
Two points have been added to make the head of the figure less 'pointy'.

It would make sense to move the `get_human_figure` function to a different file in the future.

With 1.7m the figure is not very tall BTW.
2025-11-09 16:49:37 +01:00
Chris Hennes
af41a9dcef Merge pull request #24317 from kpemartin/Issue24314
Update unit test to use new storage for DXF import settings
2025-11-05 14:25:58 -06:00
Kevin Martin
5afe1e64f8 Transplant the test code from the old location
For some reason the app hangs after the test GUI is run
2025-11-05 08:28:34 -05:00
Kevin Martin
2d5bb51734 Add the sample input file 2025-11-05 08:28:34 -05:00
Kevin Martin
44bb16cae7 Enable Python Draft import tests
A failing test was added to Draft tests to ensure CI catches it
2025-11-05 08:28:17 -05:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
f0e70e68e0 [ Draft ]: Update SPDX License Identifiers (#24965) 2025-11-03 11:58:14 -06:00
Roy-043
08cf89d1c9 Fix path for ContinueMode parameter retrieval 2025-11-02 15:50:26 -06:00
tetektoza
9b2e4b4975 Draft: Do not set Make Face property when importing with DXF (#24857)
* Draft: Do not set Make Face property when importing with DXF

As the title says - this option was taken from last Draft setting, so
this disables it to always preserve only wire during import, instead of
adding faces on.

* Draft: Do not make faces when importing dxf primitives for legacy import
2025-11-01 13:26:13 +01:00
github-actions
11fecb1558 Update translations from Crowdin 2025-10-27 21:06:54 -05:00