Set non-destructive mode enabled by default in Boolean operation algorithms. It means that shapes will not be modified during any Boolean, Split, GeneralFuse, MakerVolume, CellsBuilder operations.
Since now, in this default mode, the user should not expect any shape from the input arguments being present in the result shape of the operations mentioned above. Some of the input shapes may be passed to the result, in case they are not affected by the operation, but in general, it is better to work through the History mechanism. The shapes replaced by the copies should be obtained through Modified method.
Incomplete: documentation of the algorithms has to be updated accordingly.
myShapesSD(100, myAllocator),
myOrigins(100, myAllocator),
myInParts(100, myAllocator),
- myNonDestructive(Standard_False),
+ myNonDestructive(Standard_True),
myGlue(BOPAlgo_GlueOff),
myCheckInverted(Standard_True)
{
myShapesSD(100, myAllocator),
myOrigins(100, myAllocator),
myInParts(100, myAllocator),
- myNonDestructive(Standard_False),
+ myNonDestructive(Standard_True),
myGlue(BOPAlgo_GlueOff),
myCheckInverted(Standard_True)
{
//! Additionally to the options of the base classes, the algorithm has
//! the following options:<br>
//! - *Safe processing mode* - allows to avoid modification of the input
-//! shapes during the operation (by default it is off);<br>
+//! shapes during the operation (enabled by default);<br>
//! - *Gluing options* - allows to speed up the calculation of the intersections
//! on the special cases, in which some sub-shapes are coinciding.<br>
//! - *Disabling the check for inverted solids* - Disables/Enables the check of the input solids
//! This flag is taken into account if internal PaveFiller is used only.
//! In the case of calling PerformWithFiller the corresponding flag of that PaveFiller
//! is in force.
+ //! Enabled by default.
void SetNonDestructive(const Standard_Boolean theFlag)
{
myNonDestructive = theFlag;
{
myDS = NULL;
myIterator = NULL;
- myNonDestructive = Standard_False;
+ myNonDestructive = Standard_True;
myIsPrimary = Standard_True;
myAvoidBuildPCurve = Standard_False;
myGlue = BOPAlgo_GlueOff;
{
myDS = NULL;
myIterator = NULL;
- myNonDestructive = Standard_False;
+ myNonDestructive = Standard_True;
myIsPrimary = Standard_True;
myAvoidBuildPCurve = Standard_False;
myGlue = BOPAlgo_GlueOff;
//! - *Section attributes* - allows to customize the intersection of the faces
//! (avoid approximation or building 2d curves);<br>
//! - *Safe processing mode* - allows to avoid modification of the input
-//! shapes during the operation (by default it is off);<br>
+//! shapes during the operation (enabled by default);<br>
//! - *Gluing options* - allows to speed up the calculation on the special
//! cases, in which some sub-shapes are coincide.<br>
//!
//! Sets the flag that defines the mode of treatment.
//! In non-destructive mode the argument shapes are not modified. Instead
//! a copy of a sub-shape is created in the result if it is needed to be updated.
+ //! Enabled by default.
Standard_EXPORT void SetNonDestructive(const Standard_Boolean theFlag);
//! Returns the flag that defines the mode of treatment.
void SetDefaultOptions()
{
myRunParallel = Standard_False;
- myNonDestructive = Standard_False;
+ myNonDestructive = Standard_True;
myFuzzyValue = Precision::Confusion();
myGlue = BOPAlgo_GlueOff;
myDrawWarnShapes = Standard_False;
BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo()
:
BRepAlgoAPI_Algo(),
- myNonDestructive(Standard_False),
+ myNonDestructive(Standard_True),
myGlue(BOPAlgo_GlueOff),
myCheckInverted(Standard_True),
myFillHistory(Standard_True),
BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo(const BOPAlgo_PaveFiller& aPF)
:
BRepAlgoAPI_Algo(),
- myNonDestructive(Standard_False),
+ myNonDestructive(Standard_True),
myGlue(BOPAlgo_GlueOff),
myCheckInverted(Standard_True),
myFillHistory(Standard_True),
//! Additionally to the options defined in the base class, the algorithm has
//! the following options:<br>
//! - *Safe processing mode* - allows to avoid modification of the input
-//! shapes during the operation (by default it is off);
+//! shapes during the operation (enabled by default);
//! - *Gluing options* - allows to speed up the calculation of the intersections
//! on the special cases, in which some sub-shapes are coinciding.
//! - *Disabling the check for inverted solids* - Disables/Enables the check of the input solids
//! Sets the flag that defines the mode of treatment.
//! In non-destructive mode the argument shapes are not modified. Instead
//! a copy of a sub-shape is created in the result if it is needed to be updated.
+ //! Enabled by default.
void SetNonDestructive(const Standard_Boolean theFlag)
{
myNonDestructive = theFlag;
// we need to intersect the faces to process the tangential faces
aMV1.SetIntersect(Standard_True);
aMV1.SetAvoidInternalShapes(Standard_True);
+ aMV1.SetNonDestructive(Standard_False);
aMV1.Perform();
//
Standard_Boolean bDone = ! aMV1.HasErrors();
// no need to intersect this time
aMV2.SetIntersect(Standard_False);
aMV2.SetAvoidInternalShapes(Standard_True);
+ aMV2.SetNonDestructive(Standard_False);
aMV2.Perform();
bDone = ! aMV2.HasErrors();
if (!bDone) {
aMV3.SetArguments(aLF);
aMV3.SetIntersect(Standard_False);
aMV3.SetAvoidInternalShapes(Standard_True);
+ aMV3.SetNonDestructive(Standard_False);
aMV3.Perform();
bDone = ! aMV3.HasErrors();
if (!bDone) {
#include <BOPDS_DS.hxx>
-#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_Builder.hxx>
#include <BOPAlgo_Section.hxx>
#include <BOPAlgo_MakerVolume.hxx>
// perform intersection of the edges
BOPAlgo_Builder aGFE;
aGFE.SetArguments(aLS);
+ aGFE.SetNonDestructive(Standard_False);
aGFE.Perform();
if (aGFE.HasErrors()) {
return;
TopTools_ListOfShape& theLFImages)
{
BOPAlgo_Builder aGF;
- //
aGF.AddArgument(theFace);
aGF.AddArgument(theEdges);
+ aGF.SetNonDestructive(Standard_False);
aGF.Perform();
if (aGF.HasErrors()) {
return;
BOPAlgo_MakerVolume aMV;
aMV.SetArguments(aLS);
aMV.SetIntersect(Standard_True);
+ aMV.SetNonDestructive(Standard_False);
aMV.Perform();
if (aMV.HasErrors())
return;
// Intersect Edges
BOPAlgo_Builder aGF;
aGF.SetArguments(aLArgs);
+ aGF.SetNonDestructive(Standard_False);
aGF.Perform();
if (aGF.HasErrors()) {
return;
BOPAlgo_Builder aGFCE;
aGFCE.SetArguments(aLCE);
aGFCE.AddArgument(aCEIm);
+ aGFCE.SetNonDestructive(Standard_False);
aGFCE.Perform();
//
if (aGFCE.HasErrors()) {
BOPAlgo_Builder aGF;
aGF.AddArgument(aBounds);
aGF.AddArgument(aSplits);
+ aGF.SetNonDestructive(Standard_False);
aGF.Perform();
//
// update splits
aMV.Add(aV1);
aMV.Add(aV2);
//
+ aGFE.SetNonDestructive(Standard_False);
aGFE.Perform();
if (!aGFE.HasErrors()) {
// get images of bounding vertices to remove splits containing them
{
BOPAlgo_Builder aGFA;
aGFA.SetArguments(theLA);
+ aGFA.SetNonDestructive(Standard_False);
aGFA.Perform();
if (aGFA.HasErrors()) {
// just copy input to the result
BOPAlgo_Section aSec;
aSec.AddArgument(theSplits);
aSec.AddArgument(theBounds);
+ aSec.SetNonDestructive(Standard_False);
//
aSec.Perform();
//
regexp {Tolerance +MAX=([-0-9.+eE]+)} [tolerance b] full MaxTol_b_1
-bnondestructive 1
-
bop p b
regexp {Tolerance +MAX=([-0-9.+eE]+)} [tolerance b] full MaxTol_b_2
tolerance f0
-#turn on non-destructive mode of BOP
-#setflags h0 locked
-#setflags f0 locked
-bnondestructive 1
-
bop h0 f0
bopsection result
checkprops result -l 150.232
#turn on non-destructive mode of BOP and fuzzy value;
#with this combination the test is fail before the fix 26738,
#as tolerance of input shape is changed
-bnondestructive 1
bfuzzyvalue 0.1
bclearobjects
polyline p1 0 0 0 2 0 0
polyline p2 1 0 -1 1 0 1
-bnondestructive 1
-
bclearobjects
bcleartools
baddobjects v1 p1 p2
tolerance f0
-#turn on non-destructive mode of BOP
-#setflags h0 locked
-#setflags f0 locked
-#bnondestructive 1
-
bop h0 f0
bopsection result
checkprops result -l 150.23
explode s f
explode t f
-bnondestructive 1
-
# Before the fix, exception in bsection algo was thrown.
bsection r s_91 t_4
restore [locate_data_file bug28274_tmp.brep] a
-bnondestructive 1
-
set Log [eval mkvolume result [explode a f] ]
checkshape result
restore [locate_data_file bug28485_parts.brep] a
explode a
-bnondestructive 1
brunparallel 1
bfuzzyvalue 0
bglue 1
nurbsconvert b1 b1
nurbsconvert b2 b2
-bnondestructive 1
brunparallel 1
bfuzzyvalue 0
bglue 1
set nameop {common fuse cut cut21}
bfuzzyvalue 1e-2
-bnondestructive 1
for {set i 1} { $i <= 2} {incr i} {
plane p3 0 200 12.6935294289015 0 -1 1.11022302462516e-16
pcylinder c3 p3 100 400
+bnondestructive 0
+
bcommon r c1 c2
checkshape r
if {![regexp "OK" [bopcheck r]]} {
pcylinder c3 p3 100 400
bfuzzyvalue 1.e-6
-bnondestructive 1
brunparallel 1
setfillhistory 0
bfuzzyvalue 1.e-6
brunparallel 1
-bnondestructive 1
setfillhistory 0
explode s
restore [locate_data_file bug31850.brep] s
explode s
+bnondestructive 0
+
bclearobjects
bcleartools
baddobjects s_1
explode s
bfuzzyvalue 1.e-6
-bnondestructive 1
brunparallel 1
setfillhistory 0
plane p -2.31895142368858e-15 -4.49296838339662e-15 200 0 0 1
ptorus t p 449.367136080235 50.6328639197654
+bnondestructive 0
+
bclearobjects
bcleartools
baddobjects c
ptorus t p 449.367136080235 50.6328639197654
bfuzzyvalue 1.e-6
-bnondestructive 1
brunparallel 1
setfillhistory 0
restore [locate_data_file bug29329_objects.brep] a
restore [locate_data_file bug29329_tools.brep] b
-bnondestructive 1
-
dchrono timer restart
bfuse result a b