Commit Graph

3449 Commits

Author SHA1 Message Date
Chris Hennes
c05111cb59 Merge pull request #13914 from Roy-043/Draft-Draft_SetStyle-new-Material-handling
Draft: Draft_SetStyle new Material handling
2024-05-13 11:22:11 -05:00
marcuspollio
a3d0713911 Update Draft WB icons (#13585)
* Update Draft WB icons

* Also make all icons 64px based

* keep inner white outline and small tweaks

* Tweaks following review

* Further tweaks following feedback

* Tweak more icons for consistency with light/dark themes

* Update following PR 13865, save as Plain SVG and remove unused ressources

Update texts for visibility

Some more cleanup

Use consistent FreeSans font
2024-05-13 11:20:42 -05:00
wmayer
41a707dcfe Draft: refactor TestDraftGeomUtils 2024-05-13 09:15:35 +02:00
Chris Hennes
9fead3682d Update translations 2024-05-12 17:06:56 -05:00
Roy-043
3dc1de6acf Draft: minor refactor of layer code (#13948) 2024-05-12 09:49:04 +02:00
Roy-043
30b3fcd045 Draft: Update v0.22 references to v1.0 (#13934) 2024-05-12 09:47:51 +02:00
Roy-043
81436e833a get_appearance_material -> get_view_material
Also removed the ret_default argument.
2024-05-11 10:11:16 +02:00
Roy-043
4c87e22b7f Draft: Add "legacy importer only" to DXF option (#13638)
* Draft: Clarify "legacy only" DXF options in the preferences

Fixes #13598.
2024-05-09 11:12:19 +02:00
Roy-043
1b2ef7831f Draft: Draft_SetStyle new Material handling
Discussion: #13657.
2024-05-09 10:49:19 +02:00
Chris Hennes
a5d8aaa21c Update translations
Also removes Web from translation scripts.
2024-05-06 18:17:53 +02:00
Martin Rodriguez Reboredo
51987dc1ab Fixups with Qt6 enums (#13611)
* Python PySide enums to C++ converter

* Python IntFlags to C++ int in getStandardButtons

* Remove int conversion in mods Python sources
2024-05-06 18:02:18 +02:00
Roy-043
1e49201b6c Clean up... 2024-05-06 11:07:23 +02:00
Roy-043
543f758f23 More files are involved... 2024-05-06 11:07:23 +02:00
Roy-043
6c2bdabc3d Draft: Do not show temporary line object in tree (additional)
#13778 introduced `self.obj.ViewObject.ShowInTree = False` to hide the temporary object. But objects that are hidden in the tree are displayed in the tree when they are selected in the 3D view. This selection occurs during commands that take more than 2 points. The solution is to change `self.obj.ViewObject.Selectable` on mouse button up/down.

Fixes #13700.
2024-05-06 11:07:23 +02:00
Roy-043
a10062caa4 Merge pull request #13778 from yorikvanhavre/draft-hide-templine
Draft: Do not show temporary line object in tree
2024-05-02 22:28:11 +02:00
Yorik van Havre
aee2afdca7 Draft: Do not show temporary line object in tree - fixes #13700 2024-05-02 11:04:15 +02:00
Roy-043
66f36fd7d2 Draft: update Draft Point viewprovider to account for ShapeAppearance
Without this mod there is an error when opening a V0.21 file with a Draft Point. As well as when creating a Draft Point in V0.22.
2024-05-02 10:09:28 +02:00
Dov Grobgeld
e66e90b512 Fix run time errors with python3.12 and pyside6 (#13337)
* Change pyopen=open expression to from builtins import open as pyopen

---------

Co-authored-by: Adrián Insaurralde Avalos <36372335+adrianinsaval@users.noreply.github.com>
2024-04-30 00:28:01 -04:00
Roy-043
30536de9a8 Only imported modules can be reloaded 2024-04-29 16:15:58 +02:00
Roy-043
4e908ee9bd Draft: legacy DXF importer: downloaded libs should be reloaded
Otherwise old versions will still be used in the current FreeCAD session.
2024-04-29 16:15:58 +02:00
Roy-043
9325a1cd5a Draft: legacy DXF importer fix group and layer behavior
Fixes #13621.

Currently the legacy DXF importer creates a main group with the DXF name if a DXF is imported into an existing FreeCAD document. For each DXF layer it then creates a sub-group (or Draft Layer) inside that main group. Objects are nested in the sub-groups (or Draft Layers).

This does not make sense for Draft Layers as they should be nested in the LayerContainer, which should be in the root of the FreeCAD document.

Both for Draft Layers and sub-groups there is the issue that if mutliple DXF files are imported in the same FreeCAD document, exising Draft Layers and sub-groups are not taken into account. For each DXF a new "0" group/layer is created (with a Label that is not "0" and therefore not recognized), and if there are objects on that layer a new group/layer is created for each object (labelled "0001", "0002", "0003", etc).

To solve this the main group with the DXF name is no longer created in the revised code and the layers variable is initialized with the groups/layers that already exist in the FreeCAD document.

Additionally the formatObject function should not format objects that are in Draft Layers. Its action conflicts with the layer mechanism resulting in the last imported object having an incorrect color.
2024-04-29 16:15:16 +02:00
Roy-043
4d2e124f11 Merge pull request #13633 from Roy-043/Draft-revert-Draft-WB-changes-from-13294
Draft: revert Draft WB changes from #13294
2024-04-26 10:46:05 +02:00
Roy-043
8c19516da2 Merge pull request #13612 from cjmayo/draft-byteCount
Draft: Fix QImage object has no attribute 'byteCount'
2024-04-25 09:20:10 +02:00
Roy-043
152d642b60 Draft: revert Draft WB changes from #13294
Revert the Draft WB related changes of #13294.
2024-04-24 21:27:04 +02:00
Chris Hennes
ead426c6eb Update translations
Note: Web and Start omitted
2024-04-24 13:58:21 -05:00
Chris Mayo
170f8baa29 Draft: Fix QImage object has no attribute 'byteCount'
'PySide6.QtGui.QImage' object has no attribute 'byteCount'
load_texture: unable to load texture
2024-04-23 19:35:54 +01:00
wwmayer
dd9da969e9 PySide6: Fixes #13533: QSvgWidget is not a child of QtSvg in PySide6 (#13554)
* Create a compatibility module QtSvgWidgets.py to handle PySide2 & PySide6
* In the Arch and Material modules use the QtSvgWidgets module
* Since Qt6 the method QFont.setWeight() doesn't accept an int any more but requires an enum. Since the call of QFont.setBold(True) sets
  a weight of 75 the extra calls of QFont.setWeight(75) can be safely removed

Co-authored-by: Adrián Insaurralde Avalos <36372335+adrianinsaval@users.noreply.github.com>
2024-04-22 18:35:33 -04:00
WandererFan
c9498235ae Merge pull request #13489 from yorikvanhavre/draft-axes-colors
Draft: Use preference-stored colors for axes colors
2024-04-22 12:08:17 -04:00
Roy-043
cd1f520788 Draft: Move MouseDelay pref to General group and set max value
* The MouseDelay pref does not belong in the "Grid and snapping" pref group.
* Max. value was missing. Without it the spinbox only goes to 100.
* The 3600 suggestion was removed from the tooltip as it is an unworkable value. But entering it is possible now.
2024-04-21 20:05:29 +02:00
Roy-043
6ad75fb315 Draft: Fix error when deleting first digit of input
Fixes #13150.
2024-04-19 19:16:13 +02:00
Roy-043
11903d2d1b Draft: Draft_ToggleGrid should update the grid
Fixes #13530.
2024-04-19 15:42:28 +02:00
Chris Hennes
e7069e6797 Update translations. 2024-04-17 16:50:38 -05:00
Roy-043
062b7d4c94 Draft: FIx issue with get_shape_normal
Forum topic: https://forum.freecad.org/viewtopic.php?t=86817
2024-04-16 15:04:49 +02:00
Yorik van Havre
8acf9f7093 Draft: Use preference-stored colors for axes colors - issue #12208 2024-04-16 10:20:01 +02:00
David Carter
ba20441935 Material: Material appearance
Uses new material system for appearance

Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.

The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.

A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
2024-04-04 07:39:58 -05:00
paul
f29131bbae [ArchWall] getExtrusionData() fix normal problem by adding get_shape_normal() (#12603)
* [ArchWall] getExtrusionData() fix normal problem by adding get_shape_normal()

In geometry.py
- added get_shape_normal()
- fixed is_straight_line()
DraftGeomUtils.py
- added get_shape_normal()

FC Discussion - https://forum.freecad.org/viewtopic.php?p=726101#p726101

* [ArchWall] getExtrusionData() fix normal problem

Follow-up following discussion at https://github.com/FreeCAD/FreeCAD/pull/12603

- delete trailing whitespaces
- put Part.makePolygon() in try statement
- study and findings at https://github.com/FreeCAD/FreeCAD/pull/12603#issuecomment-1969277743

In geometry.py
- added get_shape_normal()
- fixed is_straight_line()
DraftGeomUtils.py
- added get_shape_normal()

FC Discussion - https://forum.freecad.org/viewtopic.php?p=726101#p726101

* Update geometry.py

* Update geometry.py

* Update geometry.py

---------

Co-authored-by: Yorik van Havre <yorik@uncreated.net>
2024-04-02 11:54:27 +02:00
Chris Hennes
c37c32edc9 Merge pull request #13154 from chennes/translations20240325
Update translations and fix script
2024-03-28 13:51:39 -05:00
Roy-043
8ff3a1ec39 Draft: add Fuse property to patharray and pathtwistedarray
See #13172.
2024-03-28 12:03:46 +01:00
Roy-043
7dc1ce17c9 Draft: add Fuse property to pointarray
Fixes #12906.
2024-03-26 22:36:18 +01:00
Roy-043
34c252b4f8 Merge pull request #13051 from yorikvanhavre/draft-wp-set-color
Draft: Allow to change grid color in WP taskpanel
2024-03-26 11:17:13 +01:00
Chris Hennes
1a51c0cb57 Update translations 2024-03-25 18:08:22 -05:00
Chris Hennes
32a957bd07 Translation update: move Path to CAM 2024-03-25 17:32:59 -05:00
Yorik van Havre
12cddc3fb7 Merge branch 'main' into draft-wp-set-color 2024-03-25 18:37:00 +01:00
Roy-043
d289e2b8f7 Let param observer trigger grid color change
If you change the grid color in the preferences and cick the Apply button, the color of all grids is updated now. So you can experiment while the Preferences Editor is open.

I have kept but moved the grid color button in the Draft_SelectPlane task panel for now. So that both options can be tested.
2024-03-24 09:58:51 +01:00
Roy-043
2dd27ec276 Draft: fix handling of shapes in shape2dview.py
Fixes a problem introduced with #10712. If the Shape is not a Compound, the shape itself, and not its SubShapes should be used.
2024-03-22 18:17:04 +01:00
Roy-043
de65f805b9 Draft: Improve logic of Draft_Label texts
The proposed code fixes the following issues:
1. There is no check if the target object itself has a property that matches the label type.
2. If a subelement is selected that does not have the label type property, the value from the main object is displayed instead.
3. The default text is an empty string.

Example:

Currently If you select a vertex of a wire, and select "Length" as the label type, you will get the length of the wire. With the new code the text will then be "Length not available for (sub)object".

Forum topic (issue #1):
https://forum.freecad.org/viewtopic.php?t=86222
2024-03-20 18:29:01 +01:00
Yorik van Havre
0786a4ad92 Draft: a bit more contrast to the grid 2024-03-20 13:35:40 +01:00
Yorik van Havre
e50c89b445 Draft: Allow to change grid color in WP taskpanel 2024-03-20 12:20:31 +01:00
Yorik van Havre
d77f958112 Draft: Made get_type aware of IFC objects 2024-03-18 18:50:56 +01:00
FEA-eng
344bc2336f DRAFT: Update preferences-draftsnap.ui 2024-03-15 13:01:56 +01:00