OpenCascade.js
API ReferenceModelingAlgorithmsTKBO

BOPAlgo

OCCT package BOPAlgo: BOPAlgo_AlertAcquiredSelfIntersection, BOPAlgo_AlertBadPositioning, BOPAlgo_AlertBOPNotAllowed, BOPAlgo_AlertBOPNotSet, and 68 more…

BOPAlgo_Algo

The class provides the root interface for the algorithms in Boolean Component.

Instance methods(1)

  • Perform(theRange?: Message_ProgressRange): void

    The main method to implement the operation Providing the range allows to enable Progress indicator User break functionalities.

    Parameters (1)
    • theRange

BOPAlgo_ArgumentAnalyzer

check the validity of argument(s) for Boolean Operations

Constructors(1)

Instance methods(18)

BOPAlgo_BOP

The class represents the Building part of the Boolean Operations algorithm. The arguments of the algorithms are divided in two groups - Objects and Tools. The algorithm builds the splits of the given arguments using the intersection results and combines the result of Boolean Operation of given type:

  • FUSE - union of two groups of objects;
  • COMMON - intersection of two groups of objects;
  • CUT - subtraction of one group from the other.
    The rules for the arguments and type of the operation are the following:
  • For Boolean operation FUSE all arguments should have equal dimensions;
  • For Boolean operation CUT the minimal dimension of Tools should not be less than the maximal dimension of Objects;
  • For Boolean operation COMMON the arguments can have any dimension.
    The class is a General Fuse based algorithm. Thus, all options of the General Fuse algorithm such as Fuzzy mode, safe processing mode, parallel processing mode, gluing mode and history support are also available in this algorithm.
    Additionally to the Warnings of the parent class the algorithm returns the following warnings:
  • BOPAlgo_AlertEmptyShape - in case some of the input shapes are empty shapes.
    Additionally to Errors of the parent class the algorithm returns the following Error statuses:
  • BOPAlgo_AlertBOPIsNotSet - in case the type of Boolean operation is not set;
  • BOPAlgo_AlertBOPNotAllowed - in case the operation of given type is not allowed on given inputs;
  • BOPAlgo_AlertSolidBuilderFailed - in case the BuilderSolid algorithm failed to produce the Fused solid.

Constructors(2)

Instance methods(3)

BOPAlgo_Builder

The class is a General Fuse algorithm - base algorithm for the algorithms in the Boolean Component. Its main purpose is to build the split parts of the argument shapes from which the result of the operations is combined. The result of the General Fuse algorithm itself is a compound containing all split parts of the arguments.
Additionally to the options of the base classes, the algorithm has the following options:

  • Safe processing mode - allows to avoid modification of the input shapes during the operation (by default it is off);
  • Gluing options - allows to speed up the calculation of the intersections on the special cases, in which some sub-shapes are coinciding.
  • Disabling the check for inverted solids - Disables/Enables the check of the input solids for inverted status (holes in the space). The default value is TRUE, i.e. the check is performed. Setting this flag to FALSE for inverted solids, most likely will lead to incorrect results.
    The algorithm returns the following warnings:
  • BOPAlgo_AlertUnableToOrientTheShape - in case the check on the orientation of the split shape to match the orientation of the original shape has failed.
    The algorithm returns the following Error statuses:
  • BOPAlgo_AlertTooFewArguments - in case there are no enough arguments to perform the operation;
  • BOPAlgo_AlertNoFiller - in case the intersection tool has not been created;
  • BOPAlgo_AlertIntersectionFailed - in case the intersection of the arguments has failed;
  • BOPAlgo_AlertBuilderFailed - in case building splits of arguments has failed with some unexpected error.

Constructors(2)

Instance methods(17)

BOPAlgo_BuilderArea

The root class for algorithms to build faces/solids from set of edges/faces.

Instance methods(7)

BOPAlgo_BuilderFace

The algorithm to build new faces from the given faces and set of edges lying on this face.
The algorithm returns the following Error statuses:

  • BOPAlgo_AlertNullInputShapes - in case the given face is a null shape.

Constructors(2)

Instance methods(4)

BOPAlgo_BuilderShape

Root class for algorithms that has shape as result.
The class provides the History mechanism, which allows tracking the modification of the input shapes during the operation. It uses the BRepTools_History tool as a storer for history objects.

Instance methods(10)

BOPAlgo_BuilderSolid

