Commit Graph

159 Commits

Author SHA1 Message Date
Benjamin Bræstrup Sayoc
9f8f6b1f56 [TechDraw] Use templates instead of duplicate code: toGp 2025-02-08 22:35:57 +01:00
Eric Price
aba60775f6 Fix boolean operations (#17119)
* add BRepAlgoAPI wrapper files to CMakeList

* introduce wrapper for BRepAlgoAPI_BooleanOperation and derivatives, set sensible default Fuzzyness for boolean operations

* allow default fuzzyness to be set in settings - including off

* backwards compatibility with OCCT 7.3.3 - removed newer paramateres from wrapper

* added missing header

* reverted src/Mod/Part/App/OpenCascadeAll.h to original state

* implement some changes suggested by @wwmayer

* removed unneeded destructor definitions

* moved getDefaultFuzzyValue into its own helper class

* removed unneeded references to base class default constructor

* default to SetRunParallel(Standard_True) as suggested by @FlachyJoe

* fixed license header as requested

* Added new method to autocalculate fuzzyness to BooleanOperation base class and use it for those parts that do not call the obsolete constructor but also do not set precision

* implemented static variable solution as suggested by @wwmayer

* added helix for test case

* Refactoring FCRepAlgoAPI to FCBRepAlgoAPI

* Added Test Case (fuse cylinder with helix with different working and non-working Fuzzy values)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* increased default value of FuzzyBoolean and made tests more robust for compatibility with OCCT 7.3

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixes for FREECAD_USE_PCH - allow testing of FREECAD_USE_PCH on linux with cmake switch (default OFF)

* removed surplus line - wasn't needed after all

* included precompiled as instructed

* set anti-corruption flag in boolean operations, ensures source shape is not damaged in OCCT 7.1 and higher

* fix #17085

* disable subtests that were too specific for now

* fixed all CLI tests - see comments in Pull Request https://github.com/FreeCAD/FreeCAD/pull/17119#issuecomment-2420772452

* Update src/Mod/PartDesign/PartDesignTests/TestTopologicalNamingProblem.py

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* remove surplus tests from github suggestion interface bug

* hide the BooleanFuzzy variable - can now be only set by manually editing the config file
i
in FCParamGroup "Boolean"
<FCFloat Name="BooleanFuzzy" Value="10.000000000000"/>

* Suggestion by @FlachyJoe - add validity checks to the base and tool shape in any direct boolean op

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>
2024-10-21 18:38:51 +02:00
WandererFan
140bcf605e [TD]Fix section snapping (fix #15961) (#15450)
* [TD]Add view snapping preferences

* [TD]fix section snapping algo

- snap sections to section normal line.
- snap views to other views in X&Y

* [TD]fix snapping to ProjectionGroups
2024-09-02 18:41:25 +02:00
PaddleStroke
127ee90cec TechDraw: Enable snapping section views to their base views. 2024-05-27 11:44:31 -04:00
wandererfan
730136e3e9 [TD]fix no PAT hatch on first paint 2024-03-23 08:47:36 -04:00
wandererfan
a4c55b9ec8 [TD]protect against stretch factor == 0 2024-01-20 18:58:55 -05:00
wandererfan
1d3aca0733 [TD]handle loose geometry via HLR 2023-12-03 08:55:59 -05:00
Florian Foinant-Willig
1d8a51b47b TechDraw: modernize type checking 2023-10-23 18:08:59 +02:00
André Caldas
0f27212d57 TechDraw: creates closure for concurrent thread context.
We use a lambda function with a copy of variables
that might be destructed in the original calling thread,
possibly producing dangling references.

See: https://forum.freecad.org/viewtopic.php?t=81260
2023-09-20 09:26:15 -04:00
wandererfan
404351065e [TD]fix fail on section delete
- fails in onChange during delete due to null BaseView
2023-09-10 14:25:15 -04:00
wandererfan
f3b3e25513 [TD]Allow section line stretch/shrink 2023-08-29 20:44:14 -04:00
wandererfan
ba6365f950 [TD]use original shape for section of section 2023-08-21 20:31:06 -04:00
wandererfan
ba721cb0e4 [TD]Fix section of section 2023-08-20 12:25:12 -04:00
wandererfan
41817c188f [TD]split GeometryObject 2023-08-18 15:18:42 -04:00
wandererfan
08237b6c2c [TD]remove unused code dvp & sections 2023-08-10 10:17:22 -04:00
Benjamin Bræstrup Sayoc
da2ae719f2 [Everywhere] FileInfo::hasExtension for multiple values (#9774)
* [Base] Add hasExtension for multiple values

* [Gui] Use hasExtension for multiple values

* [Drawing] Use hasExtension for multiple values

* [Fem] Use hasExtension for multiple values

* [Import] Use hasExtension for multiple values

* [Mesh] Use hasExtension for multiple values

* [Part] Use hasExtension for multiple values

* [TechDraw] Use hasExtension for multiple values
2023-08-07 09:55:19 -06:00
wandererfan
c6a244ee71 [TD]warn on skewed ComplexSection profile 2023-06-18 19:02:18 -04:00
Benjamin Bræstrup Sayoc
a93060c6b9 [TechDraw] Simplify return logic
Normal warmup
2023-04-11 13:49:57 -04:00
Benjamin Bræstrup Sayoc
3794897699 [TechDraw] Simplify return logic 2023-04-10 23:34:05 -04:00
Benjamin Bræstrup Sayoc
5d05acc87e [TechDraw] Simplify retrievement of user preferences
for all TechDraw files
2023-04-10 23:34:05 -04:00
Benjamin Bræstrup Sayoc
2f193bbc0e [TechDraw] Improve readability of DrawViewSection.cpp 2023-04-05 19:19:52 -04:00
wmayer
16e27eecc7 TD: port to Qt6
* in QtConcurrent::run the order of 1st and 2nd argument are swapped
* QtConcurrent::run asserts that the argument of the passed function pointer is not non-const
* Used methods of QFontDatabase are static in Qt5 and Qt6
* QTextStream::setCodec() has been removed in Qt6
* Argument of enterEvent() has changed from QEvent to QEnterEvent
* QTextCharFormat::setFamily() is deprecated
2023-03-16 09:17:39 -04:00
wandererfan
b6754947f1 [TD]use correct shape for section of section 2023-02-02 05:55:32 -08:00
wandererfan
86d0975b2c [TD]fix handling of perforated section faces 2023-02-02 05:55:32 -08:00
wandererfan
437457e996 [TD]remove obsolete log messages 2023-01-13 12:15:33 -05:00
wandererfan
100d4956c8 [TD]detail of rotated ComplexSection 2022-12-18 09:42:42 -05:00
wandererfan
02386e3150 [TD]move makeAlignedPieces to separate thread
- correct ComplexSection rotation

- fix fail to load CS for some profiles and directions
2022-12-18 09:42:42 -05:00
wandererfan
6cc849fb73 [TD]allow rotation of hatch directions
- faces can have their svg and bitmap hatches rotated to match
  the view rotation or special situations
- section cut face can have svg hatch rotated
2022-12-03 15:15:25 -05:00
wandererfan
356faf94da [TD]prevent Complex Section with no Base View 2022-11-14 19:41:12 -05:00
wandererfan
33bee19d81 [TD]add section line marks for simple section 2022-11-14 19:41:12 -05:00
wandererfan
edf7d93188 [TD]simplify section hatch file handling 2022-11-12 11:35:22 -05:00
wandererfan
9a07c52aff [TD]fix XDirection rotation of simple sections 2022-11-10 19:19:22 -05:00
wandererfan
9b4b91ede4 [TD]fix rotation of complex section 2022-11-09 10:05:23 -05:00
wandererfan
76f92e8568 [TD]fix rotation of cut face hatch 2022-11-09 10:05:23 -05:00
wandererfan
67ec157e59 [TD]Prevent ComplexSection creation without valid direction 2022-11-07 07:57:37 -05:00
wandererfan
87cc3fe864 [TD]SectionView/ComplexSection - preview, direction selection
- add preview/live update to TaskSectionView & TaskComplexSection
- add view direction selector to uis
- use SectionNormal as Direction.  Make Direction read-only
- simplify section line end point calculation
- section group command in toolbar
- make section and complex section icons consistent
- fix compsolid cutting tool
- terminology: single/piecewise to offset/aligned
2022-10-28 08:47:45 -04:00
wandererfan
0ff473a9b6 [TD]Complex Section - initial implementation 2022-10-28 08:47:45 -04:00
Uwe
909e4f2dd3 [TD] DrawView*: remove unused includes - part 2
- also sort includes
- also additions to precompiled header
2022-10-08 02:10:26 +02:00
wandererfan
aa2b1b8392 [TD]CI clang warnings 2022-09-05 17:48:38 -04:00
wandererfan
c0d69f7d8e [TD]replace GeometryObject only after all changes are done 2022-08-28 15:52:23 -04:00
wandererfan
67ce559bc5 [TD]clazy warning re 3 parameter QObject::connect 2022-08-28 15:52:23 -04:00
Wanderer Fan
0a58649409 [TD]use Label in waiting for thread message 2022-08-21 21:18:26 -04:00
Wanderer Fan
81949d0817 [TD]use new style QObject::connect 2022-08-21 21:18:26 -04:00
Wanderer Fan
e80c42e8f1 [TD]code review changes for dvp, dvs 2022-08-18 19:43:04 -04:00
Wanderer Fan
6f646a8d2d [TD]prevent running threads on object delete 2022-08-18 09:34:32 -04:00
Wanderer Fan
e97b95341a [TD]code clean ups
- QtConcurrent include and CMake for Win

- include clean up dvp, dvs, dvd

- variable names and nested if clean up

- remove debug code
2022-08-18 09:34:32 -04:00
Wanderer Fan
2483b1524e [TD]fix detail of section not displayed on restore 2022-08-18 09:34:32 -04:00
Wanderer Fan
80d5e9a0b8 [TD]respect AutoDistribute on load 2022-08-18 09:34:32 -04:00
Wanderer Fan
2c19c29d3c [TD]move section cut and detail common to thread 2022-08-18 09:34:32 -04:00
Wanderer Fan
5a92b30f17 [TD]run hlr and extractFaces in threads 2022-08-18 09:34:32 -04:00