Commit Graph

3791 Commits

Author SHA1 Message Date
Furgo
75d6cee905 Import: DXF, fix CodeQL errors 2025-07-14 10:18:04 +02:00
Furgo
f18b33565d Import: DXF, make straight polylines Draft-editable 2025-07-14 10:18:04 +02:00
Furgo
8ab525ddb9 Import: DXF, correctly transfer Draft.Line points to make them editable 2025-07-14 10:18:04 +02:00
Furgo
9b33975697 Import: DXF, add suggestions and improve UI copy. 2025-07-14 10:18:04 +02:00
Furgo
d1e131863b Import: DXF, first working version of dimensions import 2025-07-14 10:18:04 +02:00
Furgo
9f9104e182 Import: DXF, make ellipses parametric 2025-07-14 10:18:04 +02:00
Furgo
a295f9dd5c Import: DXF, first working version of Draft objects import 2025-07-14 10:18:04 +02:00
Furgo
5951d759f8 Import: DXF, first working version for import as Part primitives 2025-07-14 10:18:04 +02:00
Furgo
293ebf801c Import: DXF, add dedicated import dialog 2025-07-14 10:18:04 +02:00
Furgo
37cd1a657a Import: DXF importer, refactor preferences UI 2025-07-14 10:18:04 +02:00
Furgo
ef9378bd5b Import: improve DXF C++ importer support for BLOCK and INSERT entities (#22045)
* Import: DXF importer, block and inserts overhaul

Implement support for blocks as definitions and inserts
as instances.

A BLOCK definition becomes a hidden master object in a
_BlockDefinitions group (currently a Part::Compound).
An INSERT becomes a visible App::Link that points to
that master definition.

* Import: DXF parser/importer add debug print statements

* Import: DXF importer, various improvements

- Add more code comments
- Correctly increase object count
- Improve readability of anonymous block checks

* Import: DXF (all) report anonymous blocks separately

* Import: DXF importer (App + GUI) add nested inserts support

* Import: DXF importer (GUI) fix preserving colors for inserts

* Import: DXF importer, make primitives naming more specific

* Import: DXF parser/importer remove debug print statements

* Import: DXF parser, work around DXF color index 7

* Import: DXF importer GUI, temporary debug print to show layer color data

* Import: DXF importer, fix nested inserts hierarchy

* Import: DXF importer, prefix and suffix underscores to names

To work around mangling from FreeCAD's unique name generator.

* Import: DXF importer, implement flattening blocks on import

* Revert "Import: DXF importer GUI, temporary debug print to show layer color data"

This reverts commit b6ece395c9d2b8a1e0796d6f7b0d58842a2f3686.

* Import: DXF importer, fix imported text orientation

The DXF file provides the text rotation angle in degrees.
The used rotZ function expects the angle in radians,
thus the conversion needs to be made.

Fixes: #21548

* Import: DXF importer, honour the preference to not import layouts

* Import: DXF importer, move unreferenced blocks to separate group

This provides better classification, but it has a performance hit:
we import all blocks as before, we sort them and we reparent them
to the correct group. The reparentipart with Grou.setValues()
appears to be an expensive call. Probably because internally the
FreeCAD dependency graph is modified.

* Import: DXF importer, count compound children in the report

* Import: DXF importer, cleanup defined blocks group if empty
2025-07-12 13:38:13 +02:00
Roy-043
a30197fd6c Draft: 1st downgrade of lofts and sweep should be de-parametrization 2025-07-12 13:29:32 +02:00
Roy-043
0ccfaf2d8a Draft: gui_utils.py minor improvement for autogroup 2025-07-07 17:03:21 +02:00
Roy-043
3e39a01312 Draft: make_sketch.py should not use view direction (#22249) 2025-07-07 17:02:14 +02:00
Roy-043
12f4d1da2e BIM: fix profile selection (#22223)
* Update params.py

* Update ArchStructure.py

* Update BimProfile.py
2025-07-07 14:39:55 +02:00
Roy-043
22c92d550c Update DraftGui.py 2025-07-05 22:44:22 +02:00
Roy-043
8add557e2f Draft: fix setting of self.Type
Fixes #17750.

`self.Type` should be set in `__init__` and `loads`, and not in `onDocumentRestored`.
2025-06-30 11:05:25 -05:00
Chris Hennes
faa56d4e3f Merge pull request #21985 from furgo16/dxf-stats-reporter
Import: add DXF statistics reporter
2025-06-30 10:55:57 -05:00
Syres916
b0c63c5537 [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
a5eff61993 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
Furgo
0056f4d9a9 Import: DXF reporter, add unsupported indicator 2025-06-25 07:41:03 +02:00
Furgo
9ac905b140 Import: DXF reporter, add filename to report 2025-06-25 07:41:03 +02:00
Furgo
318f205708 Import: DXF backend/frontend, report more unsupported features info
Now for unsupported features we report on line numbers and on the entity
handle, in case that unsupported feature is a DXF entity. To avoid
flooding the output, only a maximum of 5 instances are reported with
details. The rest simply add up to the global count and are ellipsized
in the report.

Report output is now in sentence case.
2025-06-25 07:41:03 +02:00
Furgo
f84ed59a43 Import: DXF backend, frontent; add time measurement 2025-06-25 07:41:03 +02:00
Furgo
77e4047871 Import: DXF frontend, improve scale reporting 2025-06-25 07:41:03 +02:00
Furgo
d17db2ded1 Import: DXF Python frontend, implement stats reporter 2025-06-25 07:41:03 +02:00
alafr
8329a181c9 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
8844319d33 [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
21b607a110 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
38499d4470 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
e6408f41af Rebase and minor adjustments 2025-06-16 18:25:59 +02:00
Chris Hennes
a5cc926bf5 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
b1358b7f55 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
cf5cf2babf Draft: handle reading defaults from PrefCheckableGroupBox 2025-06-11 02:44:52 +02:00
Mino-Tsuzuku
e70fde5773 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
46b7c6c385 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
62864d9ec0 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
722bda1935 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
66cf7b4c36 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
640642eed2 Translations: Merged crowdin translations 2025-06-02 11:48:26 +02:00
Yorik van Havre
26e16765b0 Translations: updated ts files 2025-06-02 11:07:28 +02:00
Roy-043
bbe43aa6db 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
2fc0c9a12c 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
e6ec691ac1 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
40d385859a 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
66e7940dfd 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
7740eca0c0 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
0ef4ee0367 Draft: Fix typo in arc input hint ("staring" → "starting") 2025-05-24 08:24:32 +02:00
Roy-043
9a505c36c4 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
a804002f36 Draft: Implementation of 'Align to face' checkbox in Hatch task panel (#21332) 2025-05-23 09:42:19 +00:00