View Issue Details

IDProjectCategoryView StatusLast Update
0001331FreeCADBugpublic2015-01-06 23:19
Reporterangusjnorth Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionunable to reproduce 
Platform32-bitOSWindows XP 
Product Version0.13 
Summary0001331: Cannot cut in 2D, then extrude resulting shape, then cut using that shape in 3D
DescriptionHi
I am using FreeCAD for semiconductor process modelling.
That involves making complex shapes (masks) in 2D, with Boolean operations, mostly cut.
Then we extrude those shapes in 3D, then cut from another 3D shape to represent an etch process.
This doesn't work - I get
Traceback (most recent call last):
  File "<input>", line 1, in <module>
Exception: BRep_API: command not done

It works if I do all the cuts in 3D after extruding the individual polygons first, but that doesn't accurately represent the physical process I'm simulating and that makes the code far less readable.
Steps To Reproduceimport Draft
import FreeCAD

r1=Draft.makeRectangle(27.75,52.475,FreeCAD.Placement(FreeCAD.Vector(-13.875,-45.2875,7),FreeCAD.Rotation(0,0,0,1)))

r2=Draft.makeRectangle(12.75,4,FreeCAD.Placement(FreeCAD.Vector(-6.375,-13.2875,7),FreeCAD.Rotation(0,0,0,1)))

cm = r1.Shape.cut(r2.Shape).extrude(Base.Vector(0,0,-6))

sol=Part.makeSolid(Part.makeBox(31.75, 63.5, 6, Base.Vector(15.875,-51.51257, 7), Base.Vector(0, 0, -1)))

sol.cut(cm)

Traceback (most recent call last):
  File "<input>", line 1, in <module>
Exception: BRep_API: command not done
TagsNo tags attached.
FreeCAD Information

Activities

tanderson69

2013-12-16 15:03

developer   ~0003939

This is NOT happening here.

Freecad sha 1333cb87348c8a9
OCE 0.14.1

Are you sure that the solids you are sending to the failing cut are what you expect? This workflow seems very unusual.

wandererfan

2013-12-18 00:13

manager   ~0003940

Fails here (OCC vs OCE?):

OS: Ubuntu 12.04.3 LTS
Platform: 64-bit
Version: 0.14.2849 (Git)
Branch: SSPrefPatch
Hash: 70946758451ddeeceb9520380bab29777e2a8a49
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.1

wandererfan

2013-12-18 00:16

manager   ~0003941

OCC doesn't like 2D Boolean ops very much. If the contours aren't too complicated, you can make your Face with a list of Wires instead.

See pcb.py

wandererfan

2013-12-18 00:16

manager  

pcb.py (Attachment missing)

angusjnorth

2013-12-18 02:57

reporter   ~0003942

Last edited: 2013-12-18 03:15

> Are you sure that the solids you are sending to the failing cut are what you expect?

Yes, the 2D shapes are fine.

> This workflow seems very unusual.

It makes sense in the semiconductor processing context. Masks are 2D, but after etching, deposition etc., 3D shapes are created (from extruded 2D shapes). To make up the 2D shapes I was fusing together a bunch of 2D rectangles, which as wandererfan suggests may be triggering the bug.

I worked around this problem by doing all my Boolean operations in 3D (no Booleans on 2D objects), and that works so I'm not that fussed about this bug now.

My code is now:

    def CHAMBERmask(self, zPlacement, thickness):
        r1=Draft.makeRectangle(self.CHAMBERWIDTH,self.CHAMBERLENGTH,FreeCAD.Placement(FreeCAD.Vector(self.CHAMBERx,self.CHAMBERy,zPlacement),FreeCAD.Rotation(0,0,0,1)))
        r2=Draft.makeRectangle(self.BAFFLELENGTH,self.WALLTHICKNESS,FreeCAD.Placement(FreeCAD.Vector(self.BAFFLEx,self.BAFFLEy,zPlacement),FreeCAD.Rotation(0,0,0,1)))

        CHAMBERmask = r1.Shape.extrude(FreeCAD.Vector(0,0,-thickness)).cut(r2.Shape.extrude(FreeCAD.Vector(0,0,-thickness)))

        self.clearRectangles()

        return CHAMBERmask # this is now 3D, not 2D, so further booleans using this mask are ok

Thanks
Angus

angusjnorth

2013-12-18 03:07

reporter   ~0003943

Thanks for pcb.py wandererfan - maybe I'll use that method instead. I see I had a spurious Part.makeSolid in my code too.

Issue History

Date Modified Username Field Change
2013-12-16 02:50 angusjnorth New Issue
2013-12-16 15:03 tanderson69 Note Added: 0003939
2013-12-18 00:13 wandererfan Note Added: 0003940
2013-12-18 00:16 wandererfan Note Added: 0003941
2013-12-18 00:16 wandererfan File Added: pcb.py
2013-12-18 02:57 angusjnorth Note Added: 0003942
2013-12-18 03:07 angusjnorth Note Added: 0003943
2013-12-18 03:15 angusjnorth Note Edited: 0003942
2015-01-06 23:19 wmayer Status new => closed
2015-01-06 23:19 wmayer Resolution open => unable to reproduce