For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Trying to find out what is wrong with my Brep shapes

Keith Sloan's picture

Okay I am trying to find out what is wrong with my Brep shapes.

The error shows up when I try a Boolean Subtraction in my FreeCAD application.

Attached is a screen shot of the boolean hierarchy and the objects which I saved as brep files

In FreeCAD a check geometry just reveals fatal error on boolean or Boolean operation fails.

Is there a good tool for checking Brep shapes in Linux, Salome perhaps. Don't want to try
and install without a recommendation.

Thanks in anticipation

Sergey Slyadnev's picture

The attached shapes seem to be empty. Are you sure you have correctly dumped them to BREP?


CASCADE Topology V1, (c) Matra-Datavision
Locations 0
Curve2ds 0
Curves 0
Polygon3D 0
PolygonOnTriangulations 0
Surfaces 0
Triangulations 0

TShapes 0

Keith Sloan's picture

Well if they are empty then that would explain why the boolean subtraction fails.
I will gp check both

Keith Sloan's picture

Shapes are indeed null, so have to find the bug that means this is the case.

Thanks for your help.

What did you use to list details? Drawexe?

Sergey Slyadnev's picture

This time just opened the files in Notepad wink

Keith Sloan's picture

Okay was not saving at the right stage. FreeCAD object created but Shape not created until
execute function called.

Attached are Brep's for the basic shapes concerned.

Still have to work out how I can save before and after of boolean

Sergey Slyadnev's picture

Can you check if for the attached shapes a Boolean Operation works better? I had to remove manually degenerated faces with non-closed contours and then stictch the remaining faces to make the input BReps watertight.

Keith Sloan's picture

I can import these Breps and a boolean subtraction works fine.

The problem is these shapes were created by API and I need to correct the code
so I am assuming from your comments I have some  faces that are not closed

for s in range(0,len(sections)-1) :
           xOffset1   = sections[s][1]
           yOffset1   = sections[s][2]
           zPosition1 = sections[s][3]
           sf1        = sections[s][4]
           xOffset2   = sections[s+1][1]
           yOffset2   = sections[s+1][2]
           zPosition2 = sections[s+1][3]
           sf2        = sections[s+1][4]
           for p in polyList :
              vb=FreeCAD.Vector(p[0]*sf1+xOffset1, p[1]*sf1+yOffset1,zPosition1)
              #vb=FreeCAD.Vector(-20, p[1]*sf1+yOffset1,zPosition1)
              vt=FreeCAD.Vector(p[0]*sf2+xOffset2, p[1]*sf2+yOffset2,zPosition2)
              #vt=FreeCAD.Vector(20, p[1]*sf2+yOffset2,zPosition2)
           # close polygons
           # deal with base face w1 = Part.makePolygon(baseList)
           f1 = Part.Face(w1)
           print("base list")
           print("Top list")
           # deal with side faces
           # remember first point is added to end of list
           for i in range(0,len(baseList)-1) :
               sideList = []
               # Close SideList polygon
                w1 = Part.makePolygon(sideList)
                f1 = Part.Face(w1)
          # deal with top face
          w1 = Part.makePolygon(topList)
          f1 = Part.Face(w1)
          print("Faces List")
           print("Valid Solid : "+str(solid.isValid()))
            if solid.Volume < 0:
       fp.Shape = solid

Keith Sloan's picture

Okay the Brep for the failed boolean subtraction attached.

Keith Sloan's picture

Okay I loaded one of the breps from into FreeCAD and did a check geometry
it reports 8 vertex which is correct. 13 edges where as I think there should be 12. Face 7 and
wires 7 where as there should be 6.

Thanks for your help I now have more to go on.

Keith Sloan's picture

Code now fixed.

Thanks again

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.