Commit Graph

96 Commits

Author SHA1 Message Date
wmayer
c3837a9849 Part: Handle exception in Feature::setMaterialAppearance 2024-11-09 10:23:17 -05:00
Eric Price
b7306d29e3 fix #17578 - RIP bgbsww , don't worry, we got this. 2024-10-30 18:11:43 -05: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
David Carter
0804d80ebf Materials: Child ignoring parent material
Inherit the material from the parent object when creating a new object,
such as during a boolean operation, or when extruding a sketch.

fixes #15503
2024-10-21 18:20:20 +02:00
bgbsww
ecf7e51ab3 Toponaming: Remove all FC_USE_TNP_FIX protected old code 2024-08-26 11:12:48 -05:00
bgbsww
80045d0e88 Toponaming: add code to implement guessing missing references 2024-08-05 11:01:46 -05:00
Zheng, Lei
f6494bdf05 Toponaming: Bring in composite shapes for findSubshapesWithSharedVertex ( searchSubShape ) 2024-07-22 12:51:25 -04:00
bgbsww
0bddc51805 Refactor all element name pairs into clearer struct names - renames 2024-07-20 16:32:12 -04:00
bgbsww
159c811bce Toponaming: refactor getExportElementName to separate method 2024-07-19 10:19:57 -04:00
pre-commit-ci[bot]
54920e6611 Review cleanups 2024-06-28 11:57:43 -05:00
bgbsww
a674729dd3 Toponaming: Cleanups 2024-06-28 11:57:43 -05:00
Zheng, Lei
7a4bc95d47 Toponaming: Transfer in missing Code for BaseFeatures and Sketches 2024-06-28 11:57:43 -05:00
Chris Hennes
1b0dba3241 Merge pull request #13906 from Rexbas/align-camera
Align camera to faces and edges
2024-05-20 11:28:24 -05:00
bgbsww
2657bbee4d Minor test tweaks, and small fixes to pass tests 2024-05-17 19:14:01 -05:00
bgbsww
b72a8c4222 Toponaming: Bring in Chamfer, Fillet code and add tests (#14035)
* Toponaming: bring in missing code fragments in Sketcher

* Toponaming: Fix infinite recursion, remove debug cruft, rough in fillet test

* Bring in missing code; fix chamfers

* Toponaming: Add code for fillets and test
2024-05-15 19:43:30 -04:00
Bas Ruigrok
fb1539f48e Part: Implement getCameraAlignmentDirection() for PartFeature
Returns normal of a face or direction of an edge
2024-05-13 19:03:56 +02:00
bgbsww
84ae6b9b7b Toponaming: bring in missing code fragments in Part 2024-05-12 23:08:06 -04:00
bgbsww
71d96bccac Fix tests, slip in TNP defense 2024-05-07 13:42:21 -04:00
bgbsww
fa8f29aed4 Toponaming/Part: Fix all getBaseTopoShape calls. Tests and missing code. 2024-04-26 21:15:11 -05:00
bgbsww
a4dd600ec6 Toponaming/Part: Fix hashing, hasher mismatches, and adjust test results to match 2024-04-15 23:00:27 -05:00
bgbsww
c9d8bdf13d Toponaming/Part: Add deprecation comments, clean up code 2024-04-09 21:17:08 -04:00
Zheng, Lei
82c3e107d7 TopoShape/Part: Bring in PartDesign dependencies 2024-04-09 21:17:08 -04:00
David Carter
495a96a0f5 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
wmayer
d92267c6a7 Fix several compiler warnings
* fix -Winconsistent-missing-override
* fix -Wunused-but-set-variable
* fix -Wunused-parameter
* fix -Wunused-lambda-capture
* fix -Wunused-private-field
* fix -Wpessimizing-move
2024-04-03 10:04:56 +02:00
Zheng, Lei
4f3d23fe98 Toposhape/Part: Transfer in FeatureFillet, FeatureChamfer and dependencies 2024-03-18 22:05:25 -04:00
luzpaz
5839134e95 Fix various typos throughout the codebase (#13029)
* Fix various typos throughout the codebase

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-18 16:54:30 -05:00
bgbsww
3df25821e5 Toposhape/Part:: Fix, relocate and test element methods in ComplexGeoData and TopoShape 2024-03-07 23:00:48 -05:00
Zheng, Lei
ae5c0a6d9c Toposhape/Part: Bring in element methods in FeaturePart, TopoShapePy::Init and TopoShape::GetPyObject 2024-03-07 13:15:40 -05:00
Zheng, Lei
32b68b6125 Part/Toponaming: Transfer PartFeature Feature::create()
* Imported Feature::create() method in Part::Feature class
2024-03-02 09:41:36 +01:00
bgbsww
7d0afaec54 Toposhape/Part: cleanup and test getElementName 2024-02-28 17:07:36 -05:00
Zheng, Lei
59b563ca69 Toponaming/Part: trasnfer in getElementName 2024-02-28 17:06:09 -05:00
André Caldas
560898907b Avoids using getNameInDocument() to test if DocumentObject is attached to a Document.
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.

The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).

Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".

The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
2023-12-11 17:37:58 +01:00
wmayer
a0d86224f3 Part: modernize C++: use equals default 2023-08-22 15:14:03 +02:00
wmayer
0d854a56cd Part: modernize C++: return braced init list 2023-08-19 11:35:41 +02:00
wmayer
312975edba Part: modernize C++: use range-based for loop 2023-08-16 21:56:32 -05:00
wmayer
d150fa7164 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
68d22d864b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
Abdullah Tahiri
7633b3ce93 Unused variable 2023-06-29 23:42:28 +02:00
Pesc0
4a8d3853ba [Toponaming] create ElementMap class (#9175)
* Copypaste ElementMap
* Add MappedNameRef
* Fix missing include
* Copypaste `findTagInElementName`
* fix error introduced _somewhere_
* refactor toponaming constants
* Move `findTagInElementName` in `MappedName`
* reintroduce workaround to compile ElementMap
* Added missing functions copied from complexgeodata
* fix last compile errors, reorder and format files
* remove recursive refs to ComplexGeoData
* Add more comments
* fixed comments and added tests
* added FIXME, make functions private, misc fixes
* Move static functions from complexGeoData to PostfixStringReferences. Rename to ElementNamingUtils
* Fix broken includes due to previous change
* Revert constants from string to const char*
* added childmap tests and made hasher public
* Make functions private
* Added remaining tests
* removed bool return from `erase` functions
* fix missing appexport

Co-authored-by: John Dupuy <jdupuy98@gmail.com>
2023-06-15 09:05:24 -05:00
luzpaz
129d5882a7 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
Andrew
b916c387fb Clean Mod/Part. remove old OCC <7.3 and #if 0 code. 2023-03-26 21:17:18 +02:00
wmayer
d196f8c496 Mod: catch exception raised by Rotation::setValue 2023-03-01 18:43:15 +01:00
luz paz
6e542b6fad Part: remove trailing whitespace 2022-11-15 14:19:30 -06:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
b796a0d376 Mod: use empty 2022-08-06 19:30:13 +02:00
Uwe
88a06f8f10 Mod: remove some unnecessary nullptr checks 2022-07-18 12:58:12 +02:00
wmayer
70a5faf327 Part: fix build failure 2022-07-04 02:21:59 +02:00
Uwe
6fb7f614c7 [Part] Pa* to Pre*: remove unneeded includes
- also sort includes
2022-07-03 20:47:03 +02:00
andrea
93525ff7eb removed references to OCC<7 2022-06-25 14:29:24 +02:00
wmayer
5234d9bc67 App: add pure virtual methods to PropertyGeometry to delegate it to the geometry of sub-classes
Following the law of Demeter add some wrapper methods to PropertyGeometry and implement them in sub-classes. As a side-effect this makes some const_cast obsolete
2022-06-24 16:15:02 +02:00