Solid Builder is the algorithm for building solids from set of faces. The given faces should be non-intersecting, i.e. all coinciding parts of the faces should be shared among them.
The algorithm performs the following steps to build the solids:

  1. Find:faces orientated INTERNAL;alone faces given twice with different orientation;
  2. Build all possible closed shells from the rest of the faces (BOPAlgo_ShellSplitter is used for that);
  3. Classify the obtained shells on the Holes and Growths;
  4. Build solids from the Growth shells, put Hole shells into closest Growth solids;
  5. Classify all unused faces relatively created solids and put them as internal shells into the closest solids;
  6. Find all unclassified faces, i.e. faces outside of all created solids, make internal shells from them and put these shells into a warning.
    It is possible to avoid all internal shells in the resulting solids. For that it is necessary to use the method SetAvoidInternalShapes(true) of the base class. In this case the steps 5 and 6 will not be performed at all.
    The algorithm may return the following warnings:
  • BOPAlgo_AlertShellSplitterFailed in case the ShellSplitter algorithm has failed;
  • BOPAlgo_AlertSolidBuilderUnusedFaces in case there are some faces outside of created solids left.
    Example of usage of the algorithm:
constNCollection_List<TopoDS_Shape>&aFaces=...;//Facestobuildthesolids boolisAvoidInternals=...;//Flagwhichdefineswhethertocreatethe internalshellsornotBOPAlgo_BuilderSolidaBS;//SolidBuildertool aBS.SetShapes(aFaces);//Setthefaces aBS.SetAvoidInternalShapes(isAvoidInternals);//SettheAvoidInternalShapesFlag aBS.Perform();//Performtheoperation if(!aBS.IsDone())//Checkfortheerrors { //errortreatment Standard_SStreamaSStream; aBS.DumpErrors(aSStream); return; } if(aBS.HasWarnings())//Checkforthewarnings { //warningstreatment Standard_SStreamaSStream; aBS.DumpWarnings(aSStream); } constNCollection_List<TopoDS_Shape>&aSolids=aBS.Areas();//Obtainingtheresultsolids

Constructors(2)

Instance methods(2)

BOPAlgo_CellsBuilder

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.
    All the requirements of GFA for the DATA are inherited in this algorithm. The arguments could be of any type (dimension) and should be valid in terms of BRepCheck_Analyzer and BOPAlgo_ArgumentAnalyzer.
    Results:
    The result of the algorithm is compound containing selected parts of the basic types (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.
    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.
    Note, that if the result contains the parts with same material but of different dimension the boundaries between such parts will not be removed. Currently, the removal of the internal boundaries between multi-dimensional shapes is not supported.
    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 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 for basic types of the shapes - VERTEX, EDGE, FACE. 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, bgenerated and bisdeleted).
    The algorithm can return the following Error Statuses:
  • Error status acquired in the General Fuse algorithm. The Error status can be checked with HasErrors() method. If the Error status is not equal to zero, the result cannot be trustworthy.
    The algorithm can set the following Warning Statuses:
  • Warning status acquired in the General Fuse algorithm;
  • BOPAlgo_AlertRemovalOfIBForMDimShapes
  • BOPAlgo_AlertRemovalOfIBForFacesFailed
  • BOPAlgo_AlertRemovalOfIBForEdgesFailed
  • BOPAlgo_AlertRemovalOfIBForSolidsFailed
    The Warning status can be checked with HasWarnings() method or printed with the DumpWarnings() method. If warnings are recorded, the result may be not as expected.
    Examples:

API BOPAlgo_CellsBuilderaCBuilder; NCollection_List<TopoDS_Shape>aLS=...;//arguments //parallelorsinglemode(thedefaultvalueisFALSE) booltoRunParallel=false; //fuzzyoption(defaultvalueis0) doubleaTol=0.0; // aCBuilder.SetArguments(aLS); aCBuilder.SetRunParallel(toRunParallel); aCBuilder.SetFuzzyValue(aTol); // aCBuilder.Perform(); if(aCBuilder.HasErrors())//checkerrorstatus { return; } //emptycompound,asnothinghasbeenaddedyet constTopoDS_Shape&aRes=aCBuilder.Shape(); //allsplitparts constTopoDS_Shape&aRes=aCBuilder.GetAllParts(); // NCollection_List<TopoDS_Shape>aLSToTake=...;//partsoftheseargumentswillbetakeninto resultNCollection_List<TopoDS_Shape>aLSToAvoid=...;//partsoftheseargumentswillnotbe takenintoresult // //definesthematerialcommonforthecells, //i.e.theboundariesbetweencellswiththesamematerialwillberemoved. //Bydefaultitissetto0. //Thus,toremovesomeboundarythevalueofthisvariableshouldnotbeequalto0. intiMaterial=...;
//defineswhethertoupdatetheresultrightnowornot booltoUpdate=...; //addingtoresult aCBuilder.AddToResult(aLSToTake,aLSToAvoid,iMaterial,toUpdate); aR=aCBuilder.Shape();//theresult //removingoftheboundaries(shouldbecalledonlyiftoUpdateisfalse) aCBuilder.RemoveInternalBoundaries(); // //removingfromresult aCBuilder.AddAllToResult(); aCBuilder.RemoveFromResult(aLSToTake,aLSToAvoid); aR=aCBuilder.Shape();//theresult
2. DRAW Test Harness pspheres115 pspheres215 pspheres315 ttranslates10010 ttranslates220010 ttranslates31000 #addingarguments bclearobjects;bcleartools baddobjectss1s2s3 #intersection bfillds #rxwillcontainallsplitparts bcbuildrx #addtoresultthepartthatiscommonforallthreespheres bcaddress11s21s31-m1 #addtoresultthepartthatiscommononlyforfirstandthirdspheres bcaddress11s20s31-m1 #removeinternalboundaries bcremoveintres

