Commit Graph

2575 Commits

Author SHA1 Message Date
wmayer
6401c18937 Part: fix -Wclazy-connect-by-name 2023-04-05 00:44:13 +02:00
0penBrain
4cc2a1af62 Gui: prevent crashes on MacOS using boost::format 2023-03-31 15:22:03 +02:00
wandererfan
99644ac5e7 [Part]handle unicode filename on win 2023-03-29 15:04:57 -04:00
alexneufeld
c78bdb95b8 Explicitly use App.Vector in docstrings 2023-03-27 16:34:28 +02:00
alexneufeld
e567ff7911 fix incorrect docstring for Part.Shape.extrude method 2023-03-27 16:34:28 +02:00
wmayer
4ca33e35aa Part: make PropertyGeometryList more permissive
Since not all Geometry sub-classes fully implement Save() / Restore() raising an exception instead may invalidate a project. To avoid this
PropertyGeometryList now explicitly handles NotImplementedError exceptions.

See also: https://forum.freecad.org/viewtopic.php?t=77148
2023-03-27 16:09:33 +02:00
Andrew
1eaf8a724e Clean Mod/Part. remove old OCC <7.3 and #if 0 code. 2023-03-26 21:17:18 +02:00
Ajinkya Dahale
a4bbc79d99 [Part] Add TopoShapeOpCode.h
Constants to be used in the future.

Apply suggestions from code review

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2023-03-22 22:09:13 +05:30
wmayer
38a100962c Import/Part: [skip ci] restore some comments 2023-03-14 21:47:41 +01:00
Ronny Standtke
e89cba0769 move "Close" button of angular variant also to north 2023-03-13 11:56:27 -05:00
wmayer
2a0e52e71e clang: fix -Wunused-but-set-variable 2023-03-12 15:05:21 +01:00
Andrew
91f0688625 remove unnecessary include 2023-03-10 16:35:13 +01:00
luzpaz
01e8bbc2bf Fix various typos and whitespace 2023-03-10 14:40:46 +01:00
Abdullah Tahiri
ee0c3ad5c1 Console/ILogger: Refactor and extension
=======================================

Refactor:
 - Substitute the use of variadic templates with parameter packs.
 - Use recently incorporated external library "fmt" to handle printf like formating.
 - Extensive cleaning of pragmas and unnecessary forward declarations.
 - Parameter packs and libfmt provide a much stronger type checking now, so
   conversions that are by standard implicit as bool to int need an explicit static_cast
   to avoid compilation warnings.

Extension:
 - Include a notifier field, so that the originator of the message can be provided. E.g. Document#DocumentObject
 - Include a new type of message called CriticalMessage, this message is intended to have
   special behaviour in the future. Namely, it will be used to notify forward compatilibity issues.
   It will be used to substitute the current signal/slot mechanism.
 - Include two new types of messages for user notifications (Notification and TranslatedNotification). This messages
   will be use to convey UI notifications intended for the user (such as non-intrusive message about the usage of a tool). There
   are two versions to mark whether the string provided as a message is already translated or not. When using the console system for
   notifications, these notifications may originate from the App or the Gui. In the former, it is generally the case that the strings
   of messages are not (yet) translated (but they can be marked with QT_TRANSLATE_NOOP). In the latter, often the messages to be provided
   are already translated.

Python support for CriticalMessage, Notification and TranslatedNofification, including shortcuts:

    Crt = FreeCAD.Console.PrintCritical
    Ntf = FreeCAD.Console.PrintNotification
    Tnf = FreeCAD.Console.PrintTranslatedNotification
