Commit Graph

70 Commits

Author SHA1 Message Date
tetektoza
145947e6d7 Part: Fix Part_Extrude taper angle regression for internal faces (#26781)
* Part: Fix Part_Extrude taper angle regression for internal faces

The taper angle for holes (inner wires) in `Part_Extrude` was not being
negated after the toponaming refactor, causing internal faces to taper
in the wrong direction compared to v0.21.2.

The original makeDraft function correctly handled inner wires by:
- Negating taper for all inner wires in Part_Extrude
- Negating taper only for multi-edge inner wires in PartDesign
This logic was controlled via an isPartDesign function parameter.

When makeElementDraft was introduced for toponaming support, it was
designed to use innerTaperAngleFwd/innerTaperAngleRev fields that were
never ported from realthunder's branch. The cleanup (commit 709eab3018)
removed references to these non-existent fields, leaving makeElementDraft
with no inner wire taper handling at all.

So, this fix ports the makeDraft inner wire logic to makeElementDraft by
adding the flag, and counting wires and then triggering proper angle
flip depending on the flag/wire situation.

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2026-01-13 05:52:43 +00:00
pre-commit-ci[bot]
9fe130cd73 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
PhoneDroid
db6d1e0c33 [ Part ]: Update SPDX License Identifiers 2025-11-02 16:16:07 -06:00
Markus Reitböck
68114945fa Part: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
 should be considered an optimization, not a requirement. In particular, do not explicitly include a
 precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
 generated precompile header on the compiler command line instead. This is more portable across
 the major compilers and is likely to be easier to maintain. It will also avoid warnings being
 generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-24 20:08:56 +02:00
drwho495
a48cc162cb Part: Fix toponaming issues. (#23151)
* fix split apart and splice

* fix hasher gen issue in extrusion

* fix broken gen in fillet/chamfer

* error when elements go missing in fillet/chamfer

* fix hashing in some elements

* fix compiler errors

* fix sweep

* remove hasher from mirror

* remove old import

* add clarifying comment

* Linter cleanup

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-08-18 01:35:46 +00:00
theo-vt
1a0a68ae69 PartDesign: Fix hole centered on point edge case (#21257)
* Light refactor of getTopoShape function

* Fix hole edge case

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

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

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

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

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

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

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

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

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

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Refactor simplifyCompound()

* Use Base::Flags<GetShapeOption>

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

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

* Shorten enum name and move it from class scope to namespace scope

* [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>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-05-29 22:37:54 +02:00
Benjamin Nauck
21fbf8e539 Use Base::toRadians() instead of manually converting 2025-04-15 07:16:36 +02:00
Benjamin Nauck
075a1362ed Part: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
Benjamin Nauck
6f535f19fb Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
bgbsww
e4a509cc77 Toponaming: Remove all FC_USE_TNP_FIX protected old code 2024-08-26 11:12:48 -05:00
wmayer
8584dd8dff Part: Add FaceMakerMode of type PropertyEnumeration
This is added to conveniently change the face maker type of an extrusion object.

Hint: A new property is used to avoid to break project files when opening it with an older version.
2024-06-03 11:29:01 -05:00
bgbsww
459644be31 TopoShape/Part: Bug fixes; pass Hasher parms, OCCT 7.8 compatibility, ElementMaps correct item count 2024-04-14 13:56:07 -04:00
bgbsww
c75acb2d51 Toponaming/Part: cleanup FeatureExtrusion 2024-03-20 20:45:06 -04:00
Zheng, Lei
946f8e9b0b Toponaming/Part: bring in FeatureExtrusion and dependencies 2024-03-19 17:33:09 -04:00
Chris Hennes
35182c1bb2 Merge branch 'main' into facemakerTranslationFix 2024-02-12 10:45:47 -06:00
Chris Hennes
28ed5dbb39 Part: Fix translation bug in FaceMaker 2024-01-22 12:14:54 -06:00
Zheng, Lei
e425b5b2db Toponaming move makEFace as makeElementFace and dependencies 2024-01-17 20:38:50 -05:00
wmayer
c8abd4a6d4 Part: modernize C++: return braced init list 2023-08-19 11:35:41 +02:00
wmayer
7cb51a4980 Part: modernize C++: use range-based for loop 2023-08-16 21:56:32 -05:00
wmayer
c78e792737 Part: fix build failures with OCC >= 7.6 2022-08-09 18:42:38 +02:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
53ba98d636 Mod: use empty 2022-08-06 19:30:13 +02:00
Uwe
a09833896c [Part] FeatureExtrusion.cpp: add necessary include 2022-07-09 16:20:24 +02:00
Uwe
d58a05dc18 [Part] Feature*: remove unneeded includes
- also sort includes
2022-07-09 15:59:22 +02:00
mwganson
4f300abf32 Part: Link support -- replace TopoShape.getSubShape() with Part::Feature::getTopoShape(obj, elementname, true).getShape() in order to support use of App::Link sublinks. 2022-05-27 03:52:17 +02:00
wmayer
6d2d45ceb7 Part: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
Uwe
f129bd7da7 [Part] FaceMaker, Command and Extrusion: remove unused includes 2022-02-21 03:33:01 +01:00
Uwe
12b0e0dd92 [PD] add option to create tapered Pad / Pocket
This PR adds the same functionality as provided by Part Extrude.
The used code parts are sorted out to a new helper function that is used by Part and PartDesign.
2022-02-02 01:04:06 +01:00
Uwe
fd542ecfce [Part] Extrusion: stop if intermediate shape is Null
besides the error message, we need to raise an error

- also fine-tune the wording
2022-01-31 01:07:33 +01:00
Uwe
341a92f08d [Part] Extrusion: fix logic issue
has actually no influence on the output but is important to understand the logic of the code
2022-01-31 00:23:33 +01:00
Uwe
89e623e1b7 [Part] Extrusion: fix CI compiler warning
fixes "warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int'"
2022-01-30 22:46:07 +01:00
Uwe
729cd4a7c0 [Part] Extrusion: code simplification and documentation
- in order for the pending PR to add tapered padding/pocketing
2022-01-30 19:37:41 +01:00
Uwe
2cad24e303 [Part] Extrusion: handle also complex nested structures
- there can be strange cases with structures all intersecting each other. Their extrusion has no practical use case but we must avoid that such structures results either in an infinite loop or in an invalid geometric result.
2022-01-30 18:43:11 +01:00
Uwe
65bf134d43 [Part] Extrude: fix a thinko introduced by previous commit
- the handling of all inner wires must be done within the recursion
2022-01-30 17:41:40 +01:00
Uwe
aa48c2ea44 [Part] Extrusion: simplify code by using full recursion
- the recursion can be done completely by one void
- also add a brief description of this void
2022-01-30 16:53:44 +01:00
Uwe
a3944b8553 [Part] Extrusion: code optimizations
kudos to @marioalexis84
2022-01-30 06:02:37 +01:00
Uwe
b339cd4624 [Part] Extrusion: taper nested wires properly
addendum to commit 2d6bcba90

Now also wires nested by more than one level are supported.
The possible nesting is infinite.
2022-01-30 05:52:43 +01:00
Uwe
23c1fb78bf [Part] Extrude: remove unused variable 2022-01-29 23:18:11 +01:00
Uwe
f061a2cd82 [Part] handle inner wires for Extrude (#5367)
* [Part] handle inner wires for Extrude

this is a PR to make Extrude handle inner wires of sketches.
2022-01-29 21:50:55 +01:00
luz paz
501a5e88c0 Part: fix source comment typo 2022-01-22 16:28:41 +01:00
Uwe
9c828d6efd [Part] Extrusion: just style fixes
to keep following PR diffs small

all changes were automatically done by MSVC
2022-01-20 01:08:35 +01:00
Uwe
0066d6d80d [Part] Extrude: avoid code duplication
more code that is used twice into a subroutine
2022-01-17 16:58:03 +01:00
Uwe
e6d63cecd9 [Part] just style fixes
to keep following PR diffs small

all changes automatically done by MSVC
2022-01-17 01:08:48 +01:00
Uwe
f44c683e0e [Part] sort includes 2022-01-09 21:59:02 +01:00
wmayer
c162037476 LGTM: [skip ci] fix: Large object passed by value 2020-07-24 18:32:31 +02:00
Zheng, Lei
f028ba42ff Part: changes to Part Module
* Added Part::Feature::getTopoShape/getShape() function that can obtain
  shape from any object with proper implementation of getSubObject(). It
  can even construct compound from group object with proper implementation
  of getSubObjects().

* Modified ViewProviderExt to work on any object, because it now obtain
  the shape using Part::Feature::getShape()

* Modified various Part features to obtain base/tool shapes using
  Part::getShape(), which allows them to be any type of object,
  including Link and groups.

* Modified various Part command to relax type requirement on selected
  objects.

* Add support of link and group to dimension, and add dimension refresh
  command

* Support link and group in simple command command, and add a few more
  copy command variations.

* Add special handling of 'Shape' attribute in PropertyContainerPy and
  use Part::Feature::getShape() to return shape for any object without
  Shape property. This allows many python feature work with any object
  without modification.

* GeometrySurface/CurvePy, add convenience attribute 'Rotation'

* TopoShapePy:

    * Extended support of sub shape attribute, e.g. Compound1, Solid2,
      SubShape3 ('SubShape' is used to access child shape of a compound)

    * makeWires(), new API to sort and return wires given a list of edges.

    * transformed/translated/rotated/scaled(), return a new shape with
      some transformation.

    * findPlane(), find the plane of a planar shape

    * isCoplanar(), check if two shape are coplanar
2019-08-17 15:08:35 +02:00
Abdullah Tahiri
216926233f Part: Make 3rd party libraries into PCH 2019-05-02 07:09:22 +02:00
wmayer
4a80a74680 fixes #0003788: Part-workbench extrude with taper angle delivers a wrong shape 2019-01-25 02:49:09 +01:00
wmayer
9aa6a700d8 Replace Base::Exception with appropriate subclass 2018-11-14 19:45:20 +01:00
luzpaz
5973d8d67e Part: typos 2017-12-25 11:03:11 +01:00