Commit Graph

25508 Commits

Author SHA1 Message Date
Yorik van Havre
55480c4c8d Draft: Provision for NativeIFC autogrouping 2023-06-07 13:02:49 +02:00
Yorik van Havre
2e28c4ff93 Arch: Export structural nodes to IFC 2023-06-07 10:54:05 +02:00
Yorik van Havre
cd40cccd5d Arch: Cleaned NativeIFC placeholders code 2023-06-07 10:53:40 +02:00
Chris Hennes
7e0ccc872c Merge pull request #9736 from chennes/archFixTypo
Arch: Fix typo in UI string
2023-06-06 12:05:55 -05:00
Chris Hennes
ffb6b97229 Arch: Fix typo in UI string 2023-06-06 11:36:13 -05:00
Chris Hennes
0f9f0f29ca FEM: Add translation for Electromagnetic Constraints 2023-06-06 11:31:12 -05:00
Chris Hennes
f18ead6f02 Sketcher: Add missing translations 2023-06-06 15:35:12 +02:00
Roy-043
4d7277138b Draft: fix near snap for meshes (#9719) 2023-06-05 09:58:50 +02:00
Chris Hennes
05b85d0ddc Sync translations 2023-06-04 14:11:21 -05:00
Chris Hennes
acf4cf2446 TechDraw: Translate some window titles 2023-06-04 09:59:53 -04:00
Chris Hennes
f4cb4de817 TechDraw: Translate Stacking 2023-06-04 09:58:35 -04:00
Roy-043
01de3d143d Draft: Add TextSpacing to Draft_AnnotationStyleEditor (#9702)
Also reordered the dialog a little.
2023-06-03 10:54:49 +02:00
Chris Hennes
87f8e07e2d Path: Remove DefaultExtentsColor 2023-06-02 19:19:09 -08:00
sliptonic
95f1ef523b Merge pull request #9677 from chennes/pathTranslations20230526
Path: Minor translation fixes
2023-06-02 15:18:35 -05:00
wmayer
72f5428592 PD: fixes #9538: sometimes can't deselect things in newly created sketches 2023-05-31 21:25:08 -04:00
Roy-043
e53e488999 Arch: Arch_Reference: task panel layout was added incorrectly (#9700) 2023-05-31 09:27:17 +02:00
wandererfan
dde0fa75fa [TD]remove html escape sequences from tooltip 2023-05-30 13:23:52 -04:00
Abdullah Tahiri
554ede35d2 Sketcher/Gui: Extend toolbar framework and fix toolbar visibility not preserved
=================================================================================

fixes #9208

Essentially:
- The regular mechanism to save toolbar state when changing from one WB to another
is not designed to support changes within one WB (e.g. from edit mode and back).
- At creation time, toolbars can be initialised with default visible or default hidden
state. Additionally, there is third configuration "Unavailable", which refers to a
toolbar that is hidden, and the control to enable it is also hidden by default.
- The ToolBarManager is extended to enable to set the State of one or more toolbars.
- The State refers to changes to be effected on one or more toolbars by client code:
* ForceHidden allows to hide a toolbar and also hide its control (a toolbar not available
in a mode).
* ForceAvailable allows to make a toolbar available by making its control visible, the
toolbar itself is visible or not depending on user settings.
* RestoreDefault allows to bring the control visibility to the default of the toolbar, the
toolbar itself is visible or not depending on user settings.
* SaveState allows to store the current visibility state of a toolbar. It enables client
code to save the state when appropriate. It provides the only option for default "Unavailable"
toolbars, which are fully managed by client code. It provides additional flexibility to save
other toolbar visibility on request.

For the Sketcher this means:
- That edit mode toolbars are not shown outside edit mode.
- That edit mode toolbars and non-edit mode toolbars can be configured independently.
- that edit mode toolbars' state is saved when leaving edit mode if and only if, the
workbench that is selected when leaving edit mode is the Sketcher WB.
- it won't save the state if the user manually selected another WB and then left edit
mode (why? see limitation above).

Limitation:
- When switching to another WB while in edit mode, the other WB is activated before the
current WB (sketcher WB) is deactivated. This means that at sketcher level, the sketcher
has no chance to save states or do other tidy up actions before the tools of the other WB
are activated.
- This, however, is understood as not relevant enough as to warrant changing the mechanisms
in place.
2023-05-30 16:37:53 +02:00
Yorik van Havre
68dc92f38b Merge pull request #9687 from Roy-043/Arch-more-consistent-object-naming-and-labelling
Arch: more consistent object naming and labelling
2023-05-30 15:18:00 +02:00
Yorik van Havre
6a51449a9f Merge pull request #9649 from yorikvanhavre/arch-ifc-rectange
Arch: Fixed wrong IFC export of rectangles
2023-05-30 15:13:11 +02:00
Yorik van Havre
63fa9aa89f Merge pull request #9643 from yorikvanhavre/yorikvanhavre-arch-html-tooltips
Arch: Removed html from tooltips (try 2)
2023-05-30 15:12:52 +02:00
Yorik van Havre
c395e13463 Merge pull request #9631 from yorikvanhavre/arch-command-texts
Arch: removed 'object' from command tooltips
2023-05-30 15:12:01 +02:00
Roy-043
d7923d2f56 Draft: get_svg: loose edges in obj with faces also received a fill (#9695) 2023-05-30 08:13:47 +02:00
Roy-043
2986e91b6c Arch: more consistent object naming and labelling
Following the example of Arch_Wall:
- Fixed object name.
- Default label is translatable.
- Name argument should only be used for the label and not be translated.
2023-05-28 15:58:54 +02:00
Roy-043
53c2a87bd3 Arch: Fix ArchReference (broken after #9316) (#9685) 2023-05-28 15:26:16 +02:00
wandererfan
3cf6b39685 [TD]fix Svg export of template fields 2023-05-28 09:24:14 -04:00
Abdullah Tahiri
6a96612625 Sketcher: new toPythonCommand sketcher Python method
====================================================

This commit leverages PythonConverter to produce the Python commands necessary to replicate
a sketch.

The output is a tuple comprising line by line the python commands.

Limitations: Only internal geometry is replicated. No external links.

Usage:
ActiveSketch.toPythonCommands()

Example output:
('geoList = []', 'geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(0.000000, 0.000000, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 65.000000), 3.926991, 8.639380))', 'geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(-70.304056, -14.307964, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 65.000000), 1.186945, 1.992409))', 'ActiveSketch.addGeometry(geoList,False)', 'del geoList', 'constrGeoList = []', 'constrGeoList.append(Part.LineSegment(App.Vector(-45.961941,45.961941,0.000000),App.Vector(0.000000,0.000000,0.000000)))', 'constrGeoList.append(Part.LineSegment(App.Vector(0.000000,0.000000,0.000000),App.Vector(-45.961941,-45.961941,0.000000)))', 'ActiveSketch.addGeometry(constrGeoList,True)', 'del constrGeoList', 'geoList = []', 'geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(-70.304056, 14.307964, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 65.000000), 4.290776, 5.096240))', 'geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(-50.000000, 0.000000, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 65.000000), 2.376910, 3.906275))', 'ActiveSketch.addGeometry(geoList,False)', 'del geoList', 'constraintList = []', "constraintList.append(Sketcher.Constraint('Coincident', 0, 3, -1, 1))", "constraintList.append(Sketcher.Constraint('Coincident', 1, 1, 0, 2))", "constraintList.append(Sketcher.Constraint('Coincident', 2, 1, 0, 2))", "constraintList.append(Sketcher.Constraint('Coincident', 2, 2, 0, 3))", "constraintList.append(Sketcher.Constraint('Coincident', 3, 1, 0, 3))", "constraintList.append(Sketcher.Constraint('Coincident', 3, 2, 0, 1))", "constraintList.append(Sketcher.Constraint('Symmetric', 0, 1, 0, 2, -1))", "constraintList.append(Sketcher.Constraint('Coincident', 4, 2, 0, 1))", "constraintList.append(Sketcher.Constraint('Symmetric', 1, 3, 4, 3, -1))", "constraintList.append(Sketcher.Constraint('Symmetric', 4, 1, 1, 2, -1))", "constraintList.append(Sketcher.Constraint('Coincident', 5, 1, 1, 2))", "constraintList.append(Sketcher.Constraint('Coincident', 5, 2, 4, 1))", "constraintList.append(Sketcher.Constraint('DistanceY', 4, 1, 1, 2, 90.000000))", "constraintList.append(Sketcher.Constraint('Radius', 5, 65.000000))", "constraintList.append(Sketcher.Constraint('DistanceX', 5, 3, 0, 3, 50.000000))", "constraintList.append(Sketcher.Constraint('Equal', 5, 4))", "constraintList.append(Sketcher.Constraint('Equal', 4, 0))", "constraintList.append(Sketcher.Constraint('Perpendicular', 2, 3))", 'ActiveSketch.addConstraint(constraintList)', 'del constraintList', '')

A list directly copiable into the console of a new sketch can be obtained, for example:

for i in ActiveSketch.toPythonCommands():
    print(i)

Example output:
geoList = []
geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(0.000000, 0.000000, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 65.000000), 3.926991, 8.639380))
geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(-70.304056, -14.307964, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 65.000000), 1.186945, 1.992409))
ActiveSketch.addGeometry(geoList,False)
del geoList
constrGeoList = []
constrGeoList.append(Part.LineSegment(App.Vector(-45.961941,45.961941,0.000000),App.Vector(0.000000,0.000000,0.000000)))
constrGeoList.append(Part.LineSegment(App.Vector(0.000000,0.000000,0.000000),App.Vector(-45.961941,-45.961941,0.000000)))
ActiveSketch.addGeometry(constrGeoList,True)
del constrGeoList
geoList = []
geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(-70.304056, 14.307964, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 65.000000), 4.290776, 5.096240))
geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(-50.000000, 0.000000, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 65.000000), 2.376910, 3.906275))
ActiveSketch.addGeometry(geoList,False)
del geoList
constraintList = []
constraintList.append(Sketcher.Constraint('Coincident', 0, 3, -1, 1))
constraintList.append(Sketcher.Constraint('Coincident', 1, 1, 0, 2))
constraintList.append(Sketcher.Constraint('Coincident', 2, 1, 0, 2))
constraintList.append(Sketcher.Constraint('Coincident', 2, 2, 0, 3))
constraintList.append(Sketcher.Constraint('Coincident', 3, 1, 0, 3))
constraintList.append(Sketcher.Constraint('Coincident', 3, 2, 0, 1))
constraintList.append(Sketcher.Constraint('Symmetric', 0, 1, 0, 2, -1))
constraintList.append(Sketcher.Constraint('Coincident', 4, 2, 0, 1))
constraintList.append(Sketcher.Constraint('Symmetric', 1, 3, 4, 3, -1))
constraintList.append(Sketcher.Constraint('Symmetric', 4, 1, 1, 2, -1))
constraintList.append(Sketcher.Constraint('Coincident', 5, 1, 1, 2))
constraintList.append(Sketcher.Constraint('Coincident', 5, 2, 4, 1))
constraintList.append(Sketcher.Constraint('DistanceY', 4, 1, 1, 2, 90.000000))
constraintList.append(Sketcher.Constraint('Radius', 5, 65.000000))
constraintList.append(Sketcher.Constraint('DistanceX', 5, 3, 0, 3, 50.000000))
constraintList.append(Sketcher.Constraint('Equal', 5, 4))
constraintList.append(Sketcher.Constraint('Equal', 4, 0))
constraintList.append(Sketcher.Constraint('Perpendicular', 2, 3))
ActiveSketch.addConstraint(constraintList)
del constraintList
2023-05-28 14:59:31 +02:00
Abdullah Tahiri
790e28c5e9 Sketcher: PythonConverter not respecting creation order
=======================================================

