Commit Graph

159 Commits

Author SHA1 Message Date
Benjamin Bræstrup Sayoc 1d7e7c86a0 [TechDraw] Use templates instead of duplicate code: toGp 2025-02-08 22:35:57 +01:00
Eric Price cf8ad66373 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 e852052df8 [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 48f43429bb TechDraw: Enable snapping section views to their base views. 2024-05-27 11:44:31 -04:00
wandererfan c7ecfcee43 [TD]fix no PAT hatch on first paint 2024-03-23 08:47:36 -04:00
wandererfan e5ae85e8fd [TD]protect against stretch factor == 0 2024-01-20 18:58:55 -05:00
wandererfan 9cb4745f38 [TD]handle loose geometry via HLR 2023-12-03 08:55:59 -05:00
Florian Foinant-Willig 24352a7f4c TechDraw: modernize type checking 2023-10-23 18:08:59 +02:00
André Caldas 695a314229 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 be74909b9a [TD]fix fail on section delete
- fails in onChange during delete due to null BaseView
2023-09-10 14:25:15 -04:00
wandererfan fdd3a8d2cf [TD]Allow section line stretch/shrink 2023-08-29 20:44:14 -04:00
wandererfan 9c1bc2e0e9 [TD]use original shape for section of section 2023-08-21 20:31:06 -04:00
wandererfan 44c40067b2 [TD]Fix section of section 2023-08-20 12:25:12 -04:00
wandererfan 3e164a5700 [TD]split GeometryObject 2023-08-18 15:18:42 -04:00
wandererfan d087a8fea4 [TD]remove unused code dvp & sections 2023-08-10 10:17:22 -04:00
Benjamin Bræstrup Sayoc 33384cff9c [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 fe39810d89 [TD]warn on skewed ComplexSection profile 2023-06-18 19:02:18 -04:00
Benjamin Bræstrup Sayoc 3f81006ac4 [TechDraw] Simplify return logic
Normal warmup
2023-04-11 13:49:57 -04:00
Benjamin Bræstrup Sayoc ef5fc4f237 [TechDraw] Simplify return logic 2023-04-10 23:34:05 -04:00
Benjamin Bræstrup Sayoc 15fe52a04b [TechDraw] Simplify retrievement of user preferences
for all TechDraw files
2023-04-10 23:34:05 -04:00
Benjamin Bræstrup Sayoc 466b167443 [TechDraw] Improve readability of DrawViewSection.cpp 2023-04-05 19:19:52 -04:00
wmayer a9694e1878 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 951520a5c1 [TD]use correct shape for section of section 2023-02-02 05:55:32 -08:00
wandererfan bd25c86973 [TD]fix handling of perforated section faces 2023-02-02 05:55:32 -08:00
wandererfan 12db3618df [TD]remove obsolete log messages 2023-01-13 12:15:33 -05:00
wandererfan 47ef35047b [TD]detail of rotated ComplexSection 2022-12-18 09:42:42 -05:00
wandererfan 23dc64365b [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 276e6c45b9 [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 0c83a17ce8 [TD]prevent Complex Section with no Base View 2022-11-14 19:41:12 -05:00
wandererfan 26d7fe14e1 [TD]add section line marks for simple section 2022-11-14 19:41:12 -05:00
wandererfan fe4a402b04 [TD]simplify section hatch file handling 2022-11-12 11:35:22 -05:00
wandererfan 1a9637a384 [TD]fix XDirection rotation of simple sections 2022-11-10 19:19:22 -05:00
wandererfan eb407feb60 [TD]fix rotation of complex section 2022-11-09 10:05:23 -05:00
wandererfan 5cedb9ea4e [TD]fix rotation of cut face hatch 2022-11-09 10:05:23 -05:00
wandererfan c5a263bdd8 [TD]Prevent ComplexSection creation without valid direction 2022-11-07 07:57:37 -05:00
wandererfan 99f67b8a40 [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 5ddc6ce789 [TD]Complex Section - initial implementation 2022-10-28 08:47:45 -04:00
Uwe 5dc30b159c [TD] DrawView*: remove unused includes - part 2
- also sort includes
- also additions to precompiled header
2022-10-08 02:10:26 +02:00
wandererfan acf17905ed [TD]CI clang warnings 2022-09-05 17:48:38 -04:00
wandererfan 4310b49a8b [TD]replace GeometryObject only after all changes are done 2022-08-28 15:52:23 -04:00
wandererfan 4bdbacda75 [TD]clazy warning re 3 parameter QObject::connect 2022-08-28 15:52:23 -04:00
Wanderer Fan 4ad52a5778 [TD]use Label in waiting for thread message 2022-08-21 21:18:26 -04:00
Wanderer Fan 1494b8288a [TD]use new style QObject::connect 2022-08-21 21:18:26 -04:00
Wanderer Fan f9d62da307 [TD]code review changes for dvp, dvs 2022-08-18 19:43:04 -04:00
Wanderer Fan 2d7d882235 [TD]prevent running threads on object delete 2022-08-18 09:34:32 -04:00
Wanderer Fan 74cdc6db61 [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 f12846599d [TD]fix detail of section not displayed on restore 2022-08-18 09:34:32 -04:00
Wanderer Fan 6df801ed96 [TD]respect AutoDistribute on load 2022-08-18 09:34:32 -04:00
Wanderer Fan a2b09d37c5 [TD]move section cut and detail common to thread 2022-08-18 09:34:32 -04:00
Wanderer Fan 7e701969af [TD]run hlr and extractFaces in threads 2022-08-18 09:34:32 -04:00