Constructors(2)

Instance methods(7)

  • AddToResult(theLSToTake: NCollection_List_TopoDS_Shape, theLSToAvoid: NCollection_List_TopoDS_Shape, theMaterial?: number, theUpdate?: boolean): void

    Adding the parts to result. The parts are defined by two lists of shapes: <theLSToTake> defines the arguments which parts should be taken into result; <theLSToAvoid> defines the arguments which parts should not be taken into result; To be taken into result the part must be IN for all shapes from the list <theLSToTake> and must be OUT of all shapes from the list <theLSToAvoid>.
    To remove internal boundaries between any cells in the result <theMaterial> variable should be used. The boundaries between cells with the same material will be removed. Default value is 0. Thus, to remove any boundary the value of this variable should not be equal to 0. <theUpdate> parameter defines whether to remove boundaries now or not.

    Parameters (4)
    • theLSToTake
    • theLSToAvoid
    • theMaterial
    • theUpdate
  • AddAllToResult(theMaterial?: number, theUpdate?: boolean): void

    Add all split parts to result. <theMaterial> defines the removal of internal boundaries; <theUpdate> parameter defines whether to remove boundaries now or not.

    Parameters (2)
    • theMaterial
    • theUpdate
  • Removing the parts from result. The parts are defined by two lists of shapes: <theLSToTake> defines the arguments which parts should be removed from result; <theLSToAvoid> defines the arguments which parts should not be removed from result. To be removed from the result the part must be IN for all shapes from the list <theLSToTake> and must be OUT of all shapes from the list <theLSToAvoid>.

    Parameters (2)
    • theLSToTake
    • theLSToAvoid
  • Remove all parts from result.

  • Removes internal boundaries between cells with the same material. If the result contains the cells with same material but of different dimension the removal of internal boundaries between these cells will not be performed. In case of some errors during the removal the method will set the appropriate warning status - use GetReport() to access them.

  • Get all split parts.

  • Makes the Containers of proper type from the parts added to result.

BOPAlgo_CheckerSI

BOPAlgo_PaveFillerBOPAlgo_AlgoBOPAlgo_Options

Checks the shape on self-interference.
The algorithm can set the following errors:

  • BOPAlgo_AlertMultipleArguments - The number of the input arguments is not one;
  • BOPALgo_ErrorIntersectionFailed - The check has been aborted during intersection of sub-shapes. In case the error has occurred during intersection of sub-shapes, i.e. in BOPAlgo_PaveFiller::PerformInternal() method, the errors from this method directly will be returned.

Constructors(1)

Instance methods(2)

  • Perform(theRange?: Message_ProgressRange): void

    The main method to implement the operation Providing the range allows to enable Progress indicator User break functionalities.

    Parameters (1)
    • theRange
  • SetLevelOfCheck(theLevel: number): void

    Sets the level of checking shape on self-interference. It defines which interferences will be checked: 0 - only V/V; 1 - V/V and V/E; 2 - V/V, V/E and E/E; 3 - V/V, V/E, E/E and V/F; 4 - V/V, V/E, E/E, V/F and E/F; 5 - V/V, V/E, E/E, V/F, E/F and F/F; 6 - V/V, V/E, E/E, V/F, E/F, F/F and V/S; 7 - V/V, V/E, E/E, V/F, E/F, F/F, V/S and E/S; 8 - V/V, V/E, E/E, V/F, E/F, F/F, V/S, E/S and F/S; 9 - V/V, V/E, E/E, V/F, E/F, F/F, V/S, E/S, F/S and S/S - all interferences (Default value).

    Parameters (1)
    • theLevel

BOPAlgo_CheckResult

contains information about faulty shapes and faulty types can't be processed by Boolean Operations

Constructors(1)

Instance methods(18)

BOPAlgo_CheckStatus

Properties(12)

BOPAlgo_MakeConnected

BOPAlgo_MakeConnected is the algorithm for making the touching shapes connected or glued, i.e. for making the coinciding geometries be topologically shared among the shapes.
The input shapes should be of the same dimension, otherwise the gluing will not make any sense.
After the shapes are made connected, the border elements of input shapes are associated with the shapes to which they belong. At that, the orientation of the border element in the shape is taken into account. The associations are made for the following types:

  • For input SOLIDS, the resulting FACES are associated with the input solids;
  • For input FACES, the resulting EDGES are associated with the input faces;
  • For input EDGES, the resulting VERTICES are associated with the input edges.
    In frames of this algorithm the input shapes are called materials, and the association process is called the material association. The material association allows finding the coinciding elements for the opposite input shapes. These elements will be associated to at least two materials.
    After making the shapes connected, it is possible to make the connected shape periodic using the BOPAlgo_MakePeriodic tool. After making the shape periodic, the material associations will be updated to correspond to the actual state of the result shape. Repetition of the periodic shape is also possible here. Material associations are not going to be lost.
    The algorithm supports history of shapes modification, thus it is possible to track the modification of the input shapes during the operations. Additionally to standard history methods, the algorithm provides the the method GetOrigins() which allows obtaining the input shapes from which the resulting shape has been created.
    The algorithm supports the parallel processing mode, which allows faster completion of the operations.
    The algorithm returns the following Error/Warning messages:
  • BOPAlgo_AlertTooFewArguments - error alert is given on the attempt to run the algorithm without the arguments;
  • BOPAlgo_AlertMultiDimensionalArguments - error alert is given on the attempt to run the algorithm on multi-dimensional arguments;
  • BOPAlgo_AlertUnableToGlue - error alert is given if the gluer algorithm is unable to glue the given arguments;
  • BOPAlgo_AlertUnableToMakePeriodic - warning alert is given if the periodicity maker is unable to make the connected shape periodic with given options;
  • BOPAlgo_AlertShapeIsNotPeriodic - warning alert is given on the attempt to repeat the shape before making it periodic.
    Here is the example of usage of the algorithm:
NCollection_List<TopoDS_Shape>anArguments=...;//Shapestomakeconnected boolbRunParallel=...;//Parallelprocessingmode BOPAlgo_MakeConnectedaMC;//Toolformakingtheshapesconnected aMC.SetArguments(anArguments);//Settheshapes aMC.SetRunParallel(bRunParallel);//Setparallelprocessingmode aMC.Perform();//Performtheoperation if(aMC.HasErrors())//Checkfortheerrors { //errorstreatment Standard_SStreamaSStream; aMC.DumpErrors(aSStream); return; } if(aMC.HasWarnings())//Checkforthewarnings { //warningstreatment Standard_SStreamaSStream; aMC.DumpWarnings(aSStream); } constTopoDS_Shape&aGluedShape=aMC.Shape();//Connectedshape //Checkingmaterialassociations TopAbs_ShapeEnumanElemType=...;//Typeofborderelement TopExp_ExploreranExp(anArguments.First(),anElemType); for(;anExp.More();anExp.Next()) { constTopoDS_Shape&anElement=anExp.Current(); constNCollection_List<TopoDS_Shape>&aNegativeM=aMC.MaterialsOnNegativeSide(anElement);constNCollection_List<TopoDS_Shape>&aPositiveM=aMC.MaterialsOnPositiveSide(anElement); } //Makingtheconnectedshapeperiodic BOPAlgo_MakePeriodic::PeriodicityParamsaParams=...;//Optionsforperiodicityofthe connectedshapeaMC.MakePeriodic(aParams); //Shaperepetitionaftermakingitperiodic //Checkiftheshapehasbeenmadeperiodicsuccessfully if(aMC.PeriodicityTool().HasErrors()) { //Periodicitymakererrortreatment } //Shaperepetitioninperiodicdirections aMC.RepeatShape(0,2); constTopoDS_Shape&aShape=aMC.PeriodicShape();//Periodicandrepeatedshape

Constructors(1)

Instance methods(16)

BOPAlgo_MakePeriodic

BOPAlgo_MakePeriodic is the tool for making an arbitrary shape periodic in 3D space in specified directions.
Periodicity of the shape means that the shape can be repeated in any periodic direction any number of times without creation of the new geometry or splits.
The idea is to make the shape look identical on the opposite sides of the periodic directions, so when translating the copy of a shape on the period there will be no coinciding parts of different dimensions.
If necessary the algorithm will trim the shape to fit it into the requested period by splitting it by the planes limiting the shape's requested period.
For making the shape periodic in certain direction the algorithm performs the following steps:

  • Creates the copy of the shape and moves it on the period into negative side of the requested direction;
  • Splits the negative side of the shape by the moved copy, ensuring copying of the geometry from positive side to negative;
  • Creates the copy of the shape (with already split negative side) and moves it on the period into the positive side of the requested direction;
  • Splits the positive side of the shape by the moved copy, ensuring copying of the geometry from negative side to positive.
    The algorithm also associates the identical (or twin) shapes located on the opposite sides of the result shape. Using the GetTwins() method it is possible to get the twin shapes from the opposite sides.
    Algorithm also provides the methods to repeat the periodic shape in periodic directions. The subsequent repetitions are performed on the repeated shape, thus repeating the shape two times in X direction will create result in three shapes (original plus two copies). Single subsequent repetition will result already in 6 shapes. The repetitions can be cleared and started over.
    The algorithm supports History of shapes modifications, thus it is possible to track how the shape has been changed to make it periodic and what new shapes have been created during repetitions.
    The algorithm supports the parallel processing mode, which allows faster completion of the operations.
    The algorithm supports the Error/Warning system and returns the following alerts:
  • BOPAlgo_AlertNoPeriodicityRequired - Error alert is given if no periodicity has been requested in any direction;
  • BOPAlgo_AlertUnableToTrim - Error alert is given if the trimming of the shape for fitting it into requested period has failed;
  • BOPAlgo_AlertUnableToMakeIdentical - Error alert is given if splitting of the shape by its moved copies has failed;
  • BOPAlgo_AlertUnableToRepeat - Warning alert is given if the gluing of the repeated shapes has failed.
    Example of usage of the algorithm:
TopoDS_ShapeaShape=...;//Theshapetomakeperiodic boolbMakeXPeriodic=...;//FlagformakingornottheshapeperiodicinX directiondoubleaXPeriod=...;//Xperiodfortheshapebool isXTrimmed=...;//Flagdefiningwhetheritisnecessarytotrimming //theshapetofittoXperiod doubleaXFirst=...;//StartoftheXperiod //(reallynecessaryonlyifthetrimmingis requested) boolbRunParallel=...;//Parallelprocessingmodeorsingle BOPAlgo_MakePeriodicaPeriodicityMaker;//Periodicitymaker aPeriodicityMaker.SetShape(aShape);//Settheshape aPeriodicityMaker.MakeXPeriodic(bMakePeriodic,aXPeriod);//MakingtheshapeperiodicinX directionaPeriodicityMaker.SetTrimmed(isXTrimmed,aXFirst);//TrimtheshapetofitX periodaPeriodicityMaker.SetRunParallel(bRunParallel);//Settheparallelprocessing modeaPeriodicityMaker.Perform();//Performingtheoperation if(aPeriodicityMaker.HasErrors())//Checkfortheerrors { //errorstreatment Standard_SStreamaSStream; aPeriodicityMaker.DumpErrors(aSStream); return; }if(aPeriodicityMaker.HasWarnings())//Checkforthewarnings { //warningstreatment Standard_SStreamaSStream; aPeriodicityMaker.DumpWarnings(aSStream); } constTopoDS_Shape&aPeriodicShape=aPeriodicityMaker.Shape();//Resultperiodicshape aPeriodicityMaker.XRepeat(2);//Makingrepetitions constTopoDS_Shape&aRepeat=aPeriodicityMaker.RepeatedShape();//Gettingtherepeatedshape aPeriodicityMaker.ClearRepetitions();//Clearingtherepetitions

Constructors(1)

Static methods(1)

  • ToDirectionID(theDirectionID: number): number
    Parameters (1)
    • theDirectionID

Instance methods(38)

BOPAlgo_MakerVolume

The algorithm is to build solids from set of shapes. It uses the BOPAlgo_Builder algorithm to intersect the given shapes and build the images of faces (if needed) and BOPAlgo_BuilderSolid algorithm to build the solids.
Steps of the algorithm:

  1. Collect all faces: intersect the shapes if necessary and collect the images of faces, otherwise just collect the faces to the <myFaces> list; All faces on this step added twice, with orientation FORWARD and REVERSED;
  2. Create bounding box covering all the faces from <myFaces> and create solid box from corner points of that bounding box (myBBox, mySBox). Add faces from that box to <myFaces>;
  3. Build solids from <myFaces> using BOPAlgo_BuilderSolid algorithm;
  4. Treat the result: Eliminate solid containing faces from <mySBox>;
  5. Fill internal shapes: add internal vertices and edges into created solids;
  6. Prepare the history.
    Fields: <myIntersect> - boolean flag. It defines whether intersect shapes from <myArguments> (if set to TRUE) or not (FALSE). The default value is TRUE. By setting it to FALSE the user should guarantee that shapes in <myArguments> do not interfere with each other, otherwise the result is unpredictable.
    <myBBox> - bounding box, covering all faces from <myFaces>.
    <mySBox> - Solid box created from the corner points of <myBBox>.
    <myFaces> - the list is to keep the "final" faces, that will be given to the BOPAlgo_BuilderSolid algorithm. If the shapes have been interfered it should contain the images of the source shapes, otherwise its just the original faces. It also contains the faces from <mySBox>.
    Fields inherited from BOPAlgo_Builder:
    <myArguments> - list of the source shapes. The source shapes can have any type, but each shape must not be self-interfered.
    <myShape> - Result shape:
  • empty compound - if no solids were created;
  • solid - if created only one solid;
  • compound of solids - if created more than one solid.
    Fields inherited from BOPAlgo_Algo:
    <myRunParallel> - Defines whether the parallel processing is switched on or not. <myReport> - Error status of the operation. Additionally to the errors of the parent algorithm it can have the following values:
  • BOPAlgo_AlertSolidBuilderFailed - BOPAlgo_BuilderSolid algorithm has failed.
    Example:
    BOPAlgo_MakerVolume aMV; // aMV.SetArguments(aLS); //source shapes aMV.SetRunParallel(bRunParallel); //parallel or single mode aMV.SetIntersect(bIntersect); //intersect or not the shapes from <aLS> // aMV.Perform(); //perform the operation if (aMV.HasErrors()) { //check error status return; } // const TopoDS_Shape& aResult = aMV.Shape(); //result of the operation

Constructors(2)

Instance methods(7)

  • SetIntersect(bIntersect: boolean): void

    Sets the flag myIntersect: if <bIntersect> is TRUE the shapes from <myArguments> will be intersected. if <bIntersect> is FALSE no intersection will be done.

    Parameters (1)
    • bIntersect
  • IsIntersect(): boolean

    Returns the flag <myIntersect>.

  • Returns the solid box <mySBox>.

  • Returns the processed faces <myFaces>.

  • SetAvoidInternalShapes(theAvoidInternal: boolean): void

    Defines the preventing of addition of internal for solid parts into the result. By default the internal parts are added into result.

    Parameters (1)
    • theAvoidInternal
  • Returns the AvoidInternalShapes flag.

  • Perform(theRange?: Message_ProgressRange): void

    Performs the operation.

    Parameters (1)
    • theRange

BOPAlgo_Options

The class provides the following options for the algorithms in Boolean Component:

  • Memory allocation tool - tool for memory allocations;
  • Error and warning reporting - allows recording warnings and errors occurred during the operation. Error means that the algorithm has failed.
  • Parallel processing mode - provides the possibility to perform operation in parallel mode;
  • Fuzzy tolerance - additional tolerance for the operation to detect touching or coinciding cases;
  • Using the Oriented Bounding Boxes - Allows using the Oriented Bounding Boxes of the shapes for filtering the intersections.

Constructors(2)

Static methods(2)

Instance methods(16)

BOPAlgo_ParallelAlgo

Additional root class to provide interface to be launched from parallel vector. It already has the range as a field, and has to be used with caution to create scope from the range only once.

Instance methods(3)

BOPAlgo_PISteps

Class for representing the relative contribution of each step of the operation to the whole progress.

Constructors(1)

Instance methods(4)

BOPAlgo_RemoveFeatures

The RemoveFeatures algorithm is intended for reconstruction of the shape by removal of the unwanted parts from it. These parts can be holes, protrusions, spikes, fillets etc. The shape itself is not modified, the new shape is built in the result.
Currently, only the shapes of type SOLID, COMPSOLID, and COMPOUND of Solids are supported. And only the FACEs can be removed from the shape.
On the input the algorithm accepts the shape itself and the faces which have to be removed. It does not matter how the faces are given. It could be the separate faces or the collections of faces. The faces should belong to the initial shape, and those that do not belong will be ignored. Before reconstructing the shape, the algorithm will sort all the given faces on the connected blocks (features).
The features will be removed from the shape one by one. It will allow removing all possible features even if there were problems with the removal of some of them.
The removed feature is filled by the extension of the faces adjacent to the feature. In general, the algorithm of removing of the single feature from the shape looks as follows:

  • Find the faces adjacent to the feature;
  • Extend the adjacent faces to cover the feature;
  • Trim the extended faces by the bounds of original face (except for bounds common with the feature), so it will cover the feature only;
  • Rebuild the solids with reconstructed adjacent faces avoiding the faces from the feature.
    If the removal is successful, the result is overwritten with the new shape and the next feature is treated. Otherwise, the warning will be given.
    The algorithm has the following options:
  • History support;
    and the options available from base class:
  • Error/Warning reporting system;
  • Parallel processing mode.
    Please note that the other options of the base class are not supported here and will have no effect.
    History support allows tracking modification of the input shape in terms of Modified, IsDeleted and Generated. The history is available through the methods of the history tool BRepTools_History, which can be accessed here through the method History(). By default, the history is collected, but it is possible to disable it using the method SetToFillHistory(false);
    Error/Warning reporting system - allows obtaining the extended overview of the Errors/Warnings occurred during the operation. As soon as any error appears the algorithm stops working. The warnings allow continuing the job, informing the user that something went wrong. The algorithm returns the following errors/warnings:
  • BOPAlgo_AlertTooFewArguments - the error alert is given if the input shape does not contain any solids;
  • BOPAlgo_AlertUnsupportedType - the warning alert is given if the input shape contains not only solids, but also other shapes;
  • BOPAlgo_AlertNoFacesToRemove - the error alert is given in case there are no faces to remove from the shape (nothing to do);
  • BOPAlgo_AlertUnableToRemoveTheFeature - the warning alert is given to inform the user the removal of the feature is not possible. The algorithm will still try to remove the other features;
  • BOPAlgo_AlertRemoveFeaturesFailed - the error alert is given in case if the operation was aborted by the unknown reason.
    Parallel processing mode - allows running the algorithm in parallel mode obtaining the result faster.
    The algorithm has certain limitations:
  • Intersection of the connected faces adjacent to the feature should not be empty. It means, that such faces should not be tangent to each other. If the intersection of the adjacent faces will be empty, the algorithm will be unable to trim the faces correctly and, most likely, the feature will not be removed.
  • The algorithm does not process the INTERNAL parts of the solids, they are simply removed during reconstruction.
    Note that for successful removal of the feature, the extended faces adjacent to the feature should cover the feature completely, otherwise the solids will not be rebuild.
    Here is the example of usage of the algorithm:
TopoDS_ShapeaSolid=...;//Inputshapetoremovethefeaturesfrom NCollection_List<TopoDS_Shape>aFaces=...;//Facestoremovefromtheshape boolbRunParallel=...;//Parallelprocessingmode boolisHistoryNeeded=...;//Historysupport BOPAlgo_RemoveFeaturesaRF;//Featureremovalalgorithm aRF.SetShape(aSolid);//Settheshape aRF.AddFacesToRemove(aFaces);//Addfacestoremove aRF.SetRunParallel(bRunParallel);//Definetheprocessingmode(parallelorsingle) aRF.SetToFillHistory(isHistoryNeeded);//Definewhethertotracktheshapesmodifications aRF.Perform();//Performtheoperation if(aRF.HasErrors())//Checkfortheerrors { //errortreatment return; } if(aRF.HasWarnings())//Checkforthewarnings { //warningstreatment } constTopoDS_Shape&aResult=aRF.Shape();//Resultshape

The algorithm preserves the type of the input shape in the result shape. Thus, if the input shape is a COMPSOLID, the resulting solids will also be put into a COMPSOLID.
When all possible features are removed, the shape is simplified by removing extra edges and vertices, created during operation, from the result shape.

Constructors(1)

Instance methods(7)

BOPAlgo_Section

The algorithm to build a Section between the arguments. The Section consists of vertices and edges. The Section contains:

  1. new vertices that are subjects of V/V, E/E, E/F, F/F interferences
  2. vertices that are subjects of V/E, V/F interferences
  3. new edges that are subjects of F/F interferences
  4. edges that are Common Blocks

Constructors(2)

BOPAlgo_SectionAttribute

Class is a container of the flags used by intersection algorithm.

Constructors(2)

Instance methods(6)

  • Approximation(theApprox: boolean): void

    Sets the Approximation flag.

    Parameters (1)
    • theApprox
  • Approximation(): boolean

    Returns the Approximation flag.

  • PCurveOnS1(thePCurveOnS1: boolean): void

    Sets the PCurveOnS1 flag.

    Parameters (1)
    • thePCurveOnS1
  • PCurveOnS1(): boolean

    Returns the PCurveOnS1 flag.

  • PCurveOnS2(thePCurveOnS2: boolean): void

    Sets the PCurveOnS2 flag.

    Parameters (1)
    • thePCurveOnS2
  • PCurveOnS2(): boolean

    Returns the PCurveOnS2 flag.

BOPAlgo_ShellSplitter

The class provides the splitting of the set of connected faces on separate loops.

Constructors(2)

Static methods(1)

Instance methods(4)

BOPAlgo_Splitter

The Splitter algorithm is the algorithm for splitting a group of arbitrary shapes by the other group of arbitrary shapes. The arguments of the operation are divided on two groups: Objects - shapes that will be split; Tools - shapes by which the Objects will be split. The result of the operation contains only the split parts of the shapes from the group of Objects. The split parts of the shapes from the group of Tools are excluded from the result. The shapes can be split by the other shapes from the same group (in case these shapes are interfering).
The class is a General Fuse based algorithm. Thus, all options of the General Fuse algorithm such as Fuzzy mode, safe processing mode, parallel processing mode, gluing mode and history support are also available in this algorithm. There is no requirement on the existence of the Tools shapes. And if there are no Tools shapes, the result of the splitting operation will be equivalent to the General Fuse result.
The implementation of the algorithm is minimal - only the methods CheckData() and Perform() have been overridden. The method BOPAlgo_Builder::BuildResult(), which adds the split parts of the arguments into result, does not have to be overridden, because its native implementation performs the necessary actions for the Splitter algorithm - it adds the split parts of only Objects into result, avoiding the split parts of Tools.

