mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-21 10:55:33 +03:00
10 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
|
948fe6ca88 |
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. |
||
|
4f7d41eac3 |
0029604: Uniform mechanism providing History of shape's modifications for OCCT algorithms in DRAW
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. |
||
|
d9ca2e0cb1 |
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*. |
||
|
944768d277 |
0029312: Using OBB to speed up Boolean Operations
1. Implementation of the user-defined option for usage of Oriented Bounding Boxes (OBB) in Boolean Operations for additional filtering (rejection) of selected for intersection pairs of sub-shapes. By default the usage of OBB is turned off. To enable/disable its usage the method SetUseOBB(flag) should be used. This method is available for all operations in Boolean Component. To enable/disable it in draw the command "buseobb 0/1" should be used. Note, that this will affect all subsequent operations. The OBB for the shapes are built by first necessity and stored into operation context (IntTools_Context). 2. Usage of the OBB in some test cases. |
||
|
1155d05a06 |
0025609: Clean up the duplicate classes in TKBO project
1. The package BOPCol has been fully removed: - *BOPCol_BaseAllocator* is replaced with *Handle(NCollection_BaseAllocator)*; - *BOPCol_BoxBndTree* is replaced with *BOPTools_BoxBndTree*; - *BOPCol_Box2DBndTree* is removed as unused; - *BOPCol_DataMapOfIntegerInteger* is replaced with *TColStd_DataMapOfIntegerInteger*; - *BOPCol_DataMapOfIntegerListOfInteger* is replaced with *TColStd_DataMapOfIntegerListOfInteger*; - *BOPCol_DataMapOfIntegerListOfShape* is replaced with *TopTools_DataMapOfIntegerListOfShape*; - *BOPCol_DataMapOfIntegerMapOfInteger.hxx* is removed as unused; - *BOPCol_DataMapOfIntegerReal* is replaced with *TColStd_DataMapOfIntegerReal*; - *BOPCol_DataMapOfIntegerShape* is replaced with *TopTools_DataMapOfIntegerShape*; - *BOPCol_DataMapOfShapeBox* is replaced with *TopTools_DataMapOfShapeBox*; - *BOPCol_DataMapOfShapeInteger* is replaced with *TopTools_DataMapOfShapeInteger*; - *BOPCol_DataMapOfShapeListOfShape* is replaced with *TopTools_DataMapOfShapeListOfShape*; - *BOPCol_DataMapOfShapeReal* is replaced with *TopTools_DataMapOfShapeReal*; - *BOPCol_DataMapOfShapeShape* is replaced with *TopTools_DataMapOfShapeShape*; - *BOPCol_DataMapOfTransientAddress* is removed as unused; - *BOPCol_IndexedDataMapOfIntegerListOfInteger* is removed as unused; - *BOPCol_IndexedDataMapOfShapeBox* is removed as unused; - *BOPCol_IndexedDataMapOfShapeInteger* is removed as unused; - *BOPCol_IndexedDataMapOfShapeListOfShape* is replaced with *TopTools_IndexedDataMapOfShapeListOfShape*; - *BOPCol_IndexedDataMapOfShapeReal* is removed as unused; - *BOPCol_IndexedDataMapOfShapeShape* is replaced with *TopTools_IndexedDataMapOfShapeShape*; - *BOPCol_IndexedMapOfInteger* is replaced with *TColStd_IndexedMapOfInteger*; - *BOPCol_IndexedMapOfOrientedShape* is replaced with *TopTools_IndexedMapOfOrientedShape*; - *BOPCol_IndexedMapOfShape* is replaced with *TopTools_IndexedMapOfShape*; - *BOPCol_ListOfInteger* is replaced with *TColStd_ListOfInteger*; - *BOPCol_ListOfListOfShape* is replaced with *TopTools_ListOfListOfShape*; - *BOPCol_ListOfShape* is replaced with *TopTools_ListOfShape*; - *BOPCol_MapOfInteger* is replaced with *TColStd_MapOfInteger*; - *BOPCol_MapOfOrientedShape* is replaced with *TopTools_MapOfOrientedShape*; - *BOPCol_MapOfShape* is replaced with *TopTools_MapOfShape*; - *BOPCol_PListOfInteger* is removed as unused; - *BOPCol_PInteger* is removed as unused - *BOPCol_SequenceOfPnt2d* is replaced with *TColgp_SequenceOfPnt2d*; - *BOPCol_SequenceOfReal* is replaced with *TColStd_SequenceOfReal*; - *BOPCol_SequenceOfShape* is replaced with *TopTools_SequenceOfShape*; - *BOPCol_Parallel* is replaced with *BOPTools_Parallel*; - *BOPCol_NCVector* is replaced with *NCollection_Vector*; 2. The class *BOPDS_PassKey* and containers for it have been removed as unused; 3. The unused containers from *IntTools* package have been removed: - *IntTools_DataMapOfShapeAddress* is removed as unused; - *IntTools_IndexedDataMapOfTransientAddress* is removed as unused; 4. The container *BiTgte_DataMapOfShapeBox* is replaced with *TopTools_DataMapOfShapeBox*; 5. The class *BOPTools* has been removed as duplicate of the class *TopExp*; |
||
|
98b3765966 |
0029237: Improve performance of Boolean Operations
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. |
||
|
33ba856502 |
0028786: Refactoring of the Warning/Error reporting system of Boolean Operations Algorithm
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&) |
||
|
e8b9db57cd |
0028508: Make the CellsBuilder algorithm to work with multi-dimensional arguments
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. |
||
|
483ce1bd89 |
0027878: Development of the Gluing operations based on the new Boolean component
The Gluing operation is an additional option for the algorithms in the Boolean Component such as General Fuse, Boolean operations, Section operation, Maker Volume and Cells Builder algorithms. The Gluing options have been designed to speed up the computation of the interference among arguments of the operations on special cases, in which the arguments may be overlapping but do not have real intersections between their sub-shapes. This option cannot be used on the shapes having real intersections, like intersection vertex between edges, or intersection vertex between edge and a face or intersection line between faces. The Gluing option is an enumeration implemented in BOPAlgo_GlueEnum.hxx. There are following items in the enum: * BOPAlgo_GlueOff - default value for the algorithms, Gluing is switched off; * BOPAlgo_GlueShift - Glue option for shapes with partial coincidence; * BOPAlgo_GlueFull - Glue option for shapes with full coincidence. For setting the Gluing options for the algorithm it is just necessary to call the SetGlue(BOPAlgo_GlueEnum) method with appropriate Glue value. For using this option in DRAW the command bglue has been implemented: * 0 - default value, Gluing is off; * 1 - for partial coincidence; * 2 - for full coincidence Elimination of the warnings. |
||
|
338434c75a |
0026798: Boolean operations: keep desired cells and boundaries in the result
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 |