2023-03-07 16:13:23 +01:00
wmayer
0e6cf0d9dd Part: set minimum angular deflection to 1 deg
See also forum: https://forum.freecad.org/viewtopic.php?t=76614
2023-03-07 10:41:38 +01:00
wmayer
977e726f47 Part: extend command Part_PointsFromMesh to support any geometric type 2023-03-04 14:44:58 +01:00
luzpaz
5e9539cd9c Fix typos [skip ci] 2023-03-03 09:09:26 -06:00
wmayer
a7c37aacb0 Part: Compute center of gravity for compounds
* If the compound contains solids then other shape types like faces or edges are ignored
* If the compound contains no solids but faces then edges are ignored
* If the compound contains no faces but edges then vertexes are ignored
2023-03-02 19:34:18 +01:00
wmayer
c770e1b677 Mod: catch exception raised by Rotation::setValue 2023-03-01 18:43:15 +01:00
wmayer
3ca5e80ea9 Part: fix TopoShapeListTest 2023-03-01 14:51:47 +01:00
wandererfan
10fd7db620 [Part]add test for PropertyTopoShapeList 2023-03-01 14:24:40 +01:00
wandererfan
c6fd9a1532 [Part]use sharedptr for Restore 2023-03-01 14:24:40 +01:00
wandererfan
2f357a58c7 [Part]PropertyTopoShapeList changes from review 2023-03-01 14:24:40 +01:00
wandererfan
483238cc7f [Part]add PropertyTopoShapeList 2023-03-01 14:24:40 +01:00
Yorik van Havre
be6a654b3e merged crowdin translations 2023-02-27 16:01:15 +01:00
Yorik van Havre
2cd27ce328 updated ts files 2023-02-27 15:35:51 +01:00
Chris Hennes
46131a3696 Part: SectionCutting cutTransparency initialization
Addresses Coverity CID 356563: Uninitialized scalar.
2023-02-26 05:40:32 +01:00
Abdullah Tahiri
87a412f951 Part/Sketcher: Grid - set grid orientation
==========================================

Extend ViewProviderGridExtension so that it is aware of the absolute direction of the XY plane on which the grid is to be drawn.

Fix the calculation of the cam origin.
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
82e9a49ab3 Sketcher: Grid - Imperial
=========================

Fix grid calculation in Imperial units in Auto mode (wrong scaling).

Remove observer as unit does not need to be observed.
2023-02-25 23:13:55 +01:00
0penBrain
f1bd743b1b Sketcher/Grid: fix error in parameter function call
Sketcher/Grid: fix algorithm computing the automatic grid spacing

Sketcher/Grid: forcefully redraw grid when one of its parameter is changed

Sketcher/Grid: always authorize user to change grid spacing, even if 'auto spacing' is enabled

Sketcher/Grid: apply a default factor of 10 for 'auto spacing' if number of subdivision is 1
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
f486ee74a4 Sketcher: Grid - correction of design decisions
===============================================

Removal of ViewProviderGridExtension properties:
-GridStyle
-GridSnap

Improvement of ViewProviderGridExtension API:
- color via App::Color

Toolbar grid command:
- Conversion of Snapping to edit parameter
- Snap gets a class enum to support future Snapping functionalities as edit parameter

Sketcher Settings:
- Removal of snap preference

Behaviour:
- ShowGrid, GridAuto, GridSize preferences do not change any existing VP. They apply to any newly created sketch.
- Do not limit grid to hardcoded values

Snap to grid:
- Code updated to use closestpoint functionality provided by the extension,

Several other fixes
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
1d9298590f Sketcher/Part: Grid - Architecture
==================================

- Move all grid specific code out of ViewProviderSketch and EditModeCoinManager.
- The code in made into a new extension in Part - ViewProviderGridExtension
- ViewProviderSketch starts deriving from this new extension
- ViewProviderSketch configures the extension according to its Grid preferences
- Grid code refactored to remove hardcoded sketcher preference parameters.
- ViewProviderGridExtension handles property name/type changes within its competence.
2023-02-25 23:13:55 +01:00
0penBrain
982c1b4421 [BugFix] Part: fix XSkew+YSkew editing not took into account for cylinders 2023-02-24 10:06:36 +01:00
Uwe
f15c55f242 [Part] fix encoding bug
- fixes the regression by #7255 -> the degree sign cannot be decoded as Latin1
2023-02-24 04:07:21 +01:00
0penBrain
0d577a8789 Base: introduce 'getSafeUserUnit' that fallbacks to full precision and internal unit ...
... in case unit schema would zero a non-zero quantity

 For example, using '1 mil' with UnitsSchemaImperialDecimal schema
