Boolean Operations Module
Boolean operations including union, intersection, and difference.
LightOcct::LBoolOp
Light OCCT wrapper for OCCT Boolean operations with enum + Handle pattern.
Provides type-safe boolean operation execution using OCCT BRepAlgoAPI internally. Follows Light OCCT architectural patterns: Enum + Handle pattern for type-safe operation storage POD structures for cross-language data exchange Wrapper methods using only Light OCCT types No OCCT types exposed in public interface Supported operations: FUSE: Union of two or more shapes (A ∪ B ∪ C...) COMMON: Intersection of two or more shapes (A ∩ B ∩ C...) CUT: Difference of two shapes (A - B) CUT21: Reverse difference of two shapes (B - A) SECTION: Boundary of intersection (∂(A ∩ B)) SPLIT: Split shapes using tool shapes
#include <light-occt/boolops/LBoolOp.hxx>Quick Reference
Factory Methods: CreateFuse(), CreateCommon(), CreateCut(), CreateCut21(), CreateSection(), CreateMultiFuse(), CreateMultiCommon(), CreateSplit()
Methods: GetType(), IsValid(), GetResult(), LBoolOp(), ~LBoolOp(), LBoolOp(), operator=(), Build(), Build(), CanBuild(), GetShape(), IsDone(), GetModified(), GetGenerated(), IsDeleted(), GetErrorCode(), GetWarningCode(), HasErrors(), HasWarnings(), SetFuzzyValue(), GetFuzzyValue(), SetGlueOption(), GetGlueOption(), SetNonDestructive(), IsNonDestructive(), SetUseParallelMode(), UseParallelMode()
Types: OperationType, TypeEnum
Fields
myType
BooleanOperationType myType;myResult
BooleanOperationResult myResult;Methods
Factory Methods
CreateFuse
Create fuse (union) operation between two shapes.
static LBoolOp CreateFuse(const & LShape shape1, const & LShape shape2, const & BooleanOperationData config);shape1 First input shape shape2 Second input shape config Operation configuration (optional) Boolean operation configured for fuse
Parameters:
shape1- First input shape shape2 Second input shape config Operation configuration (optional) Boolean operation configured for fuseshape2- Second input shape config Operation configuration (optional) Boolean operation configured for fuseconfig- Operation configuration (optional) Boolean operation configured for fuse
CreateCommon
Create common (intersection) operation between two shapes.
static LBoolOp CreateCommon(const & LShape shape1, const & LShape shape2, const & BooleanOperationData config);shape1 First input shape shape2 Second input shape config Operation configuration (optional) Boolean operation configured for common
Parameters:
shape1- First input shape shape2 Second input shape config Operation configuration (optional) Boolean operation configured for commonshape2- Second input shape config Operation configuration (optional) Boolean operation configured for commonconfig- Operation configuration (optional) Boolean operation configured for common
CreateCut
Create cut (difference) operation between two shapes.
static LBoolOp CreateCut(const & LShape shape1, const & LShape shape2, const & BooleanOperationData config);shape1 First input shape (object to cut from) shape2 Second input shape (cutting tool) config Operation configuration (optional) Boolean operation configured for cut
Parameters:
shape1- First input shape (object to cut from) shape2 Second input shape (cutting tool) config Operation configuration (optional) Boolean operation configured for cutshape2- Second input shape (cutting tool) config Operation configuration (optional) Boolean operation configured for cutconfig- Operation configuration (optional) Boolean operation configured for cut
CreateCut21
Create reverse cut (B - A) operation between two shapes.
static LBoolOp CreateCut21(const & LShape shape1, const & LShape shape2, const & BooleanOperationData config);shape1 First input shape (cutting tool) shape2 Second input shape (object to cut from) config Operation configuration (optional) Boolean operation configured for reverse cut
Parameters:
shape1- First input shape (cutting tool) shape2 Second input shape (object to cut from) config Operation configuration (optional) Boolean operation configured for reverse cutshape2- Second input shape (object to cut from) config Operation configuration (optional) Boolean operation configured for reverse cutconfig- Operation configuration (optional) Boolean operation configured for reverse cut
CreateSection
Create section operation between two shapes.
static LBoolOp CreateSection(const & LShape shape1, const & LShape shape2, const & BooleanOperationData config);shape1 First input shape shape2 Second input shape config Operation configuration (optional) Boolean operation configured for section
Parameters:
shape1- First input shape shape2 Second input shape config Operation configuration (optional) Boolean operation configured for sectionshape2- Second input shape config Operation configuration (optional) Boolean operation configured for sectionconfig- Operation configuration (optional) Boolean operation configured for section
CreateMultiFuse
Create fuse (union) operation for multiple shapes.
static LBoolOp CreateMultiFuse(const std::vector< > & LShape shapes, const & BooleanOperationData config);shapes of shapes to fuse together Vector config Operation configuration (optional) Boolean operation configured for multi-shape fuse
Parameters:
shapes- of shapes to fuse together Vector config Operation configuration (optional) Boolean operation configured for multi-shape fuseconfig- Operation configuration (optional) Boolean operation configured for multi-shape fuse
CreateMultiCommon
Create common (intersection) operation for multiple shapes.
static LBoolOp CreateMultiCommon(const std::vector< > & LShape shapes, const & BooleanOperationData config);shapes of shapes to intersect Vector config Operation configuration (optional) Boolean operation configured for multi-shape common
Parameters:
shapes- of shapes to intersect Vector config Operation configuration (optional) Boolean operation configured for multi-shape commonconfig- Operation configuration (optional) Boolean operation configured for multi-shape common
CreateSplit
Create split operation using multiple tool shapes.
static LBoolOp CreateSplit(const std::vector< > & LShape arguments, const std::vector< > & LShape tools, const & SplitOperationData config);arguments of shapes to be split Vector tools of tool shapes for splitting Vector config Split operation configuration (optional) Boolean operation configured for split
Parameters:
arguments- of shapes to be split Vector tools of tool shapes for splitting Vector config Split operation configuration (optional) Boolean operation configured for splittools- of tool shapes for splitting Vector config Split operation configuration (optional) Boolean operation configured for splitconfig- Split operation configuration (optional) Boolean operation configured for split
Instance Methods
GetType
Get the current operation type.
BooleanOperationType GetType() const;Operation type enumeration value
IsValid
Check if operation is valid (has been executed successfully).
bool IsValid() const;True if operation is valid and completed
GetResult
Get operation result data.
BooleanOperationResult GetResult() const;POD structure with execution metadata BooleanOperationResult
LBoolOp
Default constructor creates undefined operation.
LBoolOp() const;~LBoolOp
Destructor.
~LBoolOp() const;LBoolOp
Copy constructor.
LBoolOp(const & LBoolOp other) const;operator=
Assignment operator.
& LBoolOp operator=(const & LBoolOp other) const;Build
Execute the boolean operation.
bool Build() const;True if operation completed successfully
Build
Execute the boolean operation with progress tracking.
bool Build(void * progressCallback) const;progressCallback Optional progress callback function True if operation completed successfully
Parameters:
progressCallback- Optional progress callback function True if operation completed successfully
CanBuild
Check if the operation can be performed (inputs are valid).
bool CanBuild() const;True if inputs are valid for the operation
GetShape
Get the resulting shape from the boolean operation.
LShape GetShape() const;Result shape (valid only after successful ) Build()
IsDone
Check if the operation has been executed.
bool IsDone() const;True if has been called Build()
GetModified
Get list of modified shapes from input arguments.
std::vector< > LShape GetModified(const & LShape inputShape) const;inputShape Input shape to query for modifications of shapes modified from the input Vector
Parameters:
inputShape- Input shape to query for modifications of shapes modified from the input Vector
GetGenerated
Get list of generated shapes from input arguments.
std::vector< > LShape GetGenerated(const & LShape inputShape) const;inputShape Input shape to query for generated shapes of shapes generated from the input Vector
Parameters:
inputShape- Input shape to query for generated shapes of shapes generated from the input Vector
IsDeleted
Check if an input shape was deleted during the operation.
bool IsDeleted(const & LShape inputShape) const;inputShape Input shape to query True if the shape was deleted
Parameters:
inputShape- Input shape to query True if the shape was deleted
GetErrorCode
Get error code from the last operation.
int GetErrorCode() const;Error code (0 = success, non-zero = error)
GetWarningCode
Get warning code from the last operation.
int GetWarningCode() const;Warning code (0 = no warnings, non-zero = warning)
HasErrors
Check if the operation completed without errors.
bool HasErrors() const;True if no errors occurred
HasWarnings
Check if the operation generated warnings.
bool HasWarnings() const;True if warnings were generated
SetFuzzyValue
Set fuzzy tolerance for the operation.
void SetFuzzyValue(double tolerance) const;tolerance Fuzzy tolerance value (0.0 = precise)
Parameters:
tolerance- Fuzzy tolerance value (0.
GetFuzzyValue
Get current fuzzy tolerance setting.
double GetFuzzyValue() const;Current fuzzy tolerance value
SetGlueOption
Set glue option for the operation.
void SetGlueOption(BooleanGlueType glueType) const;glueType Glue type for adjacent faces
Parameters:
glueType- Glue type for adjacent faces
GetGlueOption
Get current glue option setting.
BooleanGlueType GetGlueOption() const;Current glue type
SetNonDestructive
Enable or disable non-destructive mode.
void SetNonDestructive(bool nonDestructive) const;nonDestructive Whether to preserve input shapes
Parameters:
nonDestructive- Whether to preserve input shapes
IsNonDestructive
Check if non-destructive mode is enabled.
bool IsNonDestructive() const;True if input shapes are preserved
SetUseParallelMode
Enable or disable parallel processing.
void SetUseParallelMode(bool useParallel) const;useParallel Whether to use parallel algorithms
Parameters:
useParallel- Whether to use parallel algorithms
UseParallelMode
Check if parallel processing is enabled.
bool UseParallelMode() const;True if parallel algorithms are used
Type Definitions
OperationType
Operation type enumeration.
BooleanOperationType OperationType;TypeEnum
Generic type alias for templates.
BooleanOperationType TypeEnum;