The original coding grouped normal and construction geometries together regardless of the actual order.

If construction geometries where interleaved with normal geometries, all normal would be grouped into a single
list and all construction into another.

This causes a problem that indices referenced in constraints may not match.

This commit fixes this behaviour. While still creating as much geometries together as a list, as many lists as
necessary are created to keep the order of creation.
2023-05-28 14:59:31 +02:00
Abdullah Tahiri
4b5a796a67 Sketcher: Fix bug angle via point visualisation
===============================================

Issue description:
https://forum.freecad.org/viewtopic.php?f=3&t=70325
https://github.com/FreeCAD/FreeCAD/issues/7520

The general algorithm to calculate normals miserably fails when
the curve is a line segment and the point through which the normal
to a curve is to be drawn is colinear with the line segment.

The solution is to provide specific code for this corner case.

fixes #7520
2023-05-28 06:45:50 +02:00
Chris Hennes
103df5c541 Sketcher: 'B-spline' consistency 2023-05-27 21:47:25 +02:00
Chris Hennes
b1b4af1efb Path: UI file adjustments 2023-05-26 16:29:27 -06:00
Roy-043
a779ba3514 Draft: fix getcoords in gui_snapper.py (#9654)
The function did not handle global and relative mode properly
2023-05-26 19:45:31 +02:00
Chris Hennes
3b39981e4e Path: Address translator comments 2023-05-26 11:27:37 -05:00
Chris Hennes
5a968f9943 Path: Conform 'post processor' 2023-05-26 10:20:16 -05:00
Chris Hennes
2686ad58b9 Update translations 2023-05-25 21:32:26 -05:00
Abdullah Tahiri
270b0cbdc8 Sketcher: SketcherTests - format black 2023-05-25 17:08:03 +02:00
Abdullah Tahiri
2211d68303 Sketcher: /Mod/Sketcher c++ header clang 2023-05-25 17:08:03 +02:00
Abdullah Tahiri
8d75ca50c7 Sketcher: /Mod/Sketcher python code black formatted 2023-05-25 17:08:03 +02:00
Abdullah Tahiri
78ae9c1d7d SketcherGui: apply clang-format 2023-05-25 17:08:03 +02:00
Chris Hennes
dc2d861bf0 Merge pull request #9637 from Ondsel-Development/sanitybug
fix label and file size
2023-05-25 07:28:33 -05:00
Roy-043
3aca29a8b4 Sketcher: fix typo in Refraction constraint menu text 2023-05-25 14:12:06 +02:00
Roy-043
254cec4067 Sketcher: Improve grid and snap related GUI texts
- Always use sentence case (as elsewhere in Sketcher)
- 'Toggle grid' instead of 'Activate grid'.
- Some other minor changes.
2023-05-25 14:10:45 +02:00
Abdullah Tahiri
0bdc7bb370 SketcherGui: Separate user and developer errors
===============================================

Revisiting all console calls:
- Using the Notification Framework when the user needs to be notified
- Turning them into DeveloperError/DeveloperWarnings when messages are intended only for developers
2023-05-25 14:09:06 +02:00
Roy-043
2b853b0126 Draft: Draft_CubicBezCurve: set EnableSelection to False, fixes #6452 (#9640)
While the command is active set EnableSelection to False to correctly detect mouse up events.
2023-05-24 20:35:24 +02:00
Yorik van Havre
b801983109 Draft: Fixes continuing dimensions - fixes #9507 (#9632) 2023-05-24 20:34:52 +02:00
Abdullah Tahiri
2bc3295cf3 Sketcher: Obey non-intrusive preferences for modal pop-ups
==========================================================

This commit turns the remaining blocking pop-ups in which the user can only click "ok"
into non-intrusive notifications, depending on the user preferences in settings.
2023-05-24 18:35:41 +02:00
wandererfan
e8bc9af344 [TD]prevent object deletion outside dialog 2023-05-24 10:15:45 -04:00
wandererfan
27ef8a598d [TD]fix fail on object deleted during dialog (#9626) 2023-05-24 10:15:45 -04:00
Yorik van Havre
efbbac87cf Arch: Fixed wrong IFC export of rectangles 2023-05-24 10:44:01 +02:00
wmayer
9fba227887 Sketcher: fix crash when creating a parabola or hyperbola or when using Sketcher_Split
Forum: https://forum.freecad.org/viewtopic.php?t=78543
2023-05-23 20:01:41 +02:00