Add support for holes which use a partial sketch as their profile - #57
Merged
Merged
Conversation
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
Owner
Author
|
During further testing, I stumbled upon #58, but this is reproducible even without partial profile, so unrelated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (
gfor internal,efor external), will appear in the relevant mapped name so we can filter against the earlier list (the mapped names often look likeg22;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.