Constructors(2)

Instance methods(1)

BOPAlgo_Tools

Provides tools used in the intersection part of Boolean operations.

Constructors(1)

Static methods(8)

  • Fills the map with the connected entities.

    Parameters (4)
    • thePB1
    • theF
    • theMILI
      Mutated in place; read the updated value from this argument after the call.
    • theAllocator
  • Parameters (3)
    • theCB
    • theDS
    • theContext
  • EdgesToWires(theEdges: TopoDS_Shape, theWires: TopoDS_Shape, theShared: boolean, theAngTol: number): number

    Creates planar wires from the given edges. The input edges are expected to be planar. And for the performance sake the method does not check if the edges are really planar. Thus, the result wires will also be not planar if the input edges are not planar. The edges may be not shared, but the resulting wires will be sharing the coinciding parts and intersecting parts. The output wires may be non-manifold and contain free and multi-connected vertices.
    Parameters: <theEdges> - input edges; <theWires> - output wires; <theShared> - boolean flag which defines whether the input edges are already shared or have to be intersected; <theAngTol> - the angular tolerance which will be used for distinguishing the planes in which the edges are located. Default value is 1.e-8 which is used for intersection of planes in IntTools_FaceFace. Method returns the following error statuses: 0 - in case of success (at least one wire has been built); 1 - in case there are no edges in the given shape; 2 - sharing of the edges has failed.

    Parameters (4)
    • theEdges
    • theWires
      Mutated in place; read the updated value from this argument after the call.
    • theShared
    • theAngTol
  • WiresToFaces(theWires: TopoDS_Shape, theFaces: TopoDS_Shape, theAngTol: number): boolean

    Creates planar faces from given planar wires. The method does not check if the wires are really planar. The input wires may be non-manifold but should be shared.
    The wires located in the same planes and included into other wires will create holes in the faces built from outer wires.
    The tolerance values of the input shapes may be modified during the operation due to projection of the edges on the planes for creation of 2D curves.
    Parameters: <theWires> - the given wires; <theFaces> - the output faces; <theAngTol> - the angular tolerance for distinguishing the planes in which the wires are located. Default value is 1.e-8 which is used for intersection of planes in IntTools_FaceFace. Method returns TRUE in case of success, i.e. at least one face has been built.

    Parameters (3)
    • theWires
    • theFaces
      Mutated in place; read the updated value from this argument after the call.
    • theAngTol
  • Finds chains of intersecting vertices.

    Parameters (3)
    • theVertices
    • theFuzzyValue
    • theChains
      Mutated in place; read the updated value from this argument after the call.
  • Classifies the faces <theFaces> relatively solids <theSolids>. The IN faces for solids are stored into output data map <theInParts>.
    The map <theSolidsIF> contains INTERNAL faces of the solids, to avoid their additional classification.
    Firstly, it checks the intersection of bounding boxes of the shapes. If the Box is not stored in the <theShapeBoxMap> map, it builds the box. If the bounding boxes of solid and face are interfering the classification is performed.
    It is assumed that all faces and solids are already intersected and do not have any geometrically coinciding parts without topological sharing of these parts

    Parameters (7)
    • theFaces
    • theSolids
    • theRunParallel
    • theInParts
      Mutated in place; read the updated value from this argument after the call.
    • theShapeBoxMap
    • theSolidsIF
    • theRange
    Returns

    A result object with fields:

    • theContext: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • Classifies the given parts relatively the given solids and fills the solids with the parts classified as INTERNAL.

    Parameters (4)
    • theSolids
      • The solids to put internals to
    • theParts
      • The parts to classify relatively solids
    • theImages
      • Possible images of the parts that has to be classified
    • theContext
      • cached geometrical tools to speed-up classifications
  • TrsfToPoint(theBox1: Bnd_Box, theBox2: Bnd_Box, theTrsf: gp_Trsf, thePoint: gp_Pnt, theCriteria: number): boolean

    Computes the transformation needed to move the objects to the given point to increase the quality of computations. Returns true if the objects are located far from the given point (relatively given criteria), false otherwise.

    Parameters (5)
    • theBox1
      the AABB of the first object
    • theBox2
      the AABB of the second object
    • theTrsf
      the computed transformation Mutated in place; read the updated value from this argument after the call.
    • thePoint
      the Point to compute transformation to
    • theCriteria
      the Criteria to check whether thranformation is required

BOPAlgo_ToolsProvider

Auxiliary class providing API to operate tool arguments.

Constructors(2)

Instance methods(4)

BOPAlgo_WireSplitter

The class is to build loops from the given set of edges.
It returns the following Error statuses

  • BOPAlgo_AlertNullInputShapes - in case there no input edges to build the loops.

Constructors(2)

Static methods(2)

Instance methods(5)