Commit Graph

1167 Commits

Author SHA1 Message Date
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
8af563804c SPDX [ 49 ][ Src / Mod / PartDesign ] (#26715) 2026-02-07 22:53:31 -06:00
Captain
6aee8b81c9 PartDesign: Added interactive gizmo for draft operation (#27111)
* PartDesign: Add interactive gizmo for draft operation

* [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>
2026-01-25 00:00:07 +01:00
PaddleStroke
17ac7dab3d PartDesign: allow makeShellFromUpToFace to update extrusion direction
Updated makeShellFromUpToShape to accept the direction vector by reference.
This allows the method to reverse the direction internally if required
to successfully reach the target face, fixing cases where the extrusion
would otherwise fail or go the wrong way.

Note: While passing the direction as a non-const reference is a quick
fix for this regression, it is acknowledged as non-ideal and should
be considered for future refactoring.
2026-01-19 10:39:31 -06:00
tetektoza
bb48de8265 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 c31ebeeee6)
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
PaddleStroke
168cebd41f PartDesign: Extrude: Fix upToShape document not recomputing correctly (#26696)
* PartDesign: Extrude: Fix dir for upToShape

* Update FeatureExtrude.h

* Update FeatureExtrude.h

* Update FeatureExtrude.cpp

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

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

* Update FeatureExtrude.cpp

* Update FeatureExtrude.h

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-12 23:07:47 +00:00
Kacper Donat
4fae2b83f8 PartDesign: Apply pattern transform in Feature not VP
This is followup for https://github.com/FreeCAD/FreeCAD/pull/26563 which
fixed previews for a given file but broke it for others.

This approach should be more robust as it is applied in the Feature
itself and not on view provider level which should give us more precise
control and per feature transform ability.
2026-01-11 20:45:03 -06:00
Louis Gombert
c1b40e3dfc PartDesign: remove preview update on property changed (#26803)
This recompute seemed unnecessary, and caused slowdowns when opening the file and recomputing. This decreases the time necessary to both open and recompute files that use boolean operations, and should not change anything regarding preview computation when the dialog is open.
2026-01-09 23:05:23 +00:00
Max Wilfinger
5fbd150b18 Part: Fix orientation of internal shells of a solid (#26717)
* Part: Fix orientation of internal shells of a solid

If a solid consists of multiple shells then it can happen that the
internal shells have incorrect orientation that leads to a broken solid.

This fixes issue https://github.com/FreeCAD/FreeCAD/issues/24994

* Part: Add method Feature::fixSolids

This method explicitly checks for solids with the error
'BRepCheck_EnclosedRegion' that means that internal shells of a solid
are wrong.

Using ShapeFix_Solid fixes the solid.

---------

Co-authored-by: wwmayer <wmayer@freecad.org>
2026-01-08 10:35:26 -06:00
Max Wilfinger
b0331ed979 PD: Handle reference edge in PolarPattern::getTransformations (#26722)
This fixes issue https://github.com/FreeCAD/FreeCAD/issues/24700

---------

Co-authored-by: wwmayer <wmayer@freecad.org>
2026-01-08 10:31:42 -06:00
tetektoza
0baf444c3e Revert "PartDesign: Bake in geometry transform after boolean"
This reverts commit 527b2de560.

The `bakeInTransform()` call uses `transformGeometry()` which converts
planar faces to BSplineSurfaces. This prevents the refine algorithm
(BRepBuilderAPI_RefineModel) from detecting and merging coplanar faces,
breaking the Refine option for Boolean operations.

This matches Part WB's Boolean behavior which does not use
`bakeInTransform()` and has working refine functionality.
2026-01-08 13:40:52 +01:00
tritao
69058376e6 Base: Remove Boost-based signals and switch to FastSignals. 2026-01-07 21:16:16 +00:00
Krrish777
123a142292 Improve error message for empty transformed features 2026-01-07 10:20:24 +01:00
Chris Hennes
8b9048a784 PD: Add case for when scripts set Midplane=False 2025-12-29 17:42:13 +01:00
Alfredo Monclus
24b9cdb4f9 PartDesign: fix transform removal causing an invalid base feature on the next solid if it was broken itself 2025-12-29 17:41:36 +01:00
horseDeveloper
4892154faf Fixing Leftover references from migration from freecadweb.org (#26163) 2025-12-26 11:11:12 -06:00
Kacper Donat
8c399e1fd0 PartDesign: Revolution - add FuseOrder
In older versions of FreeCAD the boolean order was base + result. After
TNP mitigation the order was changed to be result + base. For the
resulting shape that does not matter, but order of edges can differ if
arguments are in a different order.

This can impact refine algorithm which may pick other face as the base
one and result in a differnt shape after refining. This commit restores
previous order. For most files it should not make any difference, but it
may fix some older files.

To support all cases we introduce FuseOrder compatibility property that
will be set to FeatureFirst for files saved with 1.0 to preserve
behavior.
2025-12-22 11:17:27 -06:00
Chris Hennes
76bd68e672 PD: Fix missing silent mode check in GetTopoShapeVerifiedFace
Also ensure that all calls to this method actually verify the result.
2025-12-22 14:34:25 +01:00
Kacper Donat
4d712f44c2 PartDesign: Chamfer - migrate Size and Size2 for older files (#26137)
* PartDesign: Chamfer - migrate Size and Size2 for older files

* Apply suggestions from code review

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-12-22 11:52:55 +00:00
Saksham Malhotra
b7735044c4 PartDesign: move AllowCompound to Base property group (#26180) 2025-12-15 21:45:29 -06:00
Chris Hennes
3208b6de5f PD: Don't warn about Midplane on document load 2025-12-15 18:22:31 +01:00
Chris Hennes
67948d60a2 PD: Add deprecation warning if Midplane is set 2025-12-10 12:42:13 +01:00
Chris Hennes
dfb9baf678 Merge pull request #24262 from mnesarco/pyi-fixes-1 2025-11-29 20:23:37 -06:00
PaddleStroke
5ae67ee2f9 PartDesign: Polar pattern: Accept negative angles (#25621) 2025-11-27 18:08:01 -06:00
Chris Hennes
8604c26ce3 Merge pull request #25580 from kadet1090/fix-boolean-position
PartDesign: Fix boolean positioning
2025-11-26 14:22:59 -06:00
Chris
5382ca4bbb PartDesign: Use c++ exception to prevent crash (#25671)
* part design: fix issue #25639 use c++ exception to prevent crash

* [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>
2025-11-26 15:43:47 +01:00
Kacper Donat
88543612e4 PartDesign: Use true tool positions for boolean preview
This fixes positioning of some previews for booleans that were misplaced
after #24750 was merged. It restores previous code that was correct for
most cases. The reason for some previews being misaligned is described
in the #25578 - the preview actually shows how the result should be but
due to some shortcuts taken in code the result is incorrect.
2025-11-24 10:48:32 -06:00
Kacper Donat
527b2de560 PartDesign: Bake in geometry transform after boolean
This bakes in transform into geometry after boolean to ensure that
regardless of parameters the result of boolean operation is the same.
2025-11-23 23:10:25 +01:00
Kacper Donat
1555f65075 PartDesign: Simplify FeatureBoolean
This commit removes a ton of dead code from FeatureBoolean. It might
been ported here from the Link branch but it is not used and it is
confusing. The reason for having that code here is also not really
obvious so there is no reason to keep it.
2025-11-23 23:10:25 +01:00
pre-commit-ci[bot]
5e0dd60ee5 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-11-11 19:34:32 +00:00
Frank Martinez
3561d25c2d [License] Fix pyi license headers. 2025-11-11 13:26:18 -05:00
Frank Martinez
93e4858b01 [bindings] remove redundant signatures. batch2 2025-11-11 13:23:10 -05:00
Frank Martinez
1cf57d6e11 [bindings] Format with yapf (precommit will reformat) 2025-11-11 13:23:10 -05:00
Frank Martinez
2ada443c18 Clean unused imports in .pyi files 2025-11-11 13:23:10 -05:00
Frank Martinez
39d15c011e black formatting 2025-11-11 13:23:10 -05:00
Frank Martinez
0eae00b9a1 [bindings] Code formatting 2025-11-11 13:23:09 -05:00
Frank Martinez
748004b4e4 [bindings] fix signatures in pyi files 2025-11-11 13:16:26 -05:00
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Florian Foinant-Willig
501c6273a3 PartDesign: only warn on refine failure 2025-10-26 22:16:04 +01:00
Kacper Donat
e8aeffc096 PartDesign: Fix misplaced preview for Boolean operation 2025-10-20 08:46:28 -05:00
Kacper Donat
2b90740855 PartDesign: Fix boolean fuse without tools
This fixes issue where exception was thrown when no tools were selected
preventing the task dialog from being opened.
2025-10-14 10:05:24 -05:00
Chris Hennes
efbe579e25 Merge pull request #24333 from PaddleStroke/patch-83
PartDesign: Pocket Through all: Taper should be writable and offset hidden
2025-09-30 11:51:52 -05:00
Chris Hennes
2b1a3aedbe Merge pull request #23770 from PaddleStroke/patch-59
PartDesign: FeatureExtrude fix symmetric + custom dir
2025-09-30 08:55:18 -05:00
PaddleStroke
d52260b2f4 PartDesign: FeatureExtrude: Taper should not be read-only when throughall. 2025-09-30 10:17:36 +02:00
Chris Hennes
f7e6b94aba Merge pull request #21713 from 3x380V/pd_fixes
PartDesign: Random fixes
2025-09-29 10:54:46 -05:00
PaddleStroke
94750baa6b PartDesign: FeatureExtrude: single prism for modes that can 2025-09-29 13:24:55 +02:00
PaddleStroke
a01cab21cc PartDesign: FeatureExtrude: Make single prism if both modes are length and no taper 2025-09-29 09:33:53 +02:00
Ladislav Michl
7a266b1d78 PartDesign: Microoptimize updateSpacings()
This also fixes "comparison of integer expressions of different
signedness: ‘int’ and ‘size_t’" warning.

Fixes: 5d2037c820 ("PartDesign: Transform rework")
2025-09-27 11:40:07 -05:00
marioalexis
406c3ba42c PartDesign: Use AllowCompound user parameter along the workbench - fixes #23596 2025-09-26 19:50:21 -05:00
wmayer
df5c75d6b0 PD: Improve groove feature
The only difference between groove and revolution is that for the former
the revolved face is removed from the base shape instead of added.

Thus, the code of the Revolution and Groove classes should be almost
identical. This allows it in a further step to refactor the code and
make a common base class.

This fixes issue 18842.
2025-09-26 23:46:25 +02:00
wmayer
4d80f3ec28 PD: Improve revolution feature
* Allow a minimum angle of 0.0 as this is needed in 'Two Angles' mode
* Set the default value of Angle2 to 0.0
* Check for valid input in 'Angle' and 'Two Angles' mode
* Replace the confusing enum labels 'Dimension' and 'TwoDimensions'
2025-09-26 23:45:53 +02:00