2023-02-23 15:22:07 +01:00
0penBrain
51103fbeb1 Part: better quantity values handling for primitives 2023-02-23 15:22:07 +01:00
wmayer
c4d8de3992 Part: don't restrict width of group boxes in section cutting dialog 2023-02-22 21:06:12 +01:00
Syres916
8215af8906 [Part] Fix Geometric Primitives task panel bug
See discussion https://forum.freecad.org/viewtopic.php?t=76218
2023-02-22 14:27:58 +01:00
wmayer
643a71ae6e Part: add integration tests 2023-02-14 22:56:42 +01:00
wmayer
454c580457 Part: creating a NURBS of a circle or ellipse doesn't respect any transformation
Example:

mat = App.Matrix()
mat.rotateX(1)
mat.rotateY(1)
mat.rotateZ(1)

circle = Part.Circle()
circle.Radius = 5
circle.transform(mat)

circle.transform(mat)
Part.show(circle.toShape())

nurbs = circle.toNurbs()
Part.show(nurbs.toShape())

arc = circle.trim(0, 2)
nurbs = arc.toNurbs()
Part.show(nurbs.toShape())

spline = circle.toBSpline()
Part.show(spline.toShape())

#-------------------------

ellipse = Part.Ellipse()
ellipse.MajorRadius = 5
ellipse.MinorRadius = 3
ellipse.transform(mat)

ellipse.transform(mat)
Part.show(ellipse.toShape())

nurbs = ellipse.toNurbs()
Part.show(nurbs.toShape())

arc = ellipse.trim(0, 2)
nurbs = arc.toNurbs()
Part.show(nurbs.toShape())

spline = ellipse.toBSpline()
Part.show(spline.toShape())
2023-02-14 22:56:42 +01:00
Yorik van Havre
0566d90cc5 merged crowdin translations 2023-02-13 15:45:26 +01:00
Yorik van Havre
63e4a36000 updated ts files 2023-02-13 15:45:26 +01:00
Uwe
f7df219b7b [Part] extend SectionCutting feature for intersecting objects
- it is a well-known and often feed-backed missing feature that SectionCuttings fails for intersecting objects.
To resolve this, the objects must be put int a BooleanFragments object.
- this PR adds this functionality as option.
- since a BooleanFragments objects has a specific color, the different colors of the objects cannot be preserved. Because of this disadvantage, the BooleanFragments option will not be the default.

- this PR also modernize all for loops
2023-02-13 00:46:37 +01:00
wmayer
d6208d9b9a Part: fixes to create a NURBS for the arc of a conic
See forum: https://forum.freecad.org/viewtopic.php?t=75846
2023-02-12 19:45:00 +01:00
Yorik van Havre
d8b0e64e14 Merged crowdin translations 2023-02-07 15:55:31 +01:00
Yorik van Havre
94cd431eb2 updated ts files 2023-02-07 15:55:31 +01:00
Uwe
06e0f477a6 [Part] [skip ci] update a tooltip
- since FC 0.20 we require OCC 7.4
2023-02-03 12:15:28 -06:00
Pascal de Bruijn
c767880908 Increase mesh generation output quality 2023-02-03 12:08:10 -06:00
Pascal de Bruijn
3ecff9588e Tools: tweak mesh generation
Mesh generation parameters are taken from PrusaSlicer's STEP importer,
which does a just-in-time STEP->STL conversion in memory.

Resulting meshes have better geometry, but are a little larger as a result.
2023-02-03 12:08:10 -06:00
wmayer
083da6cf03 Part: replace slots with member function pointers 2023-02-03 00:21:38 +01:00