Commit Graph

3767 Commits

Author SHA1 Message Date
Syres916
4f167b828b [BIM][Draft] QCheckBox fix regressions introduced by PR #21939 (#22199)
* [BIM][Draft] QCheckBox fix regressions introduced by PR #21939

* [BIM] Remove unwanted index values - CodeQL feedback
2025-06-27 11:25:36 +02:00
tetektoza
352fadd5c7 Draft: Remove redundant QGroupBoxes from some of the array panels (#21980)
* Draft: Remove main QGroupBox from Circular Array tool

* Draft: Remove main QGroupBox from Polar Array tool

* Draft: Remove main QGroupBox from Ortho Array tool

* Draft: Remove AxisMode QGroup from Ortho Array tool

* Draft: Remove main QGroup from ShapeString tool
2025-06-26 10:11:26 +02:00
alafr
27c786fef1 Draft : fix Label Justification (#13444)
Draft Label ViewObject.Justification property was overriden by Object.StraightDistance property. The Justification in the 3D view was reset after recompute. This commit fixes the problem by setting Object.StraightDistance automatically when ViewObject.Justification is changed and vice versa. Also fixes the frame position when Justification is Center.
2025-06-24 10:45:46 +02:00
Syres916
cd5d0980b4 [BIM][Draft][CAM] preparation for deprecation of QCheckBox… (#21939)
* [BIM][Draft]{CAM] preparation for deprecation of QCheckBox stateChanged -> checkStateChanged
2025-06-18 11:24:21 +02:00
Chris Hennes
0b1a2e0591 Draft: Eliminate redundant assignment to self (#22006)
* Draft: Eliminate redundant assignment to self

* Removed confusing comment.

---------

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-06-17 09:40:01 +02:00
Furgo
a91bf4ee78 DXF: rename "Group layers into blocks" setting (#21896)
* DXF: rename "Group layers into blocks" setting

* DXF: apply suggested improvement children => contents

* Import: DXF, change tooltip to reflect the reality of the current code

https://github.com/FreeCAD/FreeCAD/pull/21896#issuecomment-2958611607
2025-06-17 09:38:38 +02:00
Roy-043
fca41e4003 Rebase and minor adjustments 2025-06-16 18:25:59 +02:00
Chris Hennes
46888b83b2 Merge pull request #21921 from furgo16/add-prefcheckablegroupbox
Gui, Draft, BIM: Add PrefCheckableGroupBox, use it in IFC exporter preferences page
2025-06-16 11:06:30 -05:00
Roy-043
89cb9877b7 Draft: OrthoArray task panel change some strings to sentence case (#21959)
X Axis -> X axis
Same for Y and Z.
2025-06-12 19:52:52 +02:00
Furgo
b584c506bd Draft: handle reading defaults from PrefCheckableGroupBox 2025-06-11 02:44:52 +02:00
Mino-Tsuzuku
ae3962191a Draft: Fix several SVG import bugs (#20293)
* Fix #19422 SVG: use tag create wrong size object
Fix #19072 SVG: import <defs> keyword as object without <use>
and Fix bug that not reported, <symbol> keyword as object without <use>
and Fix bug that not reported, nested use tag not import correctly.
 To do this. I make preprocessor that replace use tag to it's referenced object.
and remove symbol tag and defs tag from loaded svg.
 there is a subeffect, name of imported object that related to symbol tag is changed.

* Fix  incorrect import when use tag nesting context.

* fix error when use tag not exist.

* rebased aprospero PR20293.
fix several bugs.
1,x and y attribute of use tag is not processed under certain condition.
2,Doesn't finish importing when referenced ID is not exist.
3,Doesn't finish importing when use tag use href instead of xlink:href

* Refactor: Use data.get() for cleaner dictionary key handling

* Refactored code for simplicity following suggested changes.

* Add <a> tag support.( <a>tag  is  almost same with <g> tag at visual effect )

* Correct mistakes in the if condition handling href and xlink:href

* Modify the code to retain the original namespace definitions, as removing all namespaces may cause incorrect importing process.
2025-06-09 23:44:37 +02:00
tetektoza
29ca81b64f Draft: Introduce 1-axis mode for ortho array (#21602)
* Draft: Introduce 1-axis mode for ortho array

As the title says - the 1 axis mode allows to switch between all of the
axises mode and allows to modify only 1 axis at the time that user can
select with the checkbox.

* Draft: Rename to Linear Mode and remove redundant comments

* Draft: Display only one interval for the selected axis

* Draft: Cache selected variables in user.cfg - axis mode, intervals, etc...

* Draft: Make sure the checkboxes in OrthoArray are exclusively selected

* Draft: Apply review comments

Changed a couple of things according to review:
* linear mode is now being used as default during first startup (it
  wasn't before)
* applied Roy's comments about coding style, etc.
* grouped everything into separate QGroupBox which is dedicated for
  Linear Mode and has it's own labels, although spinboxes are shared so
  during mode switch we reparent them now
* removed Orthogonal Array's icon
* in the QGroup applied naming suggested in the review, X Intervals ->
  interval, etc.
* changed to radio buttons since we want exclusivity in selection
2025-06-09 17:33:51 +02:00
Roy-043
c9a434377a Draft: fix focus behavior if Length has default focus and axis constraint is used
Fixes #21774.

The X, Y or Z input should have priority is an axis constraint is used.
2025-06-06 10:21:17 +02:00
Brad Eric Hollister
4dff82f7a3 proposed fix for https://https://github.com/FreeCAD/FreeCAD/issues/20856github.com/FreeCAD/FreeCAD/issues/20856. NOTE: AddonManager and Telemetry addon ui files are in separate repos 2025-06-03 09:37:22 +02:00
Roy-043
e4adfc63d7 Draft/BIM: change BezCurve, BSpline and Wire to Part::FeaturePython
Fixes: #7387.

See comment: https://github.com/FreeCAD/FreeCAD/issues/7387#issuecomment-2915599566

PR to change the base object of BezCurve, BSpline and Wire to `Part::FeaturePython`. This will only affect new objects. So code will have to also keep handling the old object type (`Part::Part2DObjectPython`).

The modification of BimPreflight.py needs to be verified. The steps in the old code lacked logic IMO. But I may have misunderstood.
2025-06-02 17:27:20 +02:00
Yorik van Havre
94144ecd99 Translations: Merged crowdin translations 2025-06-02 11:48:26 +02:00
Yorik van Havre
bba4a7b990 Translations: updated ts files 2025-06-02 11:07:28 +02:00
Roy-043
49a9382812 Draft: DraftGui.py correct handling of last point (#21698)
This PR fixes a V1.1 regression.
The default for the last point should be the origin of the working plane if Global mode is off.

Forum topic:
https://forum.freecad.org/viewtopic.php?t=97452
2025-06-01 18:33:18 +02:00
Roy-043
b3f7639016 Draft: Tweak working plane code (#21672)
* The new align_to_face_and_edge functions would align the Y axis to the edge. This should be the X axis.
* The align_to_point_and_axis functions did not accept a zero length upvec.
* Added a return value to the _next function for compatibilty with its counterpart the _previous function.
2025-06-01 09:13:19 +02:00
tetektoza
8ec6605fc4 BIM: Add support for deactivation active object to BIM Views Tree (#21570)
* BIM: Use checkbox in model tree for Activation/Deactivation of WP

* BIM: Set active object after deactivating current object if it exists

Currently we can get into a scenario where user can activate two working
planes, one after another. For example, Level, and  then Level001. If
they activate both, and then deactivate Level001, working plane switches
back to Level. But, we didn't set the object as the active one, so user
didn't have clear information that they can deactivate it, only the
working plane was switching it.

So this patch sets the object as the active one, if it exists.

* BIM: Add support for deactivation active object to BIM Views Tree

As the title says - it adds the checkbox that's similarly done in Part
workbench, so user can select/deselect the item and if they had previous
active object, it will also fall back to the previous object.

Also, moved out part of the common logic from ArchBuildingPart and
BimViews to utils.

* BIM: Handle correct context on activating WP for NativeIFC/BIM

* BIM: Remove redundant logic from BIM Views upon double click

As all of the logic is being handled now in `activate` function in
BimViews, this logic is redundant

* BIM: Rename button for taskbar and BIM Views from Activate to Active
2025-05-28 11:27:11 +02:00
Yorik van Havre
1f6ecf83b2 Draft: Added snap recenter functionality (#19728)
* Allow to align the working plane on selected edge + face of a same object, which aligns the plane with the face, but positions it on the edge (the WP is positioned on the edge's first vertex, the WP's X axis is aligned with the edge, and the face's center point provides the third point to define the plane)
* Added a "Recenter" in-command shortcut. This moves the WP to be centered on the current snap position (the WorkingPlane snap button is taken into account, so one can only move the WP in the same plane or not).
2025-05-27 19:17:43 +02:00
Roy-043
96af3a5bba Draft: remove 'CTRL to snap' from tooltips (#20619)
The 'CTRL to snap' option is not the default, it should therefore not be included in the tooltips.

Additionally:
* Some obsolete info was removed.
* Some minor improvements,
2025-05-24 18:55:47 +02:00
Roy-043
98d4222253 Draft: Revise close task panels on doc close solution (#21546)
Use built-in feature to close the task panels. See #21253.
2025-05-24 10:25:40 +02:00
longrackslabs
77a11efa0b Draft: Fix typo in arc input hint ("staring" → "starting") 2025-05-24 08:24:32 +02:00
Roy-043
5cb88a63d0 BIM: Revise close panel on doc close solution (#21302)
* BIM: Revise close panel on doc close solution

Use built-in feature to close the task panels. See #21253.

* Keep self.doc
2025-05-23 11:49:55 +02:00
Krzysztof
4590d922ff Draft: Implementation of 'Align to face' checkbox in Hatch task panel (#21332) 2025-05-23 09:42:19 +00:00
Roy-043
e5f81e4791 Draft: ShapeString fix stick font check for small character (#21522)
Fixes #21501.

For some fonts `Part.makeWireString()` returns characters that are much smaller than the given height. This would lead to a false positive for the 'sticky font' check (which checks the area of the "L" character).
2025-05-22 17:26:00 +02:00
Roy-043
ec88f39f6d Draft: Tweak polygonTracker code (#21518)
Minor improvement for the `setOrigin` and `update` functions of the class.
2025-05-22 11:35:25 +02:00
Kacper Donat
239173bcf2 Draft: Add example tool hints 2025-05-21 17:42:45 +02:00
Roy-043
a7f0feddc0 Draft: avoid redundant constraints in make_sketch.py (improved)
See #21398 and #21396.
2025-05-21 11:56:11 +02:00
Benjamin Nauck
02e1bbe1ae Merge pull request #21042 from furgo16/add-taskpanel-walloffset
BIM: add Offset input to wall creation task panel
2025-05-19 17:45:46 +02:00
Roy-043
61e349ef54 Draft: use different color for WPProxy to avoid BIM dependency
Fixes #21390.
2025-05-17 14:30:48 +02:00
Roy-043
9d79d1aab9 Draft: avoid redundant constraints in make_sketch.py (#21398)
Forum topic:
https://forum.freecad.org/viewtopic.php?t=97072

The MissingVerticalHorizontal functions from the Sketcher WB do not behave as expected. See #21396.

A check for redundant contraints is required if   `makeMissingVerticalHorizontal()` is used. The argument for the function should be `True`. For consistency the same was done for makeMissingPointOnPointCoincident().
2025-05-16 19:12:32 +02:00
Roy-043
5a7b73e560 Draft: params.py: do not report missing UI files (#21370)
See #21331.
2025-05-16 15:27:33 +02:00
Chris Hennes
f2e78e53e9 UI: Remove qPixmapFromMimeSource pixmap function
This function dates back to Qt3, and was removed in Qt4. Modern Qt no
longer uses this ui file entry, and in some circumstances the uic
complains about its presence.
2025-05-15 00:56:30 +02:00
tetektoza
7d57569eb4 Draft: Finish command if user deselected Chained Mode
As the title says - currently, if user deselects Chained Mode, they
can't exit it without using ESC key for example, as the old behavior
of ContinueMode is kept under it.

So, this patch finishes the command if user has deselected it, at
the same time finishing previous chain.
2025-05-13 11:39:01 +02:00
Furgo
576b5ffb41 Draft: add more context to select plane command message 2025-05-12 21:27:30 +02:00
Roy-043
b451193a49 Draft: aux.fake_function should not overwrite functions
The `aux.fake_function` is used in the Draft unit tests as a substitute for functions that, in most cases, do not yet exist. But in test_modification.py it would overwrite Draft.extrude leading to issues with BIM unit tests.

See:
https://github.com/FreeCAD/FreeCAD/pull/21134#issuecomment-2869178563
2025-05-12 10:45:45 -05:00
Furgo
87768e4c79 Merge branch 'main' into add-taskpanel-walloffset 2025-05-12 05:08:04 +02:00
tetektoza
ff1602ef6b Draft: Introduce new dynamic polygon tracker for Polygon tool (#21045)
As the title says - currently we just have a simple circle, so I thought
with some basic adjustments it's possible to add a cool tracker that
will possibly guide user better on what they are placing on the
viewport.
2025-05-08 14:30:31 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Roy-043
2e02c6a944 Draft: ShapeString: use an actual font file as default, allow TTC files
* To help novice users supply an actual font file from the OS as the default for ShapeStringFontFile.
* The Draft code blocked the use of TTC font files. `Part.makeWireString()` can however handle them (although only the first font in the file can be used).

Additonally:
In a previous PR the bottom spacer was removed from the task panel. This PR brings it back as it is required in some cases. Without it  the "..." button of the file selector can become huge.
2025-05-05 18:15:47 +02:00
Roy-043
ffd99499fb Draft: fix dim unit override for Building US unit system
Fixes #21092.
2025-05-05 18:01:36 +02:00
tetektoza
7f6b3dcf70 Draft: Preserve direction vector upon Continue Mode for Dimension (#20974)
So, currently, if we use Vertical/Horizontal Dimension which is
constrained in one direction vector, upon `Continue`, the direction
vector is not being preserved.

The cause of that is that everytime we recall the command in Continue
Mode, we also call base class' `Activated` method, which in turn calls
`finish()` if we have already initialized an active Draft command. This
doesn't happen during first usage of the command, because this variable
is not yet populated, but upon second (and next) runs it is. In turn,
this causes to call `finish()`, and clean up the direction vector. So,
in essence, we are specifying the vector and cleaning it every
"Continue" run.

So, as a solution, just move the direction vector as an argument to
populate super class with it, and do that after super class' `Activated()`
call, so it won't get cleaned up in `finish()`.

Co-authored-by: Yorik van Havre <yorik@uncreated.net>
2025-05-05 17:58:54 +02:00
Roy-043
57da6ac140 BIM: close task panels on doc close
Fixes #17952.

This PR is a continuation of #20719.

It mainly involves adding `self.doc`. This new attribute is then also used in the rest of the modified classes. In some cases code was slightly reordered for consistency.

The `_finish_command_on_doc_close` function has been modifief to also handle `Gui.Snapper.ui.escape` and the code in gui_arcs.py has been updated accordingly.

Additionally:
Removed the `done` and `spacedone` variables in BimWall.py by tweaking the code.
2025-05-05 17:52:37 +02:00
Furgo
288a04deba BIM: add Offset input to wall creation task panel 2025-05-05 12:31:03 +02:00
Roy-043
56d75c2c06 Draft: store 3 ShapeString parameters and remove font from prefs (#21054)
* Draft: store 3 ShapeString parameters and remove font from prefs

With this PR 3 ShapeString parameters are stored:
* ShapeStringFontFile: this replaces the old FontFile parameter.
* ShapeStringHeight
* ShapeStringText

The ShapeStringFontFile is just the last selected font file and not exposed in the Preferences editor.

Additionally:
* Changed the label of the text input box from "String" to "Text".
* Changed the label of the point reset button to sentence case.

* Remove faulty docstring
2025-04-29 07:13:17 -05:00
Roy-043
ea6a30efba Draft: Add Global mode to ShapeString task panel
This PR adds the Global mode option to the ShapeString task panel.

Additionally:
* Rounding of coordinates caused by reading values from the task panel is avoided.
* Improved task panel layout: Height input above String input.
* Some code reformatting.
2025-04-28 17:57:41 +02:00
Luz Paz
4619ab1bff Misc: Fix various typos
Found via codespell
2025-04-27 19:32:19 -05:00
aprospero
5f8eac49f3 importSVG - Path generation Overhaul (#20749)
* add precision Parameter for importSVG to preferences

* rewrite svgpath import

reorganize the existing svg interpretation code snippets by dividing the responsibilities for data provision and actual shape generation.
That bears the opportunity to optimize the resulting construction data regarding consistency and precision.

* create cuts from inner paths

organize paths in a tree structure where completely contained paths are children of their sorrounding paths

In a second step the even depth paths are cut with their respective (uneven depth) children.

* move svg path import logic into its own module

* Restructure how the import result is controlled by preferences.

* reintroduce alternative transform function

Using transformGeometry() on shapes results in degenerations like lines mutating to bsplines of 1st order. For non-orthogonal Transformations this can't be avoided. But for orthogonal transformations (the majority) we can apply those transformations without degeneration.

The necessary function including fallback to transformGeometry() is already in the code but was disabled due to a regression.

See: https://tracker.freecad.org/view.php?id=2062

Associated commits: f045df1e 2509e59b d4f3cb72

I reactivate the code since the degeneration of paths seems a bigger issue to me than misformed svg files producing incorrect measurements. Degenrated paths are often the culprit for later arising 3D-calculation errors.

* avoid path degeneration by keeping scale transformations uniform

* repair style application on shapes

the style should be based on the configured svgstyle mode in the svgimport preferences.

* improve logging of face generation.

* refactor: rename _precision_step to _tolerance

naming according to example set in draft utils.

* fix: indentation

* spelling
2025-04-25 16:44:03 +02:00