Commit Graph

271 Commits

Author SHA1 Message Date
wmayer
6500a872eb Part: Improve TopoShape::findPlane
Since OCC 7.7 using GeomLib_IsPlanarSurface without a custom tolerance may fail because the default value is too strict.
To fix this problem forward the passed tolerance value to GeomLib_IsPlanarSurface.

This fixes issue 20633
2025-08-31 14:27:09 +02:00
Kacper Donat
7f87d87f61 PartDesign: Add transparent previews 2025-08-07 00:37:21 +02:00
Joao Matos
39efc8ec0f Part: Add OCCT progress support to Part boolean and shape builders
Introduce a `Build(const Message_ProgressRange&)` overload in
`FCBRepAlgoAPI_BooleanOperation` (guarded by `OCC_VERSION_HEX <
0x070600`) and route user-abort checks around the operation. Add a new
`OCCTProgressIndicator` adapter (`OCCTProgressIndicator.h`) that bridges
`Message_ProgressIndicator` to `Base::ProgressIndicator`. Include
`OCCTProgressIndicator.h` where needed and update all `Build()` calls in
`TopoShape` and `TopoShapeExpansion` to pass
`OCCTProgressIndicator().Start()`, enabling singleton-based progress
reporting and user-break handling.
2025-05-30 18:25:32 +01:00
Andrea
81097bbaf1 Remove oldFuse funcion
oldFuse is deprecated since OCC 7.3
2025-05-19 18:21:07 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Benjamin Nauck
aad5e58955 Part: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
mosfet80
3dd7a1cc52 Remove support to oldest occ <7.5 (#20084)
* remove support to oldest occ <7.5

The  os ubuntu 22.04 not supported use occ 7.5.1.
There is a lot of code implemented to support even older versions.
The patch removes support for versions lower than occ 7.5.0

* .

* move include library

#pieterhijma  change request :

* removed deprecated functions

get/setAngle functions has been removed with OCC 7.5
2025-03-21 13:06:47 +01:00
Chris Hennes
7f1c43a335 Merge pull request #19636 from kadet1090/color-in-base
Base: Move App::Color to Base
2025-03-02 16:36:40 -06:00
Andrew
0aed23ca81 fixes #19582 Sketcher - cannot project BSpline from another sketch (#19700)
Also fixes some other types of external geo

---------

Co-authored-by: Andrew Shkolik <andrew.shkolik@selerix.com>
Co-authored-by: realthunder <realthunder.dev@gmail.com>
2025-02-24 10:17:24 -06:00
Kacper Donat
a72a63232a Base: Move App::Color to Base
Every basic data type is stored in Base module, color is standing out as
one that does not. Moving it to Base opens possibilities to integrate it
better with the rest of FreeCAD.
2025-02-17 21:10:26 +01:00
Eric Price
7680872e41 increase tolerance on helical shapes to avoid crash / broken geometry (#17356)
* increase tolerance on helical shapes to avoid crash

fix #17113
fix #9377
fix #11083

* added test cases for additive and subtractive helix

* fixed whitespace issue, reduced turncount for speed

* relaxed large scale testcases for OCCT 7.3 and below, work around windows CI error #17394

* Further reduce max size in test for buggy Ubuntu OCCT
2024-11-11 17:44:27 +01:00
wmayer
a614b44fcd Fix compiler warning [-Wmisleading-indentation] 2024-10-22 22:57:29 -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
bgbsww
2a541c9536 Toponaming: Remove remaining FC_USE_TNP_FIX defines 2024-08-31 13:21:10 -05:00
bgbsww
ecf7e51ab3 Toponaming: Remove all FC_USE_TNP_FIX protected old code 2024-08-26 11:12:48 -05:00
bgbsww
3c3709cb5d Toponaming: Fix save and restore of elementmaps 2024-06-23 23:33:12 -04:00
Jolbas
0290a8759a Part: Handle zero scale in TopoShape::_makeTransform
With this commit the TopoShape::_makeTransform() use makeGTransform() if scale is zero to avoid crash. Fixes #14562
2024-06-17 11:17:27 -05:00
bgbsww
2657bbee4d Minor test tweaks, and small fixes to pass tests 2024-05-17 19:14:01 -05:00
wmayer
56f84c8042 Fix various compiler warnings:
* fix -Wunused-parameter
* fix -Wunused-function
* fix -Wunused-private-field
* fix -Wunused-variable
* fix -Winconsistent-missing-override
2024-04-30 16:59:31 +02:00
Zheng, Lei
6c6dce236d Bring in missing code 2024-04-11 18:20:26 -04:00
bgbsww
28cb508489 Toposhape/Part: Cleanup FeatureFillet, FeatureChamfer and dependencies 2024-03-19 11:10:18 -04:00
bgbsww
93e823da30 Toposhape/Part: clean and add tests 2024-03-17 10:24:58 -04:00
Zheng, Lei
a9e99b1667 Toponaming/Part: Bring over attacher differences 2024-03-15 08:11:26 -04: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
wmayer
0d37ea2629 Part: Add class BRepMesh
This refactors the code of TopoShape::getFacesFromDomains and the the private class BrepMesh of the MeshPart module
to reduce code duplication.
2024-03-06 07:20:39 +01:00
Zheng, Lei
5e532494ca Toposhape/Part: element methods in ComplexGeoData and TopoShape 2024-03-04 17:16:59 -05:00
Chris Hennes
a4efcf0533 Toponaming/Part: Clang-format cleanup 2024-02-28 19:18:45 -06:00
Zheng, Lei
59b563ca69 Toponaming/Part: trasnfer in getElementName 2024-02-28 17:06:09 -05:00
mos
a025af2d26 removed deprecaded functions
.

.
2024-02-26 17:38:01 +01:00
bgbsww
d7f14d3df5 Bring in = operator, resetMap and flushMap overrides, and fix affected tests 2024-02-21 12:13:16 -05:00
Zheng, Lei
99808e9ef2 Toponaming/Part: transfer in and clean getSubShapes, getSubTopoShapes, getOrderedEdges 2024-02-17 18:06:56 -05:00
Chris Hennes
d89f4d7f29 Merge pull request #12366 from bgbsww/bgbsww-toponamingGetSubTopoShape
Toponaming/Part:  Move getSubTopoShape
2024-02-13 14:09:24 -06:00
bgbsww
ae4393978f Toponaming/Part: clean, doc, and test getSubTopoShape 2024-02-13 10:14:39 -05:00
wmayer
ad605d6e23 Mesh: fixes #11985: 3MF export to Prusa with clone = open edge warnings on clone
See https://forum.freecad.org/viewtopic.php?p=738731#p738731
2024-02-12 11:40:45 -06:00
CalligaroV
3066f74747 Part/Toponaming: makeElementWires
* Renamed enum classes members to lowercaseCapword
 * Moved struct ShapeHasher back to TopoShapeMapper.h
 * Added test for MapperMaker::generated
 * Modifications for clang-tidy warnings
 * Formatting

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-02-08 13:56:30 +01:00
CalligaroV
d9d6ae825e Merge branch 'main' of https://github.com/FreeCAD/FreeCAD.git into toponamingTopoShapeWire
# Conflicts:
#	src/Mod/Part/App/TopoShape.h
#	src/Mod/Part/App/TopoShapeExpansion.cpp
2024-02-07 23:51:49 +01:00
bgbsww
46230c9a93 Add Test for MakeElementRefine 2024-02-06 15:58:37 -05:00
Vincenzo Calligaro
e6004ff6c9 Toponaming shapeprotector Nullify() check (#12177)
* Moved the check inside the Nullify() method.

---------

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-01-31 17:36:30 +01:00
CalligaroV
71e42f6a53 Merge branch 'main' into toponamingTopoShapeWire
# Conflicts:
#	src/Mod/Part/App/TopoShape.h
#	src/Mod/Part/App/TopoShapeExpansion.cpp
#	tests/src/Mod/Part/App/TopoShapeExpansion.cpp

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-01-29 19:41:56 +01:00
Chris Hennes
0e179297bd Interim commit 2024-01-15 19:13:33 -06:00
Chris Hennes
1a9f2716d2 Part/Toponaming: Merge makECopy from Toponaming 2024-01-15 19:07:18 -06:00
Chris Hennes
5088c63935 Part/Toponaming: Modify constructors to set owner of ShapeProtector 2024-01-12 10:00:45 -06:00
Chris Hennes
aaa0db3867 Merge pull request #11231 from DeflateAwning/http-cleanup
Find and replace http://freecad to https://freecad
2023-11-06 11:16:13 -06:00
DeflateAwning
8de6db3e97 Find and replace http://freecad.org to https://freecad.org
Find and replace:
http:\/\/(.{0,10})freecad
https://$1freecad
Done in all remaining files (after doing it in SVGs in the last commit)
2023-10-29 22:39:22 -06:00
Florian Foinant-Willig
eb55f1fe52 Part: modernize type checking 2023-10-23 18:12:03 +02:00
luzpaz
9ed299a57a Fix typos 2023-08-31 22:29:17 -05:00
wmayer
423cc42ac8 Tests: add unit tests for:
* TopoShape::getElementTypeAndIndex
* ComplexGeoData::getTypeAndIndex

and fix crashes there when passing a null pointer
2023-08-25 19:23:18 +02:00
wmayer
f6d1fe1ab3 Part: refactor ViewProviderPartExt::getDetail 2023-08-25 19:23:18 +02: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