mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028747: Incorrect result of the section operation after edge refinement
Implementation of the method for simplification of the result of Boolean Operation on the API level. The method BRepAlgoAPI_BuilderAlgo::SimplifyResult has been added, so the derived classes such as BooleanOpeation and Splitter can also use this method. The result shape simplification should be called after the operation is done. The simplification is performed by the means of ShapeUpgrade_UnifySameDomain algorithm. Draw command "bsimplify" has been added to control the simplification options. Documentation for new functionality and draw commands controlling the options of Boolean operations. Test cases for the new functionality. Side-effect change: The algorithms in Boolean component have been changed to use the BRepTools_History as a History tool. Now it became possible to disable the collection of shapes modifications during Boolean Operations, which may be useful for performance sake (in draw the option is controlled by *setfillhistory* command). Draw command "unifysamedom" has been changed to accept the angular tolerance in degrees instead of radians.
This commit is contained in:
@@ -112,17 +112,11 @@ void BRepTools_History::Remove(const TopoDS_Shape& theRemoved)
|
||||
// Apply the limitations.
|
||||
Standard_ASSERT_RETURN(IsSupportedType(theRemoved), myMsgUnsupportedType,);
|
||||
|
||||
if (myShapeToGenerated.UnBind(theRemoved))
|
||||
{
|
||||
Standard_ASSERT_INVOKE_(, myMsgGeneratedAndRemoved);
|
||||
}
|
||||
|
||||
if (myShapeToModified.UnBind(theRemoved))
|
||||
{
|
||||
Standard_ASSERT_INVOKE_(, myMsgModifiedAndRemoved);
|
||||
}
|
||||
|
||||
//
|
||||
myRemoved.Add(theRemoved);
|
||||
}
|
||||
|
||||
@@ -349,11 +343,6 @@ Standard_Boolean BRepTools_History::prepareGenerated(
|
||||
Standard_ASSERT_RETURN(theInitial.IsNull() ||
|
||||
IsSupportedType(theInitial), myMsgUnsupportedType, Standard_False);
|
||||
|
||||
if (myRemoved.Remove(theInitial))
|
||||
{
|
||||
Standard_ASSERT_INVOKE_(, myMsgGeneratedAndRemoved);
|
||||
}
|
||||
|
||||
if (myShapeToModified.IsBound(theInitial) &&
|
||||
myShapeToModified(theInitial).Remove(theGenerated))
|
||||
{
|
||||
|
@@ -35,8 +35,13 @@ DEFINE_STANDARD_HANDLE(BRepTools_History, Standard_Transient)
|
||||
//!
|
||||
//! The last relation means that:
|
||||
//! 1) shape Si is not an output shape and
|
||||
//! 2) no any shape is generated or modified (produced) from shape Si:
|
||||
//! R(Si) == 1 ==> Si != Tj, G(Si) == 0, M(Si) == 0.
|
||||
//! 2) no any shape is modified (produced) from shape Si:
|
||||
//! R(Si) == 1 ==> Si != Tj, M(Si) == 0.
|
||||
//!
|
||||
//! It means that the input shape cannot be removed and modified
|
||||
//! simultaneously. However, the shapes may be generated from the
|
||||
//! removed shape. For instance, in Fillet operation the edges
|
||||
//! generate faces and then are removed.
|
||||
//!
|
||||
//! No any shape could be generated and modified from the same shape
|
||||
//! simultaneously: sets G(Si) and M(Si) are not intersected
|
||||
@@ -56,7 +61,7 @@ DEFINE_STANDARD_HANDLE(BRepTools_History, Standard_Transient)
|
||||
//! 3) a shape is generated from input shapes of the same dimension if it is
|
||||
//! produced by joining shapes generated from these shapes;
|
||||
//! 4) a shape is modified from an input shape if it replaces the input shape by
|
||||
//! changes of the location, the tolerance, the bounds of the parametrical
|
||||
//! changes of the location, the tolerance, the bounds of the parametric
|
||||
//! space (the faces for a solid), the parametrization and/or by applying of
|
||||
//! an approximation;
|
||||
//! 5) a shape is modified from input shapes of the same dimension if it is
|
||||
@@ -111,10 +116,7 @@ public: //! @name Constructors for History creation
|
||||
continue;
|
||||
|
||||
if (theAlgo.IsDeleted(aS))
|
||||
{
|
||||
Remove(aS);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check Modified
|
||||
const TopTools_ListOfShape& aModified = theAlgo.Modified(aS);
|
||||
@@ -191,6 +193,15 @@ public: //! Methods to read the history.
|
||||
Standard_EXPORT
|
||||
Standard_Boolean IsRemoved(const TopoDS_Shape& theInitial) const;
|
||||
|
||||
//! Returns 'true' if there any shapes with Generated elements present
|
||||
Standard_Boolean HasGenerated() const { return !myShapeToGenerated.IsEmpty(); }
|
||||
|
||||
//! Returns 'true' if there any Modified shapes present
|
||||
Standard_Boolean HasModified() const { return !myShapeToModified.IsEmpty(); }
|
||||
|
||||
//! Returns 'true' if there any removed shapes present
|
||||
Standard_Boolean HasRemoved() const { return !myRemoved.IsEmpty(); }
|
||||
|
||||
public: //! A method to merge a next history to this history.
|
||||
|
||||
//! Merges the next history to this history.
|
||||
|
Reference in New Issue
Block a user