BRepAlgoAPI_Common produces no geometry

Forums: 

Hi everyone,

I have 2 breps and i would like to get their intersection (see image attatched). The shapes are valid closed solids and they do intersect. However the result is a topods_compound that does not contain any geometry. Does anyone have any tips how to fix this?

The report says "BOPAlgo_AlertBadPositioning", but I could not find any info on how to fix that. I also attatch both shapes as step files (to upload them i had to change their extention to .txt, but they work the same)

Here is my code:

from OCC.Extend.DataExchange import read_step_file
from OCC.Core.BRepAlgoAPI import BRepAlgoAPI_Common
from OCC.Core.BRepCheck import BRepCheck_Analyzer
from OCC.Core.ShapeAnalysis import ShapeAnalysis_FreeBounds

bottomBrep = read_step_file('export/BRepAlgoAPI_Common/20240116_114252_emptyCompound_bottomBrep.txt')
topBrep = read_step_file('export/BRepAlgoAPI_Common/20240116_114252_emptyCompound_topBrep.txt')

commonFunction = BRepAlgoAPI_Common(bottomBrep, topBrep)
commonFunction.Build()
common = commonFunction.Shape()

#ckecking
print(f'Has Generated: {commonFunction.HasGenerated()}')
print(f'HasErrors(): {commonFunction.HasErrors()}')
print(f'GetReport().DumpToString(): {commonFunction.GetReport().DumpToString()}')
analyzer = BRepCheck_Analyzer(bottomBrep)
print('bottomValid: ', analyzer.IsValid())
analyzer = BRepCheck_Analyzer(topBrep)
print('topValid: ', analyzer.IsValid())
free_bounds = ShapeAnalysis_FreeBounds(bottomBrep)
print('bottomBrep has free edges: ', not free_bounds.GetClosedWires().IsNull())
free_bounds = ShapeAnalysis_FreeBounds(topBrep)
print('topBrep has free edges: ', not free_bounds.GetClosedWires().IsNull())

The printed results of checking:

Has Generated: False
HasErrors(): False
GetReport().DumpToString(): BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning
BOPAlgo_AlertBadPositioning

bottomValid:  True
topValid:  True
bottomBrep has free edges:  False
topBrep has free edges:  False