forked from FreeCAD/FreeCAD
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -69,6 +69,7 @@ Pocket::Pocket() | |||||
ADD_PROPERTY_TYPE(Length2,(100.0),"Pocket",App::Prop_None,"P"); | ||||||
ADD_PROPERTY_TYPE(UpToFace,(0),"Pocket",App::Prop_None,"Face where pocket will end"); | ||||||
ADD_PROPERTY_TYPE(Offset,(0.0),"Pocket",App::Prop_None,"Offset from face in which pocket will end"); | ||||||
ADD_PROPERTY_TYPE(Outside,(false),"Pocket",App::Prop_None,"Remove outside of profile"); | ||||||
static const App::PropertyQuantityConstraint::Constraints signedLengthConstraint = {-DBL_MAX, DBL_MAX, 1.0}; | ||||||
Offset.setConstraints ( &signedLengthConstraint ); | ||||||
|
||||||
|
@@ -219,11 +220,20 @@ App::DocumentObjectExecReturn *Pocket::execute(void) | |||||
prism = refineShapeIfActive(prism); | ||||||
this->AddSubShape.setValue(prism); | ||||||
|
||||||
// Cut the SubShape out of the base feature | ||||||
BRepAlgoAPI_Cut mkCut(base, prism); | ||||||
if (!mkCut.IsDone()) | ||||||
return new App::DocumentObjectExecReturn("Pocket: Cut out of base feature failed"); | ||||||
TopoDS_Shape result = mkCut.Shape(); | ||||||
TopoDS_Shape result; | ||||||
if (!Outside.getValue()) { | ||||||
// Cut the SubShape out of the base feature | ||||||
BRepAlgoAPI_Cut mkCut(base, prism); | ||||||
if (!mkCut.IsDone()) | ||||||
return new App::DocumentObjectExecReturn("Pocket: Cut out of base feature failed"); | ||||||
result = mkCut.Shape(); | ||||||
} else { | ||||||
// Cut the base feature to SubShape | ||||||
BRepAlgoAPI_Common mkCommon(base, prism); | ||||||
if (!mkCommon.IsDone()) | ||||||
return new App::DocumentObjectExecReturn("Pocket: Cut out of base feature failed"); | ||||||
result = mkCommon.Shape(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
// we have to get the solids (fuse sometimes creates compounds) | ||||||
TopoDS_Shape solRes = this->getSolid(result); | ||||||
if (solRes.IsNull()) | ||||||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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);
There was a problem hiding this comment.
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.