Skip to content

Add support for holes which use a partial sketch as their profile - #57

Merged
Rahix merged 2 commits into
mainfrom
fix-partial-profile
Aug 29, 2026
Merged

Rahix merged 2 commits into
mainfrom
fix-partial-profile

Conversation

@Rahix

@Rahix Rahix commented Aug 29, 2026

Copy link
Copy Markdown
Owner

In modern FreeCAD, you can select only a subset of edges from a sketch as the profile for a feature like a PartDesign_Hole. So far, we have errored when trying to generate ffDesign features ontop of such holes.

Add support for these kind of holes by recovering the sketch geometry of the selected edges.

Unfortunately, this has do be done in a somewhat convoluted way: We make a list of the "mapped names" of each edge as a lookup table for filtering. Then, when walking the sketch to look for holes, we fetch the "geometry id" of each element. This id, with a prefix (g for internal, e for external), will appear in the relevant mapped name so we can filter against the earlier list (the mapped names often look like g22;SKT).

This is not particularly efficient, but it sidesteps having to parse the deeper structure of the mapped names, which seems hard to rely on 1.

Fixes #56.

Rahix added 2 commits August 28, 2026 23:11
In modern FreeCAD, you can select only a subset of edges from a sketch
as the profile for a feature like a PartDesign_Hole. So far, we have
errored when trying to generate ffDesign features ontop of such holes.

Add support for these kind of holes by recovering the sketch geometry of
the selected edges.

Unfortunately, this has do be done in a somewhat convoluted way: We make
a list of the "mapped names" of each edge as a lookup table for
filtering. Then, when walking the sketch to look for holes, we fetch the
"geometry id" of each element. This id, with a prefix (`g` for internal, `e`
for external), will appear in the relevant mapped name so we can filter
against the earlier list.

This is not particularly efficient, but it sidesteps having to parse the
deeper structure of the mapped names, which seems hard to rely on [1].

[1]: https://github.com/FreeCAD/FreeCAD/blob/f7fa73cb0f96494679830c3870af6e9c2de89232/src/Mod/Sketcher/App/SketchObject.cpp#L2032-L2086
@Rahix

Rahix commented Aug 29, 2026

Copy link
Copy Markdown
Owner Author

During further testing, I stumbled upon #58, but this is reproducible even without partial profile, so unrelated.

@Rahix
Rahix merged commit 3368bd8 into main Aug 29, 2026
2 checks passed
@Rahix
Rahix deleted the fix-partial-profile branch August 29, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hole tools do not work correctly with PartDesign_Holes using partial sketches as support

1 participant