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.
Implementation of the mechanism for unification of the history commands for all OCCT algorithms.
The following Draw commands should be used to track the history of shapes modifications of any operation:
- modified - to find the shapes modified from the given shape in the given history.
- generated - to find the shapes generated from the given shape in the given history.
- isdeleted - to check if the given shape has been deleted during operation.
The mechanism allows fast & easy enabling of the DRAW history support for the algorithms supporting the history on the API level (i.e. the algorithm should have the methods Modified(), Generated() and IsDeleted()).
To enable the draw history support it is necessary to store the history of the algorithm into the session. For instance:
TopTools_ListOfShape Objects = ...; // Objects
TopTools_ListOfShape Tools = ...; // Tools
BRepAlgoAPI_Cut aCut(Objects, Tools); // Boolean cut operation
BRepTest_Objects::SetHistory(Objects, aCut); // Store the history for the Objects (overwrites the history in the session)
BRepTest_Objects::AddHistory(Tools, aCut); // Add the history for the Tools
To get the stored history in draw the command "savehistory" should be used. It saves the history kept in session into a Drawable object with the given name:
# perform cut
bcut r s1 s2
# save history of cut
savehistory cut_history
explode s1 f
modified m cut_history s1_1
The Draw History commands of the following algorithms have been removed:
- Boolean Operations;
- Defeaturing;
- Unify same domain;
- Sweep;
- Thrusections;
All these algorithms have been switched to support the new Draw history mechanism.
The Fillet and Blend algorithms have been also enabled to support history commands.
Boolean operations - Allow repeated intersection of edges to find the coinciding pairs.
Previously, only the edges rejected by bounding boxes classification has been additionally checked on coincidence. The current patch removes this filter allowing all edges with coinciding vertices to be checked on coincidence.
Adjustment of the test cases for current behavior:
1. The following cases are improvements:
boolean volumemaker A8
bugs modalg_1 buc60703_1
bugs modalg_1 buc60703_2
bugs modalg_1 buc60703_4
bugs modalg_6 bug26789_1
bugs modalg_6 bug26789_2
bugs modalg_7 bug26883_4
bugs modalg_7 bug27948
2. bugs modalg_7 bug29580_1 is modified to extend the validity checks.
Test parse rules are improved to recognize messages with word 'fail' or 'failure' as errors.
Test cases are corrected accordingly (TODO or REQUIRED statements added where fail messages were not noticed previously).
Boolean Operation - avoid creation of INTERNAL solid from unclassified faces in Solid Builder algorithm.
Instead warn the user that some of the faces have been unclassified and not used for solids creation.
Adjustment of the test cases.
Test cases for the issue.
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*.
1. Implementation of the *Generated* method for the algorithms in Boolean Component.
In terms of these algorithms the shape from the arguments can have Generated shapes only if these new shapes have been obtained as a result of pure intersection (not overlapping) of this shape with any other shapes from arguments.
Thus, the Generated shapes are always:
* VERTICES created from the intersection points and may be Generated from edges and faces only;
* EDGES created from the intersection edges and may be Generated from faces only.
So, only EDGES and FACES could have information about Generated shapes. For all other types of shapes the list of Generated shapes will be empty.
2. Optimization and simplification of the Modified and IsDeleted methods based on the correct filling of the BOPAlgo_BuilderShape::myImagesResult map.
3. Provide history of unification of the solids in the CellsBuilder algorithm.
4. Update of the documentation of Boolean Operations User guide with new chapter "History Information" describing rules for filling history for operations in Boolean Component.
5. Test cases for the issue. New grid "history" has been added into "boolean" category.
Wrong distance computation has been corrected.
Some test-cases have been corrected according to their new behavior. Namely, built (by approximation algorithm) curve(s) has changed its geometrical position.
1. tests/blend/simple/X4
It is not a regression because the result is not correct on both MASTER and FIX (see explanation in the issue #26740). This problem is expected to be solved after porting Fillet-algorithm to new Boolean operation. Old Boolean operations do not cover Edge-Edge tangent-zone by vertex.
2. tests/bugs/modalg_6/bug27341_318
"checknbshapes" has been deleted in order to avoid non-stable behavior (see issue #29360) of this test case. New result is OK on both Linux and Windows platform.
1. Unify the faces classification procedure of the methods BOPAlgo_BuilderSolid::PerformInternalShapes() and BOPAlgo_Builder::FillIn3DParts() using the latter as a base.
The new method BOPAlgo_Tools::ClassifyFaces() has been created for that. Both methods mentioned above have been updated to use the new one.
2. Forced intersection of the edges after enlarge of the tolerance values of their vertices during the operation has been added into BOP's intersection algorithm (BOPAlgo_PaveFiller).
BOPAlgo_Tools::PerformCommonBlocks() method has been updated to avoid loosing faces of the already created Common blocks.
As a result the case "boolean gdml_private ZF6" became more stable, because the intermediate result is no longer invalid.
Additional test cases have been added to verify this improvement (bugs modalg_7 bug29322_*)
3. When building PCurves for edges on faces, check the existing PCurves on its validity for periodic surfaces and adjust PCurves if necessary.
The improvement helps to produce the valid result in the test case "bugs moddata_1 bug152".
4. Avoid creation of empty Edge-Edge interference if the intersection point is lying close to a shared vertex.
The improvement helps obtain the valid result of the "bopcheck" operation in the test case "bugs modalg_7 bug27683".
Adjustment of the test case to current behavior:
- Avoid usage of the self-intersecting torus in the test case "boolean gdml_public A9".
- Fix the input shape in the test case "boolean bopfuse_complex H1" to provide valid result.
- Test cases "bugs moddata_1 bug152_1 bug152_2" have been unified into single test case "bugs moddata_1 bug152". Now, the case rebuilds invalid input data and performs all types of Boolean operations.
- Change the test case "bugs modalg_7 bug22750" to produce valid intermediate results used in subsequent operations as arguments.
- The following test cases are improvements:
- "boolean volumemaker D8"
- "boolean volumemaker G1"
- "bugs modalg_7 bug27683"
Improve performance of Boolean operations algorithm by:
- Improving the check of Same Domain faces (BOPAlgo_Builder::FillSameDomainFaces());
- Faster rejection of outer faces for solids using Bounding Box classification first (BOPAlgo_Builder::FillIn3DParts());
- Using IncAllocator for local containers.
Quality improvement has been made in BOPAlgo_PaveFiller class:
1. Method IsExistingPaveBlock() has been corrected to provide the correct edge tolerance and to obtain valid intermediate results in the test case "boolean gdml_private ZH3".
New test case have been added to verify this improvement (bugs modalg_7 bug29301).
2. Method PutClosingPaveOnCurve() has been corrected to use the tolerance of the pave put on the bound for checking curve on closeness.
Additional check for the curve to have valid range after addition of the pave on the other end has been added to prevent considering the small curves (covered by vertex tolerance) as closed ones.
As a result of this modification the test case boolean gdml_public B2 has been fixed (TODO removed).
Adjustment of the test cases to current behavior:
- boolean bopcommon_complex J1 - the produced result was incorrect as it was self-interfered. There should be no common in this case.
- offset shape_type_i_c ZZ1 - the incorrect result is now produced instead of null shape.
In order to improve performance of Boolean Operations on the relatively fast cases the following improvements have been made:
1. Initialization of the FaceInfo information for the faces participating in Face/Face interference, even when the gluing is ON, to take into account intersection of their sub-shapes.
2. Code simplification & duplication removal - the methods BOPAlgo_ShellSplitter::MakeConnexityBlocks and BOPAlgo_WireSplitter::MakeConnexityBlocks have been unified into BOPTools_AlgoTools::MakeConnexityBlocks.
3. Avoid unnecessary bounding box computation for solids during DS initialization. The bounding boxes for solids will be computed during the building stage to find faces located inside solids.
For the shape self-interference check (performed by the BOPAlgo_CheckerSI), the bounding box is still computed, as it is necessary to resolve Shape/Solid intersections.
4. Use only three sample points to check coincidence of line and plane.
5. Perform necessity of planes intersection only when the gluing is off.
6. Avoid repeated initialization of 2D classifier while building splits of the faces.
7. Post treat stage:
7.1. Method CorrectWires: Save edge's data (PCurve, parameter of the vertex, range) to avoid its recalculation.
7.2. Method CheckEdge: While checking vertices on edges avoid unnecessary calculation of their location.
8. Provide possibility to disable the classification of the input solids on the inverted status (to be the holes in the space).
9. Avoid building of bounding boxes for faces/solids during splitting of the input arguments for their classification relatively hole faces/shells if there are no holes created.
10. Avoid rebuilding of the faces/solids from arguments which does not acquire any inside parts from other arguments during the operation by using their draft versions as their splits.
Test cases for the issue.
Correction of the test cases boolean gdml_public A9 and bugs modalg_7 bug28485 as they are improvements.
Additional test case for the issue #28485 as it is fixed by the current changes.
When removing internal boundaries between faces of the same material do it once for the whole shape, and at this keep boundaries between areas with different material.
Make possibility to dramatically increase the step during iteration on the curve when the global resolution of the curve is too small.
Correct the functions FindParameters, FindBestSolution, FindDistPC.
The change caused improvement of the test case "boolean bfuse_complex E4", so the bug #27697 has been fixed.
The change caused dramatic improvement of the performance of the test "bugs modalg_7 bug27160", and the bug #29080 has been fixed.
Test for 0027049: Make non-destructive mode be defined by default in Boolean operations
Test for 0027052: Test boolean gdml_private ZI5 failure
Test for 0027069: IGES parser does not recognize comments in Parameters section
Test for 0027090: Point is classified IN solid but actually it is OUT
Test for 0027170: Reading STEP files produces invalid shapes
Test for 0027186: IGES - reconsider creation of Undefined entity in case of failure
Test for 0027214: Duplicate of test cases
Test for 0027224: Incorrect result of boolean operation in boolean bcut_complex Q1 test case
Test for 0027227: Intersection curve is not continued to the surface boundary
Test for 0027246: ShapeFix_Shape destroys shape
Test for 0027251: Shape becomes invalid when exported to STEP and imported back
Test for 0027316: exception when XAddShape
Test for 0027378: BRepLib_MakeFace produces invalid faces on periodic surfaces in case the given parametrization does not match the default
Test for 0027390: Box and Ellipsoid shape boolean cut and common introduce invalid result.
Test for 0028119: Blend fails on fused identical but shifted tori
Test for 0028144: Step reader - regression in comparison of version OCCT654
Test for 0028151: Sewing faces results in a shell with very big tolerance
Test for 0027160: Weird results of the pipe algorithm
Test for 0027623: Cannot find intersection line between two trimmed planar surfaces
Test for 0027683: Inaccurate result by bopcut
Test for 0027687: Section between shells of hull and deck is not closed
Test for 0027711: Blend-on-blend corrupts the shape
Test for 0027784: Thickness fails on cylinder with draft
Test for 0027908: Exception during offset computation
Test for 0027909: Exception during offset computation
Test for 0027910: Sharing between edges was lost after offset operation
Test for 0027911: Exception during offset computation
Test for 0027912: Exception during offset computation
Test for 0027928: BOP common produces empty compound
Test for 0027948: Cut produces unexcpected shape
Test for 0027950: Result of intersection algorithm depends too much on surface trim bounds
Test for 0027701: Crash when export empty solid to STEP
Test for 0027722: STEP error for Ellipse revol shape
Test for 0023838: Standard_OutOfRange in Geom_OffsetSurface::LocalDN (called by BRepFill_PipeShell)
Test for 0023866: GccAna_Circ2d3Tan does not find a circle
Test for 0023925: BRepFeat_SplitShape produces invalid shape
Test for 0023942: Pipe algorithms unrobust to number rounding
Test for 0025385: steep increase in tolerance by intersection
Test for 0025395: SIGSEGV in BRepOffsetAPI_MakeThickSolid
Test for 0025458: can a sweep be used to create 1-fold tori (using a closed wire as path)
Test for 0025478: Fillets can not touch
Test for 0025481: Edge must not contain obsolete curve representations
Test for 0025515: Boolean operation become worse for unknown reason.
Test for 0025521: Fillet creates shell with bad orientation of SubShape
Test for 0025551: BRepMesh can produce internal nodes outside the face interior based on distorted BSpline surface
Test for 0025586: Poor mesh quality, or failure of meshing for closed extruded surfaces with holes
Test for 0025626: Loft of ellipses shows wrinkle near seam edge
Test for 0025628: BRepMesh fails to mesh face with open wire, considered as correct by checkshape
Test for 0025693: Wire of BSplines fails bopcheck
Test for 0025730: result of MakeThickSolid aborts the BOPCheck in Geom_OffsetSurface::SetD0
Test for 0025738: BRepMesh fails to produce correct mesh for the face
Test for 0025776: HLR returns intersecting edges in OutLineV of helical sweep
Test for 0025798: BRepFeat_SplitShape returns invalid result
Test for 0025817: crescent face is not meshed
Test for 0025827: BRepMesh does not synchronize parameters of glued vertices on small edges
Test for 0025837: Bad triangulation when IGES loaded in meters
Test for 0025852: Text to BRep algorithm produces bad faces for circled symbols
Test for 0025856: BRepOffsetAPI_ThruSections returns an invalid shape if one wire contains degenerated edges
Test for 0025879: result of blend fails the bopcheck
Test for 0025967: Shape Healing fails to correct a face with missing poles and pcurves
Test for 0026052: Missing pcurves are computed incorrectly on two connected faces laying on the same surface
Test for 0025061: BRepMesh should skip internal wires with self intersections to produce mesh for the shape anyway
Test for 0024490: Computed surface properties differ substantially depending on NaturalRestriction flag
Test for 0024568: Split shape produces an invalid result
Test for 0024692: fuseedge corruption of spherical edge
Test for 0024772: Intersection of cylinder and cone produces incorrect results
Test for 0024954: BRepBuilderAPI_MakeFace adds wire with aribitary orientation
Test for 0025104: Prism from BSpline curve can not be chamfered
Test for 0025206: Fillet creates edge with C0 continuity
Test for 0025979: fillet creates faces with non-closed wires
Test for 0025983: Fusion of sweep and its mirror invalid
Test for 0025994: Boolean fuse result in invalid result.
Test for 0026034: Result of revolution aborts the bopcheck if translated
Test for 0026077: nurbsconvert of psphere fails the bopargcheck
Test for 0025989: toridial surface gets damaged in STEP export
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 CellsBuilder algorithm has been extended to work with multi-dimensional arguments.
It has become possible not only simulate Boolean expressions, but also perform non-supported
Boolean operations, like cutting face from solid, or fusing face with edge.
2. Test cases with multi-dimensional input shapes have been created.
3. Documentation has been updated.
Generation of 3D-steps shorter than 3D tolerance has been allowed in the fix to build Walking-line.
Now, 3D-step is limited by Precision::Confusion value.
1. The partition operation allows splitting an arbitrary number of shapes of an arbitrary dimension
by other arbitrary shapes. The algorithm has been implemented in the class BOPAlgo_Splitter.
The API operator Splitter has been implemented in the class BRepAlgoAPI_Splitter.
2. The draw commands for usage the new algorithm have been implemented - bsplit and bapisplit.
The commands are identical, but one uses the BOPAlgo_Splitter, the other uses BRepAlgoAPI_Splitter.
Both commands should be used after Pave Filler is filled.
3. Test cases for the new algorithm.
4. Documentation has been updated.
Small corrections.
1. The algorithm BOPAlgo_ShellSplitter has been improved for the cases with multi-connected edges
to produce as many shells as possible from the given input faces.
2. Building tool prism in BRepFeat_MakePrism has been changed in order to avoid self-intersections
in the cases when the limiting faces are intersecting.
3. Test cases for the issue.
4. Test cases boolean/bcut_complex/N9 and boolean/gdml_private/ZH3 are improvements.
5. Test cases boolean/volumemaker/C5 and boolean/volumemaker/C6 has been marked as BAD due to found problem in intersection algorithm.
The results in these cases obtained on the branch are better than on master, but still not complete.
Adjusting test case bugs/moddata_2/bug469 for its current behavior.
1. Exception in intersection of two analytical faces has been fixed by adding a simple check on number of vertices
in the resulting analytical curve;
2. Projection of the Circle on the Cone now checks if the Circle's normal direction is parallel to the Cone direction.
If it is not, the different, more advanced, algorithm will be used for projection - ProjLib_ComputeApprox;
3. Intersection of the Edge with the Face (IntTools_EdgeFace algorithm) in QuickCoincidenceCheck mode has been fixed to
avoid the checking of the type of the intersection result if the coincidence check gives the positive result;
4. All common IN edges of the intersecting faces has been added for intersection with section edges to avoid self-intersection in the result;
5. Post treatment of the section edges in Boolean operations has been improved with the new stage which treats the possible
common zones, not detected by the intersection algorithm, between faces by intersecting each section edge with all faces,
not participated in its creation, and in case of coincidence putting it as IN edge into FaceInfo structure of the face.
The new function has been implemented for that - BOPAlgo_PaveFiller::PutSEInOtherFaces().
6. Checking for the SameDomain splits of faces in Boolean Operations has been modified to process the pairs of faces in
which both the section curves and common zones are present.
7. Adjustment of the test case boolean gdml_private ZH3 as improvement.
8. Test cases for the issue.
9. Test cases for the parent issue - 0026789.
1. The static method Standard_Real MinStep3D(...) in the class BOPTools_AlgoTools is
now checks if the computed 3D step is too big (relatively UV range of the faces)
for any of the faces.
2. The method PointInFace(...) of the class BOPTools_AlgoTools3D has been redesigned.
The new PointInFace(...) methods have been implemented to add possibility for looking the point
inside the face in necessary direction and distance from the edge of the face.
Note: old implementation is also functional.
3. Make methods for finding points near edges and computing normal directions on faces
return error status (0 in case of success).
4. Test case for the issue.
5. Test cases offset shape_type_i_c XJ2,XJ4,XJ5,XJ6 are improvements.
Removing useless file
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.
1. The result of Boolean operation on the arguments of collection type, containers WIRE/SHELL/COMPSOLID, is also a collection.
The containers of type WIRE included into result should now also (as the SHELLs) have coherent orientation of its sub-shapes.
For that the new method has been implemented (BOPTools_AlgoTools::OrientEdgesOnWire(TopoDS_Shape&)) which reorients edges for correct ordering.
The duplicating containers, i.e. containers with the contents completely included in other containers, are now avoided in the result of BOP.
2. The result of Fuse operation on Compsolids is now also will be Compsolid.
3. Documentation has been updated.
4. New test cases for the issue.
5. Adjusting test cases to current behavior.
Correction of test case bugs/modalg_4/bug726_2 according to the new behavior
When fuzzy option is in force prevent increasing tolerance of input shapes. Instead pass increased by fuzzy value the tolerances of sub-shapes everywhere where it is needed by intersection algorithms.
The following changes in API have been made:
- The methods SetFuzzyValue and FuzzyValue have been moved from the classes BOPAlgo_ArgumentAnalyzer, BOPAlgo_Builder, and BOPAlgo_PaveFiller to the base class BOPAlgo_Algo.
- The public method BOPDS_DS::VerticesOnIn has been renamed to SubShapesOnIn, and the new output parameter theCommonPB has been added.
- In BOPTools_AlgoTools, a new argument "theFuzzyValue" has been added in the methods ComputeVV and AreFacesSameDomain.
- In IntTools_Context, a new argument "theFuzzyValue" has been added in the methods ComputeVE and ComputeVF.
- The methods SetFuzzyValue and FuzzyValue have been added in the classes IntTools_EdgeEdge, IntTools_FaceFace.
- In the class IntTools_EdgeFace, the methods SetTolE, SetTolF, TolE, TolF have been removed, and the methods SetFuzzyValue, FuzzyValue have been added.
- The new argument "theTol" has been added in the method IntTools_WLineTool::DecompositionOfWLine.
Some improvements in algorithms have been made during fighting with regressions:
- Correct initialization of pave blocks for degenerated edges.
- In BOPAlgo_PaveFiller::MakeBlocks(), filter out paves on intersection curve that were put on the curve accidentally due to wide range of E-F intersection vertex.
- In the method IntTools_Tools::ComputeTolerance the margin added to the computed tolerance has been increased up to 0.001%.
- The method BOPAlgo_PaveFiller::PutPaveOnCurve has been corrected in order to use the original vertex tolerance instead of the value increased during putting it on other curves.
- The new method BOPDS_PaveBlock::RemoveExtPave has been added.
- The vertex tolerance computation in BOPTools_AlgoTools::CorrectCurveOnSurface has been improved, taking into account intersection segments between p-curves (to avoid regression on "bugs modalg_6 bug22794").
- Improve IsExistingPaveBlock to make more stable catching of coincidence of common block with section curve (against regression "bugs modalg_4 bug697_2" on Linux).
Test case for the bug has been added.
The following test cases have been updated as improvements:
boolean gdml_private ZH2 ZI7 ZJ7
boolean volumemaker C4
The test case bugs/modalg_4/pro19653 has been corrected to make it stable. See comment inside the script for details.
The test case bugs/modalg_6/bug25880 has been corrected to suppress wrong bfuse commands.
The test bugs/modalg_6/bug26954_3 has been corrected to compare the result with more precise reference value.
The "faulty" TODO in boolean/volumemaker/A8 has been made actual for Linux as well.
//Eliminate compilation error on Linux.
1. BOPAlgo_MakerVolume - Taking into account the possibility of Same Domain faces
while collecting the faces for building the solids;
2. BOPDS_DS - Making the check on coincidence of edges consistent with the intersection
algorithm which also adds the Precision::Confusion() to the intersection tolerance;
3. Test case for the issue.
4. Adjusting test cases (improvements) to their new behavior.
In ProjLib_ComputeApprox algorithm, compute correct parametric tolerance from the input 3D tolerance using surface resolution, in order to pass it to low-level 2D algorithm Approx_FitAndDivide2d (instantiation of the generic class Approx_ComputeCLine). Earlier 3D tolerance was used as parametric tolerance directly, which was a problem for surfaces with too small radius of curvature.
Also, eliminate redundant creation of the object of type AppParCurves_MultiCurve on each iteration in the method Approx_ComputeCLine::Compute.
The post treatment of the Edge/Edge intersections has been improved. Namely:
a. Making the procedure of sharing Edge/Edge intersection vertices consistent with intersection algorithm by enlarging bounding box of each vertex on half of Precision::Confusion();
b. Algorithm of computation of vertex tolerance (in order to cover tangent zone between Edges) has been changed for Line/Circle cases.
Test cases for issue CR27804
Adjusting test cases according to their new behavior.
Mark the test boolean/volumemaker/A8 as unstable between different versions of MSVS (2010 and 2013).
1. IntTools_ShrunkRange::Perform
The algorithm of building shrunk range on the edge has been redesigned to make this range as big as possible.
By new definition it has to have the length not less than Precision::Confusion().
Although, the possibility of splitting of the edge has been taken into account. If it is impossible to put
vertex on edge in such a way that the tolerance spheres of the edge's vertices do not intersect the tolerance
sphere of the putting vertex the edge cannot be split. This possibility is saved in the new field
IntTools_ShrunkRange::myIsSplittable. It can be checked by the corresponding method IntTools_ShrunkRange::IsSplittable().
It returns TRUE if the shrunk range is computed successfully and it has the length more than the value of sum of two tolerance
values of the edge (for putting vertex, as its tolerance should not be less than the tolerance value of edge) and
two Precision::Confusion() values (to make two new edges valid by Shape validity criteria).
IntTools_ShrunkRange::myErrorStatus and IntTools_ShrunkRange::ErrorStatus() have been replaced by
the IntTools_ShrunkRange::myIsDone and IntTools_ShrunkRange::IsDone(). IntTools_ShrunkRange::IsDone() returns TRUE
if the shrunk range has been computed and it has length more than Precision::Confusion().
All computations of the parameters are performed using the GCPnts_AbscissaPoint, but if AbscissaPoint is unable to
compute the parameters the Resolution of the curve is used.
2. Boolean Operations algorithm now partially works with the edges that cannot be split or does not have the ShrunkData
at all (previously such edges have been considered as micro and just ignored). If by the result of some intersection such
edges should be split, i.e. the intersection vertex should be created, the algorithm just ignores them and no vertex is created.
But if such edges coincide with other shapes (other edges or faces) the algorithm uses them for creation of common blocks.
The information of the possibility for the edges to be split is saved in its PaveBlocks, in the new BOPDS_PaveBlock::myIsSplittable field.
It can be retrieved by the BOPDS_PaveBlock::IsSplittable() or BOPDS_PaveBlock::ShrunkData(), but these methods
make sense only after filling of the shrunk data for the pave block.
BOPTools_AlgoTools::IsMicroEdge() has an additional parameter that defines whether it is necessary to take into account
the possibility for the edge to be split or not. By default it is set to TRUE, i.e. by default the edge will be considered as micro
even if the shrunk range is computed, but it is too short for the edge to be split.
3. BOPAlgo_PaveFiller::PerformEF
To avoid creation of too close intersection vertices the intersection ranges of the edges participating in Edge/Face
intersections are reduced taking into account the common ranges computed during Edge/Edge intersections.
Thus, the Edge/Face intersection vertex is not created if it gets into a common range of the Edge/Edge intersection
between that edge and one of the face's edges. The tolerance value of Edge/Edge intersection vertex is increased
to reach the Edge/Face intersection.
4. Unification of the vertices of the section edges considered as micro edges.
If by the result of some Face/Face intersection the section edge is considered as micro edge,
the vertices of this edge will be united and the edge itself will be removed.
5. Test cases for the issues.
6. Adjusting test cases for issue CR27448.
Add method for exact calculation of bounding boxes
Modifications made according to remarks.
Small correction of test case for issue CR27352
Small correction of test cases for issue CR27352
Avoid warning on VS2015
Tolerance of line / line analytical intersection is fixed.
Test cases are updated to the new behavior.
Update of test case according to the current behavior
Treatment for single singular point is added.
Test cases are updated to the new behavior.
New test cases are added,
Message of "bad" state is corrected.
Various improvements in point-solid classifier:
1) Refactoring.
2) BndBoxTree is extracted into separate class.
3) UB-tree calculation is cashed to improve point-solid classification speed.
4) Ray / curve intersection improved by trimmed parameters and correct order.
5) Fixes in logic.
6) Calculation caching at the classifier level.
3D-claasifier now takes into the account the vertex/edges tolerances. If the given point lays inside the tolerance area of vertex or edge of the solid it's classified as TopAbs_ON.
The behavior of IntCurvesFace_Intersector::Perform was changed. Now it may use optional null-tolerance to classify 2d-point relatively to the given face.
UBTreeFiller is used to speedup intersection process between edges/vertices and the point.
The test case 'boolean gdml_private ZH2' extensively uses the SolidClassifier. After this fix it returns the correct classification statuses, which leads to incorrect result shape (reported by checkshape). Yet the result shape without this fix also seems to be incorrect (one of the isolines goes out of boundary of the face). Thats why it's marked with 'TODO'.
Corrections in test cases.
Test case is added.
1. Check, if edge is same-range, is now made with some tolerance (not strictly) in GeomLib_CheckCurveOnSurface class. Default value of this tolerance is Precision::PConfusion(). However, this value can be changed with corresponding interface.
2. DRAW-command "attachpcurve" has been added to BOPTest_UtilityCommands.cxx file. This command creates p-curve of given edge on given face. It can assign 2D-curve of one of the edge already included in the face or (if it is not possible) rebuilds new 2D-curve.
Creation of test case for this issue.
Adjusting test case boolean volumemaker A8 according to its new behavior on Windows.
1. New sharing algorithm has been implemented. If intermediate point of some edge is included in the tube with center taken in another edge and radius equaled to maximal vertex-tolerance of both edges then these two edges are considered to be shared. This know-how touches edges only, which have common blocks with interfered faces. If they do not have any common-blocks the algorithm will work as before.
2. Interface of BOPAlgo_PaveFiller::IsExistingPaveBlock(...) method has been changed.
Creation of test case for issues #27128 and #27179
Adjusting some test cases according to their new behavior, because they are IMPROVEMENTS really (TODOs have been deleted).
The map to protect the result of Boolean operation from duplicating parts in containers has been removed (method void BOPAlgo_BOP::BuildShape()).
The results of Boolean operations on containers will be the following:
1. For the arguments of collection type (WIRE, SHELL, COMPSOLID) containing overlapping parts the overlapping parts
passed into result will be repeated for each container from the input shapes containing such parts.
2. The result of the operation Fuse for the arguments of collection type (WIRE, SHELL, COMPSOLID) will contain
the same number of containers as the arguments. The overlapping parts (EDGES/FACES/SOLIDS) will be shared among them.
For example, the result of Fuse operation between two wires will be two wires sharing coinciding edges if any.
3. The result of the operation Common for the arguments of collection type (WIRE, SHELL, COMPSOLID) will consist
of the containers containing the same overlapping parts. For example, the result of Common operation between two
fully/partially overlapping wires will be two wires containing the same edges.
Style correction.
Added test case bugs/modalg_1/bug13538
Modified boolean test cases according to new begavior
Use std::mt19937 random number generator instead of rand() in NCollection_UBTreeFiller.
boolean gdml_private ZI7 ZJ7 - TODO "bopcheck failed" is only for Linux now, checkshape faulty is unstable (issue #27052)
boolean volumemaker B6 - Added TODO (bopcheck and checkshape faulties)
boolean volumemaker C9 - Added TODO (checkprops and checkshape faulties)
boolean volumemaker D2 - Added TODO (checkshape faulty)
boolean volumemaker H4 - Added TODO (checkprops and checkshape faulties Linux only)
boolean volumemaker D5 - IMVPROVEMENT, TODOs were deleted (bopcheck and checkshape faulties)
bugs modalg_1 buc60462_2 - modified TODOs according to new behavior
boolean gdml_private ZI7 ZJ7 - unstable case, added check for surface area and TODO
samples/tcl/ANC101.tcl - amended due to changed order of edges in BOP result
- Avoid reducing tolerance of the original edges in BOPAlgo_PaveFiller::CorrectToleranceOfSE
- If a boundary edge is considered coincident with a section curve then increase its tolerance more carefully, using real distance instead of extended reached tolerance.
- New test case bugs/modalg_6/bug27032
- Test cases boolean/gdml_private/E4-F3 have been amended to check area of the result.
- Puts TODO in test cases boolean gdml_private ZI5,ZI7,ZJ7.
- Update of mfc samples
- Adjustment of test cases
- Update of CSharp sample (lost button added)
- Corrected paths to data files in 07_Triangulation mfc sample
- Update of overview (Requirements section)
- Update of upgrade guide (changes in modeling algorithms)
0026796: The result of General Fuse operation is self-intersecting shape
The fix forces creation of new sub-shapes (vertex, edge) when the tolerance of some sub-shape of an argument is to be increased.
This new behavior is turned off by default. It can be turned on using two ways:
1) Setting 'locking' flag of the arguments.
2) Calling the method SetNonDestructive(Standard_True) of the API classes.
Various bug fixes in the algorithm:
- Compute correct tolerance values for intersections of type Line/Line, Line/Plane, Plane/Plane.
- In case of Line/Plane intersection check if line's vertices lie on the plane.
- Do not allow decreasing of the tolerance value of the Line/Line intersection vertex.
- In IntTools_EdgeEdge, call the method FindParameters with proper 3D tolerance of the curve.
- Force making copy of a degenerated edge if its vertex is touched but no 2D intersection with other curves is found.
- Remove pave blocks both ends of which became referring to the same vertex after vertices substitution.
- Avoid exception in IntTools_Context::IsVertexOnLine if Extrema is not done.
- Reduce tolerance of vertex/edge using actual distances to interfered shapes if it was increased due to line/line, line/plane, or plane/plane small intersection angle.
- Update tolerance of edges to reach all representations in a common block.
- In V-E intersections, check if a vertex hits beyond shrunk range, in such case create V-V interference.
- Do not put a section edge to the result if it becomes to be a micro edge after updating its vertex.
- Correctly make vertices same-domain during the work of MakeBlocks.
- Decrease shrunk range at least on a Precision::Confusion() in addition to vertex tolerance.
- Add Confusion to bounding boxes of new shapes in DS
- Add tolerance Precision::Confusion() to compare distances of touching cases to fix regressions.
TODO marks have been removed from (or modified in) the following test cases (Improvements):
boolean bsection M3 N2 R2
boolean gdml_private B6 C2 C6 G7 I6 F6 J1 J4 M7 N1 N8 N9 O3 O4 O6 O8 O9 P1 P2 P5 Q1 Q3 Q5 S9 T2 U4 U5 U9 ZB5 ZB6 ZC1 ZC5 ZD3 ZD6 ZD7 ZH2 ZH5 ZI2 ZI5 ZI7 ZI9 ZJ3 ZJ4 ZJ7 F8 I6 G1
boolean volumemaker A5 A6 B3 B4 B7 B9 D3 D4 D7 F1
boolean bopcut_2d D5
bugs modalg_5 bug25043
bugs modalg_2 bug472_1 bug472_2 bug472_3
Test cases updated because they are still bad but can be accepted as non-regression:
boolean volumemaker C4 A3 A7 E6
bugs modalg_1 bug10232
boolean bsection N2
Put new TODO in the scripts:
bugs modalg_5 bug25232_9
bugs modalg_6 bug26619
bugs modalg_1 buc60462_2
bugs modalg_4 bug772
For the following tests the result in fix became better, so take fix result as the reference:
bugs modalg_5 bug24628
bugs modalg_6 bug26954_3
boolean volumemaker A4 B5 B6 C3 C8 D2 D5 F2
bugs modalg_2 bug472_2
bugs modalg_1 buc60776_1
- Add the method SetNonDestructive to API classes of user level
1. Intersection curve was not bounded by faces domain. It was the reason of big edge tolerance. This problem has been fixed.
2. Interface bopcurves DRAW-command has been changed in order to make possible to reproduce intersection problem.
Creation of test case for this issue.
- Added function checkprops, set default tolerance parameter to 1.0e-4
- Using "area" instead of "square".
- Options "-equal\notequal" isn't used together with "-s" in blend and offset test cases.
- Correct regressions/differences/improvements and CPU problem (set props tolerance to 0.1)
- Corrected test cases to use checkprops proc.
- Correct image difference
- Updated TODOs in test cases.
- Updated test cases to get correct images of result shape
This branch contains fixes for 26675 and 26431 bugs.
1. Normalization has been eliminated.
2. Interfaces of AppDef_Compute::Parametrization(...) and BRepAlgo_BooleanOperations::SetApproxParameters() methods have been changed.
3. Overloaded methods for ApproxInt_Approx::SetParameters(...), TopOpeBRepTool_GeomTool::GetTolerances(...) and TopOpeBRepTool_GeomTool::SetTolerances(...) have been removed (because some fields of these classes are not used more).
4. Comments for some methods have been changed in BRepApprox_TheMultiLineOfApprox.hxx and GeomInt_TheMultiLineOfWLApprox.hxx files.
5. Some fields have been deleted from ApproxInt_MultiLine class. Kept members have become constant.
6. Interface of ksection DRAW-command has been changed.
7. Now, 2dintersect DRAW-command prints information about found segments.
8. Some code fragments have been rewritten to make them easier.
9. Algorithm of splitting WLine, which goes through pole of sphere has been improved.
10. Improve approximation algorithm in order to it will compute correct 2D- and 3D-tangent at the end of bezier constraints (including case when curve goes through or finishes on singular points).
11. Interface of IntPatch_WLine::Dump(...) method has been corrected.
12. Some methods for working with Walking-line are made more universal (available for both GeomInt and IntTools packages).
13. Problem in BRepLib::SameParameter(...) method has been fixed (see corresponding comment).
14. Small correction in Draft package.
15. Any outputs in IntPatch_Intersection::Dump(...) method have become disabled because they are useless. If anybody need in this outputs he/she will correct this method himself/herself.
Adjusting some test cases according to their new behavior.
Creation of new test cases.
----------------------------------------------------------------------------------------------------------------------------
Some explanation of new behavior of some test cases:
1. Regressions:
a) blend simple X4
The problem is described in the issue #0026740. According to this description, the result on the current MASTER seems to be wrong indeed.
b) boolean bcommon_complex C7 and boolean bcut_complex Q1
These test case use same shapes with different Boolean operation (COMMON and CUT). They are already BAD (on the MASTER). Now, some sub-shapes have become not-shared, simply. In my opinion, we shall apply new behavior of these tests.
c) boolean bsection M3
The problem described in the issue #0026777 exists even on the current MASTER.
d) boolean bsection M9
The problem is described in the message http://tracker.dev.opencascade.org/view.php?id=26815#c47546. Here, we have really regression in the picture.
e) boolean bsection N2
The problem is described in issue #0026814.
f) boolean volumemaker G1
The problem is described in issue #26020.
g) bugs modalg_1 bug1255 (and bug1255_1)
The problem is described in issue #26815.
h) bugs modalg_2 bug5805_18, bugs modalg_2 bug5805_42, bugs modalg_2 bug5805_46
The problem is described in issue #25925.
i) bugs modalg_3 bug602
The problem is describes in issue #602.
j) bugs modalg_5 bug24915
The problem is described in the message http://tracker.dev.opencascade.org/view.php?id=25929#c48565. It is not fixed by this issue.
k) bugs modalg_5 bug25838
The main reason is described in issue #0026816.
----------------------------------------------------------------------------
2. Improvements:
a) boolean volumemaker F9
b) bugs modalg_1 bug10160_3
c) bugs modalg_2 bug22557
d) bugs modalg_5 bug25319_1 (_2)
e) draft angle G2
f) offset shape A1
g) offset with_intersect_80 N7
The algorithm is based on the General Fuse algorithm (GFA). The result of
GFA is all split parts of the Arguments.
The purpose of this algorithm is to provide the result with the content of:
1. Cells (parts) defined by the user;
2. Internal boundaries defined by the user.
In other words the algorithm should provide the possibility for the user
to add or remove any part to (from) result and remove any internal boundaries
between parts.
Requirements for the Data:
All the requirements of GFA for the DATA are inherited in this algorithm.
Plus all the arguments should have the same dimension.
Results:
The result of the algorithm is compound containing selected parts of
the basic type (VERTEX, EDGE, FACE or SOLID). The default result
is empty compound. It is possible to add any split part to the result
by using the methods AddToRessult() and AddAllToResult().
It is also possible to remove any part from the result by using methods
RemoveFromResult() and RemoveAllFromResult().
The method RemoveAllFromResult() is also suitable for clearing the result.
To remove Internal boundaries it is necessary to set the same material to the
parts between which the boundaries should be removed and call the method
RemoveInternalBoundaries(). The material should not be equal to 0, as this is
default material value. The boundaries between parts with this value
will not be removed.
One part cannot be added with the different materials.
It is also possible to remove the boundaries during combining the result.
To do this it is necessary to set the material for parts (not equal to 0)
and set the flag bUpdate to TRUE.
BUT for the arguments of the types FACE or EDGE it is recommended
to remove the boundaries in the end when the result is completely built.
It will help to avoid self-intersections in the result.
It is possible to create typed Containers from the parts added to result by using
method MakeContainers(). The type of the containers will depend on the type of
the arguments: WIRES for EEDGE, SHELLS for FACES and COMPSOLIDS for SOLIDS.
The result will be compound containing containers.
Adding of the parts to such result will not update containers. The result
compound will contain the containers and new added parts (of basic type).
Removing of the parts from such result may affect some containers if the
the parts that should be removed is in container. In this case this container
will be rebuilt without that part.
History:
The algorithm supports history information. This information available through
the methods IsDeleted() and Modified(). In DRAW Test Harness it is available
through the same commands as for Boolean Operations (bmodified and bisdeleted).
Examples:
1. API
BOPAlgo_CellsBuilder aCBuilder;
BOPCol_ListOfShape aLS = ...; // arguments
/* parallel or single mode (the default value is FALSE)*/
Standard_Boolean bRunParallel = Standard_False;
/* fuzzy option (default value is 0)*/
Standard_Real aTol = 0.0;
//
aCBuilder.SetArguments(aLS);
aCBuilder.SetRunParallel(bRunParallel);
aCBuilder.SetFuzzyValue(aTol);
//
aCBuilder.Perform();
if (aCBuilder.ErrorStatus()) { // check error status
return;
}
/* empty compound, as nothing has been added yet */
const TopoDS_Shape& aRes = aCBuilder.Shape();
/* all split parts */
const TopoDS_Shape& aRes = aCBuilder.GetAllParts();
//
BOPCol_ListOfShape aLSToTake = ...; // parts of these arguments will be taken into result
BOPCol_ListOfShape aLSToAvoid = ...; // parts of these arguments will not be taken into result
//
/* defines the material common for the cells, i.e.
the boundaries between cells with the same material
will be removed.
By default it is set to 0. Thus, to remove some boundary
the value of this variable should not be equal to 0 */
Standard_Integer iMaterial = ...;
/* defines whether to update the result right now or not */
Standard_Boolean bUpdate = ...;
// adding to result
aCBuilder.AddToResult(aLSToTake, aLSToAvoid, iMaterial, bUpdate);
aR = aCBuilder.Shape(); // the result
// removing of the boundaries
aCBuilder.RemoveInternalBoundaries();
// removing from result
aCBuilder.AddAllToResult();
aCBuilder.RemoveFromResult(aLSToTake, aLSToAvoid);
aR = aCBuilder.Shape(); // the result
2. DRAW Test Harness
psphere s1 15
psphere s2 15
psphere s3 15
ttranslate s1 0 0 10
ttranslate s2 20 0 10
ttranslate s3 10 0 0
bclearobjects; bcleartools
baddobjects s1 s2 s3
bfillds
# rx will contain all split parts
bcbuild rx
# add to result the part that is common for all three spheres
bcadd res s1 1 s2 1 s3 1 -m 1
# add to result the part that is common only for first and third shperes
bcadd res s1 1 s2 0 s3 1 -m 1
# remove internal boundaries
bcremoveint res
Added history support for Generated shapes (created in ShapeUpgrade_UnifySameDomain).
Methods AddToResult and RemoveFromResult have been documented in more details to clarify the procedure of adding and removing parts.
Adding external library to use ShapeUpgrade_UnifySameDomain.
Test-cases for issue #26798