Commit Graph

543 Commits

Author SHA1 Message Date
Jacob Oursland
960f4e4d63 CMake: Add missing target_link_directories() for OCCT. 2024-11-26 16:03:08 -05:00
Chris Hennes
f24c7da793 Spreadsheet: Add C++ test framework 2024-11-25 23:09:35 -06:00
wmayer
b1f3fe9115 Tests: Add unit test for PR #16763 2024-11-22 12:05:30 +01:00
wmayer
10e9d09763 Tests: Add unit test for PR #16576 2024-11-22 12:02:30 +01:00
wmayer
4a4618f7d7 Tests: Add unit test to explore a null shape 2024-11-22 10:52:45 +01:00
wmayer
3c1bf8e864 Core: Extend Color API
* Fix issues with alpha value <> transparency
* Use type traits to convert between different color classes (fixes #14515)
2024-11-15 12:25:25 -05:00
Eric Price
44305ffc89 Part: bugfix #17468 recursively unpack compounds for boolean fuse (#17469)
* fix #17468  recursively unpack compounds for boolean fuse

* fix and into &&, add ctest case for multifuse with compounds and recursive compounds

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

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

* remove unneeded duplicated code - allow Part::Common to be created with a single object (compound or shape) - will result in Unity and possibly a warning message

* prevent endless loop in case of endless recursive compounds as suggested in chat

* Update src/Mod/Part/App/FeaturePartFuse.cpp

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>

* implemented suggestion by wwmayer

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2024-11-11 17:51:56 +01:00
wmayer
6f36a2124f Test: Add unit test for pad 2024-10-26 15:39:04 +02:00
wmayer
d5a9a8ae38 Test: Add test for MeasureDistance with two circles 2024-10-23 23:07:49 +02: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
Kris Wilk
d1c04fd193 Prevent using reserved names for properties or aliases (Fix #16846) (#16902)
* Prevent naming properties with reserved words (Fix #16846)

* Prevent using reserved constant names for properties or aliases

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

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

* App: Add unit test for isTokenAConstant

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-10-03 10:03:10 -05:00
huguesdpdn-aerospace
611bab3d6d PD: Xerces-C++ - Prepare for the latest version (backward compatible) 2024-09-08 20:31:25 -05:00
bgbsww
891f012264 Fix #16013 (#16090)
* Fix #16013

* Fix #16013
2024-09-02 18:00:47 +02:00
bgbsww
608c80b5a3 Toponaming: Remove remaining FC_USE_TNP_FIX defines 2024-08-31 13:21:10 -05:00
bgbsww
e4a509cc77 Toponaming: Remove all FC_USE_TNP_FIX protected old code 2024-08-26 11:12:48 -05:00
pre-commit-ci[bot]
09386be6a9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-08-25 07:29:42 +00:00
CalligaroV
c8e1bea243 Part/Toponaming: use TopoShape::getShape() in PartFeatures.cpp tests and TopoShapeMakeElementRefine.cpp tests
* Replace TopoShape::getValue() with TopoShape::getShape() to test the size of element maps
 * Update the expected values

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-08-24 19:54:33 -05:00
bgbsww
cb3df1d59c Toponaming: Fuse call makeElementRefine; remove deprecated refineSha… (#15897)
* Toponaming:  Fuse call makeElementRefine; remove deprecated refineShapeIfActive
* Part/Toponaming: import code for MultiFuse::execute() from LS3
* added expected values of testRefine

Co-authored-by: Zheng, Lei <realthunder.dev@gmail.com>
Co-authored-by: CalligaroV <vincenzo.calligaro@gmail.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-08-18 11:49:05 -05:00
bgbsww
0ab5887fe1 Toponaming: Missing shape hasher line; fixed cleaned Transformed 2024-08-13 07:07:59 -04:00
bgbsww
8b25341a7f Toponaming: Touchup cleanup
Includes some header re-ordering from chennes.
2024-07-26 21:39:39 -05:00
bgbsww
9f2210313d Toponaming: Tests, cleanup, and fix axis drawing 2024-07-26 11:49:56 -04:00
wmayer
6d8b9b0204 MSVC: Suppress warning 2024-07-25 20:34:52 +02:00
wmayer
dd1c4e84f0 MSVC: Fix compiler warning 2024-07-25 20:08:10 +02:00
bgbsww
077f3b3ab4 Toponaming: Clean code, apply remark recommendations and Tweak tests 2024-07-22 12:55:23 -04:00
Chris Hennes
dde1a3511b Merge pull request #15521 from bgbsww/bgbsww-toponamingSaveRestore1plus
Throw exceptions rather than return default 0
2024-07-22 10:46:53 -05:00
wmayer
b3680522f3 Tests: Add tests for MeshPart 2024-07-22 00:06:23 -05:00
bgbsww
19e450a667 Refactor all element name pairs into clearer struct names - renames 2024-07-20 16:32:12 -04:00
bgbsww
81352f785d Throw exceptions rather than return default 0 2024-07-19 09:09:59 -04:00
bgbsww
4e0f64f57a Throw exceptions rather than return default 0 2024-07-19 08:59:25 -04:00
wmayer
da83986fba Tests: Fix warnings: unknown pragma ignored [-Wunknown-pragmas] 2024-07-12 21:53:53 +02:00
bgbsww
dc9849bdb7 Toponaming: Add missing TNP element name code; rough in more TNP tests (#14561)
* Add missing TNP element name code; rough in more TNP tests

* Update ElementNamingUtils.cpp

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-07-08 18:43:42 -05:00
Chris Hennes
e371f7fb43 Merge pull request #14461 from AjinkyaDahale/sk-fix-12592-bsp-by-knot-trim
[Part][Sketcher] Fix some B-spline trimming issues
2024-07-01 11:28:50 -05:00
CalligaroV
5a9828426d Part/Toponaming: makeElementWires
* Updated tests

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-06-26 10:46:36 -05:00
Ajinkya Dahale
e1c3dd2fea [Part][test] Add tests for GeomBSplineCurve::Trim() 2024-06-24 21:56:58 +05:30
Chris Hennes
5e47f6804f Update for LibPack3 (#10337)
* cMake: Add base support for LibPack3

Minor changes to FreeCAD source code to support compiling with Qt 6.5 on MSVC,
and changes to cMake setup to support the new Libpack.

* NETGENPlugin: Fix compilation with MSVC and OCCT 7.8

* Material: Switch to Wrapped_ParseTupleAndKeywords for /fpermissive- on MSVC

* Base: Prevent accidental definition of MIN and MAX by MSVC

* cMake: Prevent accidentally finding an old LibPack

* Material: Wrap another ParseTuple call

* OCCT: Modify includes for 7.8.x

* Part: Change TNP code to use Wrapped_ParseTupleAndArgs

* Spreadsheet: Workaround for MSVC macro pollution

* Mesh: Workaround for MSVC macro pollution

* Base: Remove extra MSVC flag (moved to CMake)

* Tests: Fix compiling with /permissive-

* FEM: Fix Qt warnings about duplicate element names

* cMake: Ensure major version numbers are set

* Address review comments.

* cMake: Further tweaks for LibPack3

* cMake: Modify specification of compiler flags for MSVC

* Main: Remove QtQuick testing code

* cmake: Find Boost before SMESH (which uses it)

* Fixes for LibPack2

* cMake: Another try at importinhg VTK cleanly
2024-06-24 18:25:05 +02:00
wmayer
1a84404515 MSVC: Fix compiler warnings
* avoid redefines in Assembly
* explicit cast from size_t to int
* remove unused variables
* avoid implicit cast from double to float
* in test cases replace EXPECT_FLOAT_EQ with EXPECT_DOUBLE_EQ or EXPECT_NEAR when doubles are used
2024-06-20 15:42:16 -05:00
Mihail Dumitrescu
0346c94b50 Add ParallelPlane attachment mode.
It results in an attachment similar to ObjectXY but with the XY plane translated to pass through a selected vertex.

It is most useful to place sketches: pick a plane (XY, XZ, YZ) or another sketch then select a vertex to automatically translate the sketch in the Z-direction. In contrast to the Translate mode it does not change the origin.
2024-06-10 10:47:00 -05:00
wmayer
526cc024ad Part: Add AttacherEngine of type PropertyEnumeration
This is added to conveniently change the attacher type of a Part object.

Hint: A new property is used to avoid to break project files when opening it with an older version.

See also forum thread: https://forum.freecad.org/viewtopic.php?t=87891
2024-06-03 11:24:09 -05:00
Chris Hennes
c622221c70 Test: Support system GTest, and give warning if no submodule (#13662) 2024-06-03 10:40:35 -05:00
wmayer
0490c0195a tests: Add unit tests for getElementTypes() 2024-05-31 11:42:01 +02:00
David Carter
c5df1b3e55 Materials: Editor UI enhancements
When creating a new material, assigning the basic
rendering model to the material resulted in an all
black color. This will now be assigned the default
color as specified in the preferences.

The name of the material Properties tab has been
changed to Physical for improved consistency in
the user interface.
2024-05-27 11:35:00 -05:00
David Carter
a0fdc86948 Material: Appearance and Material inspectors
Dialogs to view the Appearance and Material properties of an object

These inspectors are intended to be used when debugging Appearance and
Material issues in a model.

The Appearance inspector displays the appearance properties of an
object. This will be more useful once PR 13792 is merged which migrates
parts to use ShapeAppearance instead of DiffuseColor. This shows each
of the appearance properties per face for the object.

The Material inspector shows the material, models, and properties
assigned to a model. It displays useful debugging information such as
the UUID and file paths associated with eacch of the items. This is
useful when finding and resolving model conflicts.

The material inspector now gives the option of copying the information
to the clipboard.
2024-05-27 10:50:35 -05:00
Chris Hennes
5dadd2c3c3 Toponaming: Test fixes 2024-05-20 12:40:52 -05:00
David Carter
ed01d5cffa Material: Material API fixes
Corrects an issue in the API where a new material may not have a UUID.
Corrected the test case to reflect the changes and better document the
process.

Added a test case for material filters.
2024-05-20 10:43:02 -05:00
bgbsww
e50ef22e7b Minor test tweaks, and small fixes to pass tests 2024-05-17 19:14:01 -05:00
bgbsww
80d43f51a1 Simplify offset tests 2024-05-17 08:10:43 -04:00
ppphp
7096125038 fix some warnings: cmake string quotes and float mark (#13909)
Co-authored-by: liukaiwen <kaiwen.liu@zixel.cn>
2024-05-13 11:55:59 -04:00
bgbsww
d3c5df86ee Toponaming: bring in missing code fragments in Part 2024-05-12 23:08:06 -04:00
bgbsww
5054cace46 Rework makeElementChamfer to match current parms, and add PartDesign code for Chamfers 2024-05-12 13:28:20 -05:00
bgbsww
9fc744fbe3 Fix tests, slip in TNP defense 2024-05-07 13:42:21 -04:00