Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend boolean common functionality to other subtractive features #1

Merged
merged 3 commits into from Jul 27, 2021

Conversation

adrianinsaval
Copy link

berberic2 and others added 2 commits July 1, 2021 17:31
This adds an “inverse” option for PartDesign pocket feature.
Essentially this cuts away anything that is +not+ covered by the
sketch. (boolean common instead of cut.)
in order to keep it consistent with helix feature, also add a more descriptive tool-tip to Outside property in helix
Hole feature is left without this option since it doesn't make sense there
BRepAlgoAPI_Cut mkCut(base, prism);
if (!mkCut.IsDone())
return new App::DocumentObjectExecReturn("Pocket: Cut out of base feature failed");
result = mkCut.Shape();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result = mkCut.Shape();
result = this->getSolid(mkCut.Shape());

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the review, pocket originally didn't do this but just used mkCut.Shape() should I assume that was just a mistake and it should have used this method all along? Can you explain what this does?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok it turns out this is also done just a few lines after (238):
TopoDS_Shape solRes = this->getSolid(result);
what to do then?
later on result is used again (line 242):
int solidCount = countSolids(result);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the idea is just to harmonize things. If it's too much work because of existing codebase, then it could stay as is.

BRepAlgoAPI_Common mkCommon(base, prism);
if (!mkCommon.IsDone())
return new App::DocumentObjectExecReturn("Pocket: Cut out of base feature failed");
result = mkCommon.Shape();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result = mkCommon.Shape();
result = this->getSolid(mkCommon.Shape());

@berberic2 berberic2 merged commit baf523a into berberic2:master Jul 27, 2021
berberic2 pushed a commit that referenced this pull request Aug 25, 2021
Prevent matplotlib selecting the PyQt API instead of PySide2
berberic2 pushed a commit that referenced this pull request Jul 30, 2023
berberic2 pushed a commit that referenced this pull request Apr 1, 2024
The proposed code fixes the following issues:
1. There is no check if the target object itself has a property that matches the label type.
2. If a subelement is selected that does not have the label type property, the value from the main object is displayed instead.
3. The default text is an empty string.

Example:

Currently If you select a vertex of a wire, and select "Length" as the label type, you will get the length of the wire. With the new code the text will then be "Length not available for (sub)object".

Forum topic (issue #1):
https://forum.freecad.org/viewtopic.php?t=86222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants