1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0029481: Implementation of the Feature Removal algorithm

Implementation of the 3D model De-featuring algorithm intended for the removal of the unwanted parts (or features) from the model consisting of solids. The features can be the holes, protrusions, gaps, chamfers, fillets etc.
The algorithm removes all possible requested features from the shape and builds the new shape as a result. The input model is not modified.

On the API level the algorithm is implemented in the class *BRepAlgoAPI_Defeaturing*. The actual features removal is performed by the low-level algorithm *BOPAlgo_RemoveFeatures*.

Documentation of the new classes.
Implementation of the DRAW commands for working with new algorithm.
Test cases for the new functionality.

Changes in other algorithms used by De-featuring algorithm:
- Provide history support for the solids in *ShapeUpgrade_UnifySameDomain* algorithm;
- Implementation of the mechanism to merge History of any Algorithm with standard history methods such as IsDeleted(), Modified() and Generated() into *BRepTools_History*.
This commit is contained in:
emv
2018-02-06 08:48:27 +03:00
committed by bugmaster
parent 9e04ccdcf8
commit d9ca2e0cb1
112 changed files with 4212 additions and 39 deletions

View File

@@ -1791,17 +1791,19 @@ void ShapeUpgrade_UnifySameDomain::FillHistory()
// the history of UnifySameDomain algorithm
Handle(BRepTools_History) aUSDHistory = new BRepTools_History();
// Map all Vertices, Edges and Faces in the input shape
// Map all Vertices, Edges, Faces and Solids in the input shape
TopTools_IndexedMapOfShape aMapInputShape;
TopExp::MapShapes(myInitShape, TopAbs_VERTEX, aMapInputShape);
TopExp::MapShapes(myInitShape, TopAbs_EDGE , aMapInputShape);
TopExp::MapShapes(myInitShape, TopAbs_FACE , aMapInputShape);
TopExp::MapShapes(myInitShape, TopAbs_SOLID , aMapInputShape);
// Map all Vertices, Edges and Faces in the result shape
// Map all Vertices, Edges, Faces and Solids in the result shape
TopTools_IndexedMapOfShape aMapResultShapes;
TopExp::MapShapes(myShape, TopAbs_VERTEX, aMapResultShapes);
TopExp::MapShapes(myShape, TopAbs_EDGE , aMapResultShapes);
TopExp::MapShapes(myShape, TopAbs_FACE , aMapResultShapes);
TopExp::MapShapes(myShape, TopAbs_SOLID , aMapResultShapes);
// Iterate on all input shapes and get their modifications
Standard_Integer i, aNb = aMapInputShape.Extent();
@@ -1831,10 +1833,12 @@ void ShapeUpgrade_UnifySameDomain::FillHistory()
TopTools_ListIteratorOfListOfShape aItLSIm(aLSImages);
for (; aItLSIm.More(); aItLSIm.Next())
{
if (aMapResultShapes.Contains(aItLSIm.Value()))
const TopoDS_Shape& aSIm = aItLSIm.Value();
if (aMapResultShapes.Contains(aSIm))
{
// Image is found in the result, thus the shape has been modified
aUSDHistory->AddModified(aS, aItLSIm.Value());
if (!aSIm.IsSame(aS))
// Image is found in the result, thus the shape has been modified
aUSDHistory->AddModified(aS, aSIm);
bRemoved = Standard_False;
}
}