Commit Graph

168 Commits

Author SHA1 Message Date
Chris Hennes
b898703841 Merge pull request #23310 from Roy-043/Draft-more-logical-placement-for-3-point-arcs
Draft: more logical placement for 3 point arcs
2025-08-31 18:44:02 -05:00
tetektoza
e5518f9ad1 Draft: Call autogroup in make_hatch to put hatch in active group if any (#23464)
As the title says - this patch adds autogroup to hatch, so when created
it will be put in active group.
2025-08-30 22:24:33 +02:00
Roy-043
6e5a1cd31c Remove gui_utils import from make_arc_3points.py 2025-08-26 12:34:42 +02:00
Roy-043
28cae33d0c Bring back placement argument type check 2025-08-24 13:06:32 +02:00
Roy-043
9807bd6e02 Do not import the Draft module 2025-08-24 13:04:39 +02:00
Roy-043
5a854ed3d3 Draft: more logical placement for 3 point arcs
The placement of 3 point arcs very often was unexpected and typically did not match the placement of circles created on the same working plane.

This PR updates the code to use the placement of the working plane to adjust the placement of the created arc.

Additonally:
* Avoided code duplication by just passing the edge from make_arc_3points to make_circle.
* Removed inconsistent map_mode argument from make_arc_3points and the cryptic code related to it. The handling of the support property is something that has to be reviewed for all Draft commands at some point though.
2025-08-23 12:34:06 +02:00
Vincenzo Calligaro
b3e11ecd11 [Feature Request] [Draft] [UI/UX] Allow to turn dimension arrows on/off individually (#11941)
* Update additional files

* The LineColor and LineWidth properties are removed from Text objects.
* Arrow properties are added by the ViewProviderDraftAnnotation class only. This avoids code duplication.

* gui_annotationstyleeditor.py fix except

* view_draft_annotation.py fix except

---------

Co-authored-by: Roy-043 <info@b-k-g.nl>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-08-14 10:44:49 +02:00
Max Wilfinger
a9cd5a4982 Draft: Update UI strings for consistency (#22331)
* Draft: Update UI strings for consistency

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

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

* Apply suggestions from code review

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* Apply suggestions from code review

---------

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-08-06 23:02:16 +02:00
Roy-043
59088a0365 Draft: make_sketch.py should not use view direction (#22249) 2025-07-07 17:02:14 +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
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
Krzysztof
4590d922ff Draft: Implementation of 'Align to face' checkbox in Hatch task panel (#21332) 2025-05-23 09:42:19 +00: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
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
f5d98e6e5d Draft: fix Dim Auto Flip Tex angle checks
When checking angles Dim Auto Flip Text did not consider that angles can be almost -180 degrees and should then be treated the same as 180 degree angles.
2025-03-30 14:01:10 +02:00
Roy-043
5f7f9cb7ba Draft: Implement Dim Auto Flip Text
Fixes #19993.

* To determine the `FlipText` value the normal (either the working plane Z axis or its reverse) and the working plane X axis are used.
* A new fine-tuning parameter `DimAutoFlipText` can be used to disable the functionality. Its default value is `True`.
* The `FlipText` property did not work for angular dimensions and the `TextSpacing` property of angular dimensions was not multiplied by `ScaleMultiplier`. This has been corrected.
2025-03-08 15:30:31 +01:00
Roy-043
29c03a43a3 Draft: fix make_sketch hang
Fixes #19978

The onebyone argument of makeMissingPointOnPointCoincident and makeMissingVerticalHorizontal should be set to False.
2025-03-04 10:12:44 +01:00
Roy-043
3b258b6178 Draft: fix axis calculation in make_sketch
Fixes #18713.

The code follows the suggestion by imm/webmite:
https://forum.freecad.org/viewtopic.php?p=799014#p799014

@webmite Thank you.
2025-01-09 09:40:33 +01:00
Roy-043
b359a2c46c Draft: make_sketch.py: Use sketcher methods to add constraints (#18805)
* Draft: make_sketch.py: Use sketcher methods to add constraints

A sketch object has its own methods to add coincident, horizontal and vertical constraints. Using those methods allows to simplify the make_sketch.py code. The new code applies the mentioned constraints to the whole sketch,  instead of per object. The old code would not add coincident constraints between seperate, but connected, objects. the new code does.

Note that the code for point objects (not changed in this PR) does not work properly.

* Fix 2 issues

* The Sketcher detect functions need a tolerance argument.
* obj.Shape.copy() does not work properly for a Draft_Point. As a workaround a Part Vertex is created instead.
2025-01-06 14:56:53 +01:00
Roy-043
270d48b42b Draft: Fix make_point color regression
PR #12226 accidentally removed the handling of the color argument of the make_point function.
2024-12-05 08:36:34 +01:00
Roy-043
0cd5768fbd Draft: Draft_Fillet: fix error in #17945 (#18150)
* Draft: Draft_Fillet: fix error in #17945

In #17945 the delete option of the command results in an error if subobjects are selected.

* Command should not be available if there is no selection

* Update copyright notice
2024-11-29 20:37:48 +01:00
Yorik van Havre
ee2f384b2f Draft: Independence from BIM (#17444)
* Draft: Independence from BIM - follow-up of #17390

* Draft: More info in DXF importer if BIM not present
2024-11-16 17:48:28 +01:00
luzpaz
a71f49f4f6 Fix trailing newlines and minor typo fixes 2024-07-23 16:16:30 +02:00
Roy-043
1ba341194e Draft: Fix 2 issues to make Draft_Fillet handle arcs properly
Fixes #11435

Draft_Fillet could already handle arcs, provided they were not Draft_Arcs. The `_extract_edge` function in make_fillet.py had a strange logic, and could also return a wire which would result in problems later.

Another issue was that the `fillet` function in fillets.py did not handle the order of the edges correctly if one of the edges was an arc and the other a straight edge. The arch had to be selected first to prevent this error.
2024-06-20 14:00:42 +02:00
Roy-043
ec44573bdc Draft: minor refactor of layer code (#13948) 2024-05-12 09:49:04 +02:00
Chris Hennes
cbb10b0496 Draft: Remove trailing spaces from translations 2024-03-12 22:42:20 -05:00
Josh Coalson
a8ae56e06a Part: Rename AttachExtension::Support property to AttachmentSupport, to avoid name conflict with base features. Fixes #7052 2024-03-04 18:22:43 +01:00
Roy-043
faa9ad4c16 Draft: remove reapply_diffuse_color workaround step 2
Stuff that was missed in #11946
2024-02-15 22:28:37 +01:00
Roy-043
c5d0fbd707 Merge pull request #12250 from Roy-043/Draft-Fix-messages-that-only-worked-for-objects-supplied-as-strings
Draft: Fix messages that only worked for objects supplied as strings
2024-02-04 11:51:29 +01:00
Roy-043
7ca885eb25 Removed too much in make_label.py 2024-02-04 09:50:45 +01:00
Roy-043
e6c68aab31 Draft: Fix messages for Draft_Fillet
There were still too many messages.
2024-02-03 19:46:20 +01:00
Roy-043
178070af5d Draft: Fix messages that only worked for objects supplied as strings
Some error messages would only work if objects were supplied as strings. These would fail if objects were passed (as objects) that had already been deleted.
2024-02-03 19:38:49 +01:00
Roy-043
90c90f705b Merge pull request #12234 from Roy-043/Draft-Draft_Arc_3Points-minor-consistency-update
Draft: Draft_Arc_3Points minor consistency update
2024-02-02 18:07:37 +01:00
Roy-043
ee3e1cd5ce Merge pull request #12230 from kpemartin/Issue11876
Remove excessive output from Draft object creation and editing
2024-02-02 18:06:02 +01:00
Kevin Martin
02ebb17558 Eliminate many "doing what you told me to" messages
These messages were perhaps originally intended as a debuggin aid but now add clutter to the output panes. Remaining messges are mostly the result of methods to display attributes of an object (which one could call from the Python console) or actually provide some information which would not be obvious from the circumstances
2024-02-02 08:58:45 -05:00
Roy-043
253c343d73 Draft: Draft_Arc_3Points minor consistency update 2024-02-02 14:11:55 +01:00
Roy-043
86195fb8b3 Draft: Draft_Fillet minor consistency update 2024-02-02 11:29:43 +01:00
Roy-043
0eb8f1f750 Draft: Avoid draftToolBar.getDefaultColor outside DraftGui.py
The draftToolBar.getDefaultColor() function is an indirect way of retreiving a parameter. It is better to avoid it where possible.
2024-02-01 18:02:10 +01:00
Roy-043
5b98a762d1 Draft: Improve layer functions
The current make_layer function has a `None` default for the shape color and the line color. With that value the current preference is used. This, and how the function is called, results in some confusing behaviors:
* Newly created layers will only use 2 values from the preferences when they might use 5. The latter makes more sense for the end-user IMO.
* Layers created during DXF import (for example) will have a different shape color depending on the current preferences.
* The make_layer function may reapply colors that have already been set by the view provider.

To solve this all view property related function parameter have been changed to a not None value. If a None value is supplied the view property as set by the view provider is not changed. The Layer Manager has been updated accordingly.
I realize that calling a function with 6 None values is not very convenient, but think it is the solution that is least likely to break other exiting code.

Additionally:
* Removed the makeLayer function. Layers were introduced in V0.19 when the naming scheme was changed to "make_*". Maybe it was created by mistake, or before the actual renaming operation started, but it is safe to remove it now.
* Removed overly verbose messages.
* gui_layers.py had a missing import (result of a previous V0.22 PR): `from draftutils import utils`.
2024-01-22 11:29:13 -06:00
Roy-043
35f10ad5a5 Draft: remove reapply_diffuse_color workaround
The function would trigger the creation of duplicate Draft Polar Arrays (only on Linux and only if the Fuse option is selected and the Link Array option deselected).
Forum topic:
https://forum.freecad.org/viewtopic.php?t=84090

The reapply_diffuse_color function is no longer required anyway as Issue #8340 has been fixed.
2024-01-10 16:46:49 +01:00
Roy-043
56d73f39ac Draft: implement new get_param functions (step 1)
See #11677
2023-12-11 19:31:34 +01:00
Roy-043
484bbf3807 Draft: improve handling of anno DisplayMode and LineSpacing
* DisplayMode controlled by new pref DefaultAnnoDisplayMode. This replaces the old dimstyle pref.
* LineSpacing pref is now used when creating annotations. Will be added to prefs ui later.
* format_object no longer changes FontSize as this conflicted with the height parameter in the make_text function.
* make_text function updated.
2023-11-27 15:45:56 +01:00
Roy-043
e4d6c328fc Draft: clone IfcType and Subvolume properties
Fixes #11186.
2023-10-31 15:43:33 +01:00
Roy-043
d6b402c59c Fix error in make_dimension.py 2023-10-23 20:24:30 +02:00
Roy-043
ca06e87a38 Draft: Updates related to the PlaneGui class (step 2)
Related issue:
#5603.

Additionally:
Fixed the issue where the texts of Arch_Space objects were not exported to DXF.
2023-10-23 16:25:12 +02:00
Yorik van Havre
55292e9041 Import: Support DXF text rotation (#11001)
* Import: Support DXF text rotation - fixes #10882

- Reads and supports text rotation in builtin DXF import
- Makes the builtin DXF import produce Draft texts instead of App::Annotations
- Extends the arguments of Draft make_text()

* [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>
2023-10-11 17:05:31 +02:00
luzpaz
4dbbe85c2b Fix various typos 2023-09-07 20:34:49 +02:00
Yorik van Havre
41a1a7a8e6 Merge pull request #10505 from Roy-043/Draft-Fix-angle-range-issue-of-make_circle
Draft: Fix angle range issue of make_circle
2023-09-04 11:29:13 +02:00
Roy-043
3cf51debca Ammended files based on review 2023-09-03 12:43:34 +02:00
Amritpal Singh
9f8f7c5ab3 Bug fix: Allow Draft WB to import in FreeCAD headless docker container 2023-09-03 12:24:22 +05:30