Boolean Operations:
1. Face/Face intersection post treatment - Unify vertices put on the section curves, which were rejected as existing ones, with the vertices of edges by which these section curves have been rejected.
2. Extend Warnings Reporting system of Boolean operations with the new warnings:
- BOPAlgo_AlertIntersectionOfPairOfShapesFailed - to be added when the intersection of pair of sub-shapes of the arguments has failed;
- BOPAlgo_AlertBuildingPCurveFailed - to be added when the building of the 2D curve of the edge on face has failed;
- BOPAlgo_AlertAcquiredSelfIntersection - to be added when the positioning and tolerances of the arguments leads to creation of self-interfered shapes.
These new warnings allow completing the operation even if intersection of some of the sub-shapes or building of some of the PCurves has failed. Moreover, they allow getting the pairs of sub-shapes on which the intersection/projection has failed, providing the user ability to analyze the intersection results.
Note that if some of these warnings appear, the result of the operation should be carefully analyzed for validity.
3. Print messages for the Warnings/Errors met during checking of the shape on self-intersection ("bopcheck" command).
0. Basic tools for defining classes representing alerts (errors, warnings etc.) and collecting them during execution of algorithms are added in Message package.
1. Refactoring of the Error/Warning reporting system of the algorithms in Boolean Component.
To dump the description of the Error/Warning status of the algorithm the DumpErrors/DumpWarnings method should be called.
Also, the methods GerErrorMsg(int Error) and GetWarningMsg(int Warning) have been implemented to get the description for the given Error/Warning.
All Error/Warning statuses are now listed in the enumeration ErrorStatusEnum/WarningStatusEnum of the algorithm.
It is also possible to get the shapes for which the warning has been set by using the method GetWarningShapes().
2. The new class BOPAlgo_Options has been created to unify the options of the BOPAlgo_* and BRepAlgoAPI* algorithms.
3. The new checks across the algorithms have been added to detect and report errors and warnings.
4. Test cases
boolean bopcut_complex B9 E1 E5 E8
boolean bopfuse_complex B4 B5 C9 D1 D4 D5 D6 D7
have been rewritten to use Cells Builder algorithm instead of Boolean Operations algorithm, because latter always returns error "Unsupported Boolean operation" for these cases.
5. New chapter has been added in the user guide for Boolean Operations - Error / Warning reporting system.
6. Added comment to NCollection_List::Remove(Iterator&)
1. The methods PerformVZ, PerformEZ, PerformFZ and PerformZZ have been transferred from BOPAlgo_PaveFiller to BOPAlgo_CheckerSI class
to perform intersection of sub-shapes with solids only in self-intersection mode.
2. The checks for solids built from the same (shared) faces have been added into methods building the result of Boolean operations -
BOPAlgo_BOP::BuildRC() and BOPAlgo_BOP::BuildSolid().
3. Since the NonDestructive mode is now natively supported by the BOPAlgo_PaveFiller the methods providing the support of this mode by CheckerSI
(BOPAlgo_CheckerSI::PrepareCopy() and BOPAlgo_CheckerSI::PostTreatCopy()) are not needed and have been removed.
4. The pairs of sub-shapes with interfering bounding boxes are now sorted before real intersection to guarantee the constant order of
intersection of sub-shapes and produce more stable result. The class BOPDS_PassKey has been replaced with simpler class BOPDS_Pair.
5. The class BOPDS_SubIterator has been refactored.
6. Test cases for the issue.
7. Adjustment of the test case boolean volumemaker D2.
I. New features:
No new features
II. Changes:
II.1 class BOPTest
-static function:
Standard_Integer bopargcheck (Draw_Interpretor& di,
Standard_Integer n,
const char** a )
The option has been retrieved and passed to the checker algorithm.
III. Modified entities:
packages:
BOPTest
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
Changes:
class BOPTest
- static function:
Standard_Integer checkcurveonsurf(Draw_Interpretor& di,
Standard_Integer n,
const char** a)
has been changed.
The condition that provides selection of faulty curves has been modified
to be coherent with the same condition in class BOPAlgo_Analyzer.
Simple primitives to parallelize loops type "for" and "foreach" were implemented. The primitives encapsulates complete logic for creating and managing parallel context of loops. Moreover the primitives may be a wrapper for some primitives from 3rd-party library - TBB.
To use it is necessary to implement TBB like interface which is based on functors. For example:
Class Functor
{
public:
void operator() ([proccesing instance]) const
{
//...
}
};
In the body of the operator () should be implemented thread-safe logic of computations that can be performed in parallel context. If parallelized loop iterates on the collections with direct access by index (such as Vector, Array), it is more efficient to use the primitive ParallelFor (because it has no critical section).
All parts of OCC code which are using tbb were changed on new primitives.
0024826: Wrapping of parallelisation algorithms
Small fix.
1. The tool of computing the max distance between 3D curve and its 2d representation on the face
has been moved from static methods in BOPTools_AlgoTools class to BRepLib_CheckCurveOnSurface class.
2. The tools has been applied to 2d curves built during Boolean Operation
and to some intersection curves.
3. The functions
Standard_Boolean BOPTools_AlgoTools::ComputeTolerance
(const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge,
Standard_Real& theMaxDist,
Standard_Real& theMaxPar)
and
Standard_Boolean IntTools_Tools::ComputeTolerance
(const Handle(Geom_Curve)& theCurve3D,
const Handle(Geom2d_Curve)& theCurve2D,
const Handle(Geom_Surface)& theSurf,
const Standard_Real theFirst,
const Standard_Real theLast,
Standard_Real& theMaxDist,
Standard_Real& theMaxPar)
have been developed for easy access to BRepLib_CheckCurveOnSurface functionality.
class IntTools_FaceFace
method void IntTools_FaceFace::ComputeTolReached3d()
Case for Plane/BSpline intersection added for treatment.
Test case for issue CR25597
Fix for regression boolean bsection N7.
class BOPAlgo_PaveFiller
method
void BOPAlgo_PaveFiller::UpdateFaceInfo
(BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDME,
const BOPCol_DataMapOfIntegerInteger& theDMV)
Updating Face Info information with new vertices created in PostTreatFF.
Correction boolean/bsection/N2
Updated test cases.
Changes:
1.
Class BOPTest_Chronometer
The class definition that depends on TBB has been removed
2.
For the following commands:
>bop s1 s2 [tol]
>bopcommon r s1 s2 [tol]
>bfuse r s1 s2 [tol]
>bcut s1 s2 [tol]
>btuc r s1 s2 [tol]
>bsection r s1 s2 [-n2d/-n2d1/-n2d2] [-na] [tol]
>mkvolume r b1 b2 ... [-c] [-ni] [-s] [tol]
>bopcheck Shape [level of check: 0 - 9] [-t -s] [-tol tol]
>bopargcheck Shape1 [[Shape2] [-F/O/C/T/S/U] [/R|F|T|V|E|I|P|C|S]] [#BF] [-tol tol]
>bfillds [-s -t] [tol]
the syntax has been changed. Parameter [tol] has been removed.
The value "tol" (i.e. Fuzzy Value) is option for the algorithm.
If it is necessary, the value "tol" can be set by the command:
>bfuzzyvalue value
see
http://tracker.dev.opencascade.org/view.php?id=25614
for more details
3.
For the following commands:
>bopcheck Shape [level of check: 0 - 9] [-t -s] [-tol tol]
>bfillds [-s -t] [tol]
>bbuild r [-s -t]
>bbop r op [-s -t]
the syntax has been changed. Parameter [-s] has been removed.
Parameter [-s] was to provide the sequential mode of the computations.
The mode of the computations is option for the algorithm.
The mode of the computations can be set by the command:
>brunparallel [0/1]
1 -sets the parallel mode of the computations
0 -sets the sequential mode of the computations
see
http://tracker.dev.opencascade.org/view.php?id=25614
for more details
Implementation of Fuzzy Boolean operations. Such operations allow to perform Boolean operations on the shapes
with near-coincidence between the entities of these shapes, i.e. between shapes in which some entities from one shape
are intended to be coincide with some entities from the other, but the coincidence is not precise.
API for Boolean operations has been improved to have a possibility to add new options.
Modified entities:
1. New option of setting additional tolerance have been added to the following classes:
class BOPAlgo_ArgumentAnalyzer
class BOPAlgo_BOP
class BOPAlgo_Builder
class BOPAlgo_MakerVolume
class BOPAlgo_PaveFiller
class BOPDS_DS
class BRepAlgoAPI_BooleanOperation
class BRepAlgoAPI_Check
class BRepAlgoAPI_Common
class BRepAlgoAPI_Cut
class BRepAlgoAPI_Fuse
class BRepAlgoAPI_Section
2. Following draw commands have been modified to support new functionality:
BOP commands:
bop b1 b2 [tol]
bcommon r b1 b2 [tol]
bcut r b1 b2 [tol]
bfuse r b1 b2 [tol]
bsection r s1 s2 [-n2d/-n2d1/-n2d2] [-na] [tol]
mkvolume r b1 b2 ... [-c] [-ni] [-s] [tol]
bfillds [-s -t] [tol]
Check commands:
bopcheck Shape [level of check: 0 - 9] [-t -s] [-tol tol]
bopargcheck [-F/O/C/T/S/U] [/R|F|T|V|E|I|P|C|S]] [#BF] [-tol tol]
3. Two new classes have been added to API to provide the root interface for algorithms
class BRepAlgoAPI_Algo
class BRepAlgoAPI_BuilderAlgo
Fix to eliminate the warning.
Test-cases for issue #25477
Modifications:
1. class BOPTools_AlgoTools
1.1. method
Standard_Boolean BOPTools_AlgoTools::ComputeTolerance
(const Handle(Geom_Curve)& theCurve3D,
const Handle(Geom2d_Curve)& theCurve2D,
const Handle(Geom_Surface)& theSurf,
const Standard_Real theFirst,
const Standard_Real theLast,
Standard_Real& theMaxDist,
Standard_Real& theMaxPar)
It computes the max distance between points taken from 3D and 2D curves by the same parameter
1.2. method
Standard_Boolean BOPTools_AlgoTools::ComputeTolerance
(const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge,
Standard_Real& theMaxDist,
Standard_Real& theParameter)
Computes the valid value of the tolerance for the edge using the function above.
2. Added possibility to check shape on the validity of the curves on the surfaces.
2.1. New status BOPAlgo_InvalidCurveOnSurface has been added to the enumeration BOPAlgo_CheckStatus
2.2. class BOPAlgo_ArgumentAnalyzer
method
void BOPAlgo_ArgumentAnalyzer::TestCurveOnSurface()
It checks each edge/face pair in the shape using the method ComputeTolerance from BOPTools_AlgoTools and stores invalid pairs to myResults.
Invalid pairs are those which contain the edge with tolerance value less then the value computed by the ComputeTolerance method.
2.3. class BOPAlgo_CheckResult
Added new fields:
myMaxDist1 : Real from Standard;
myMaxDist2 : Real from Standard;
myMaxPar1 : Real from Standard;
myMaxPar2 : Real from Standard;
and corresponding setters and getters.
These fields are used to store the results of the TestCurveOnSurface() check.
3. Added new option to the bopargcheck command and two new commands.
class BOPTest_CheckCommands
3.1. command bopargcheck
As it is using the BOPAlgo_ArgumentAnalyzer class to check the shapes
it checks also the validity of the curves on the surfaces.
The output for the invalid shapes is following:
Draw[]> bopargcheck b2 /ic #f
Made faulty shape: s1COnS_1 (MaxDist = 0.0013334343378738308, MaxPar = 0.02884285498274167)
Made faulty shape: s1COnS_2 (MaxDist = 0.0013334340648766174, MaxPar = 0.02884285497934707)
Made faulty shape: s1COnS_3 (MaxDist = 0.0013335086668628978, MaxPar = 1.4133051942712607)
Made faulty shape: s1COnS_4 (MaxDist = 0.0013335086525838983, MaxPar = 1.4133051942713901)
Faulties for FIRST shape found : 4
---------------------------------
Shapes are not suppotrted by BOP: NO
Self-Intersections : NO
Check for SI has been aborted : NO
Too small edges : NO
Bad faces : NO
Too close vertices : NO
Too close edges : NO
Shapes with Continuity C0 : NO
Invalid Curve on Surface : YES Cases(4) Total shapes(8)
Faulties for SECOND shape found : 0
The compounds s1COnS_* contain pair of edge and face.
MaxDist is maximal distance between points taken from 3D curve of the edge and 2D curve of that edge on the face.
MaxPar is a parameter in which the MaxDist is reached.
To disable this check it is necessary to use option /S (bopargcheck shape /S).
3.2. command xdistef
Usage of the command:
xdistef edge face
It computes distance between points taken from 3D curve of the edge and 2D curve of that edge on the face.
Example:
Draw[]> explode s1COnS_1
s1COnS_1_1 s1COnS_1_2
Draw[]> whatis s1COnS_1_1
s1COnS_1_1 is a shape EDGE FORWARD Modified Orientable
Draw[]> whatis s1COnS_1_2
s1COnS_1_2 is a shape FACE FORWARD Modified Orientable
Draw[]> xdistef s1COnS_1_1 s1COnS_1_2
Max Distance = 0.0013334343378738308; Parameter on curve = 0.02884285498274167
3.3. command checkcurveonsurf
Usage of the command:
checkcurveonsurf shape.
It checks each edge/face pair in the shape using the method ComputeTolerance from BOPTools_AlgoTools.
Example:
Draw[]> checkcurveonsurf b2
Invalid curves on surface:
edge e_0 on face f_0 (max dist: 0.0013334343378738, parameter on curve: 0.0288428549827417)
edge e_1 on face f_0 (max dist: 0.0013334340648766, parameter on curve: 0.0288428549793471)
edge e_2 on face f_1 (max dist: 0.0013335086668629, parameter on curve: 1.4133051942712607)
edge e_3 on face f_1 (max dist: 0.0013335086525839, parameter on curve: 1.4133051942713901)
Sugestions to fix the shape:
explode b2 e;
settolerance b2_6 0.0013335086668629;
settolerance b2_7 0.0013334343378738;
settolerance b2_8 0.0013334340648766;
settolerance b2_10 0.0013335086525839;
The command gives suggestions to fix the shape by increasing tolerance values of the invalid edges.
In some cases the tolerance values suggested by the tool can be very large.
Such values should be used very carefully, because setting large tolerance values to the sub-shapes
of the shape can make it non valid (self-interfered) or lead to unexpected result when using
such shapes in some operations (boolean for example).
Test case for issue CR25410
class BOPAlgo_CheckerSI
- methods:
void BOPAlgo_CheckerSI::Perform()
class BOPAlgo_ArgumentAnalyzer
- methods:
void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
The changes have been done to provide the consistence
between results in SALOME Application and DRAW Application
The sytax of the command "bopcheck" has been changed:
bopcheck Shape [level of check: 0 - 9] [-t -s]
The options:
-t - display elapsed CPU time
-s - run in serial (non-parallel) mode. The default mode is parallel.
Modified test cases bugs/modalg_5/bug24029 and bugs/modalg_5/bug24764 according to changed output format of the "bopcheck" command.
Modifications:
class IntTools_EdgeEdge
1. method
Standard_Boolean IntTools_EdgeEdge::FindParameters(
const BRepAdaptor_Curve& theB
const Standard_Real aT1,
const Standard_Real aT2,
const Standard_Real theRes,
const Standard_Real thePTol,
const Bnd_Box& theCBox,
Standard_Real& aTB1,
Standard_Real& aTB2)
Added protection for large values of parameters of the edges.
2. methods
static Standard_Boolean BndCommon(const Bnd_Box& theB1,
const Bnd_Box& theB2,
Bnd_Box& theBOut)
and
IntTools_EdgeEdge::FindSolutions()
have been removed as redundant.
Test case for issue CR24823
class BOPAlgo_ArgumentAnalyzer
- method:
void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
The new shapes has been excluded from the treatment
void BOPAlgo_CheckerSI::PostTreat()
The new shapes has been excluded from the treatment
Standard_Integer bopcheck
(Draw_Interpretor& di, Standard_Integer n, const char** a )
The new shapes has been excluded from the treatment.
The interferences of the type */Solid has been included in the treatment.
Test case for issue CR24764
void BOPAlgo_CheckerSI::PrepareCopy()
has been added.
Purpose:
- provides the copy of the argument
- provides links between the copy and the original
- protected method:
void BOPAlgo_CheckerSI::PostTreatCopy()
has been added.
Purpose: provides post treat actions wit the copy.
void BOPAlgo_PaveFiller::Perform()
The try/catch mechanism is used inside the method
Standard_Integer bopcheck
(Draw_Interpretor& di, Standard_Integer n, const char** a )
The redundant copying is removed.
Standard_Integer bopargcheck
(Draw_Interpretor& di, Standard_Integer n, const char** a )
The redundant copying is removed.
packages:
BOPAlgo
BOPTest
Test cases for issue CR24620
Small correction of text case for issue CR24620
License statement text corrected; compiler warnings caused by Bison 2.41 disabled for MSVC; a few other compiler warnings on 54-bit Windows eliminated by appropriate type cast
Wrong license statements corrected in several files.
Copyright and license statements added in XSD and GLSL files.
Copyright year updated in some files.
Obsolete documentation files removed from DrawResources.
Added new parameter to bopcheck command that defines which interferences to check:
bopcheck shape [level of check: 0 - 5]
Examples:
1. bopcheck shape 1
#The level of check is set to V/E, i.e. intersections #E/E, V/F, E/F, F/F will not be checked.
2. bopcheck shape 4
#The level of check is set to E/F, i.e. intersection F/F is disabled.
3. bopcheck shape 5
#All intersections will be checked. It is the same as bopcheck shape.
Added test case bugs/modalg_5/bug24029
Additional check has been added in IntTools_BeanFaceIntersector::FastComputeExactIntersection() to prevent
creating an Edge/Face intersection for the case when edge lies on the surface of the face, but not on the face itself.
Adding test case for this fix
Modifications:
- BRepOffset/BRepOffset_Tool.cxx, Features and Fillets algorithms have been ported on new BO algorithm.
- Old BO algorithm, that was implemented in BOP, BooleanOperations and BOPTools packages, has - been deleted.
- Porting SALOME algorithms to new BOP algorithm.
- Fixing regressions. Rebased on current master.
- Corrections in post treatment of section edges;
- Corrections in the accordance with the bug 0023293;
- Small corrections in the bopcheck and bopargcheck commands.
- NCollection maps have been replaced by NCollection indexed maps to guarantee the constant order of sub-shapes in the result of boolean operation.
- Test case feat featprism M9 has been fixed.
- Test cases chl 902 E3 H3 have been fixed (corrections in the treatment of section edges).
- Test cases caf driver B6 B7, caf named_shape F6 F7 have been modified according to the new order of sub-shapes in the result of boolean operation.
- Test cases blend buildevol G1, blend simple K4, bcommon_complex C7, feat featprism L6 have been modified as they are improvements.
- Test case boolean bsection A3 has been modified according to the new syntax of the bsection command.
- Test cases boolean bfuse_complex J1 P9 have been fixed (the function IsInternalFace has been modified to use the function GetFaceOff);
- Test case chl 902 H3 has been fixed (changes in the treatment of section edges);
- Test case boolean bsection D8 has been modified (removed TODO statement);
- Test case boolean bsection A3 has been modified (as the shapes have been changed).
- Added correction of the tolerance values of the shapes according to the bug 0023610.
- test cases:
boolean bcommon_complex C3,
boolean bcut_complex F2 O7,
boolean bfuse_complex C4 C5 E4,
boolean bsection B6 M8 M9 N4 N5 N7,
boolean bfuse_simple ZP6,
draft angle G8,
feat featprism S2
have been marked as invalid according to the bug 0022033;
- New value of result has been set in the test cases :
boolean bopsection D4
boolean bsection R8
as it is correct.
- test case bugs modalg bug23472 has been rewritten according to the new format of bsection command.
- The classes IntTools_Context and IntTools_ShrunkRange have been replaced by BOPInt_Context and BOPInt_ShrunkRange accordingly.
- The new class BRepAlgoAPI_Check has been added according to the bug 0023648.
- Some regressions have been fixed.
- The following test cases have been marked as invalid or rewritten
bugs modalg buc60462_2, 60531_2, 60776_1, bug472_1, bug472_2, bug472_3, bug497_3, bug62
bugs moddata bug26_1, bug26_2,
- The test case bugs modalg buc60533 has been rewritten to use the general fuse algorithm for building the result.
- The new value of the result has been set in the test case bugs modalg 60776_2.
- The following test cases have been rewritten according to the new format of the bsection command
bugs modlag fra62369, pro18892
bugs moddata bug75_1, bug75_2
- Corrected BRepAlgoAPI_Check.
- Removed package BOPTColStd.
- Rewritten test cases caf named_shape F8 F9.
- Removed unnecessary comments.
- Corrected the following test scripts :
boolean bcut_complex(012) O3 O4 O5 O6 O8
boolean bfuse_complex(013) O5 O6 P8
boolean bopcommon_complex(021) D8 D9
boolean bopfuse_complex(022) H1 J6
boolean boptuc_complex(024) D5
bugs modalg(006) bug399 bug497_1
feat featprism(003) C4
- Corrections in the treatment of section edges (putting paves on the curves);
- Corrections in BRepOffset_Tool;
- The following test cases have been rewritten according to the new format of the bsection command
bugs modalg bug6502, bug6554, bug6766_1, bug6766_3
- The new value of the result has been set in the following test cases
bugs modalg bug1255, bug1255_1
- The following test cases have been marked as invalid or rewritten
bugs modalg bug472_2, bug472_3, bug825_2
bugs moddata bug10603, bug152_1, bug152_2, bug3721_1, bug3721_2, bug3721_3
- The following test cases have been rewritten as improvements
bugs modalg bug693, bug693_1, bug817_1
bugs moddata bug3721_5, bug3721_6, bug6862_3, bug6862_4, bug6862_6
- Test cases bugs modlag buc60787_1, buc60787_2, buc60788_2, buc60788_3 have been corrected.
- Fixed some SALOME regressions (modifications in the treatment of the section edges);
- Fixed test case bugs modalg bug23100;
- Test cases bugs modalg bug21754, bug22990 have been corrected according to the new format of the bsection command.
- Test cases bugs modalg bug13116_*, bug23711 have been fixed;
- Test cases bugs modalg bug697_2, bug697_4, bug697_7, bug697_8 have been marked as invalid according to the issue 0022033;
- Test cases bugs modalg bug22109_2, bug22109_3 have been corrected;
- Test case bugs modalg bug18186 has been corrected as it is improvement;
- Test case bugs modalg bug22802 has been deleted as there is no package BOPTColStd.