View Issue Details

IDProjectCategoryView StatusLast Update
0001143FreeCADBugpublic2013-06-18 15:12
Reporterwandererfan Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Versiontrunk 
Target VersionFixed in Version0.14 
Summary0001143: Boolean Cut Fails with Extruded Shapestring
DescriptionUsing an extruded Draft.ShapeString as a cutting tool (mysolid.cut(extrudedSS) will fail with: "Boolean operation failed" (from GUI), or, "<type 'exceptions.Exception'>: BRep_API: command not done" (from script).

This only happens for characters with voids ('O' fails, 'I' does not).

The "face" (actually a compound) shape generated by ShapeString for characters with voids seems corrupt. Edges are not sorted in nose to tail order, and outer wire Orientation is incorrect.

Attached script will generate error.
Additional InformationOS: Ubuntu 12.04.2 LTS
Platform: 64-bit
Version: 0.13.2115 (Git)
Branch: master
Hash: 7b703af113d0190242376ec9c9c365d98c42f057
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
TagsNo tags attached.
FreeCAD Information

Activities

2013-05-29 09:49

 

testSSBoolean.py (Attachment missing)

2013-06-02 10:05

 

Draft.patch (Attachment missing)

wandererfan

2013-06-02 10:14

manager   ~0003188

Attached "Draft.patch" file is a hack that seems to work, but it is really slow. It builds a new glyph face from the 'almost correct' glyph face after fixing all the wires.

Working on a better algorithm.

normandc

2013-06-10 02:00

manager   ~0003192

FYI this happens with boolean fuse as well.

The current workaround I found was to explode the ShapeString object to faces with the Draft Downgrade tool, then extrude the faces. Booleans work then. Of course the resulting faces are non editable.

wmayer

2013-06-11 17:00

administrator   ~0003195

Last edited: 2013-06-11 17:55

The problem obviously is that for letters with voids the shape has inverted orientation. That's why it fails with boolean operations because the algorithm fails to detect inner and outer.

In the property editor you can see this easily by setting Lighting to "One side".

So, the bug must be somewhere in the function Draft.makeGlyph().

FYI: For the sketcher we have a similar algorithm where we get a list of wires. The wire with the biggest bounding box is assumed to build the face while wires inside this wire form holes in the face. Wires outside the wire are additional faces.

shoogen

2013-06-12 04:19

developer   ~0003196

i implemented a similar function in OpenSCAD2Dgeom.edgestofaces()

wmayer

2013-06-12 06:14

administrator   ~0003198

Playing with a few more fonts it's probably not the orientation that makes problems but maybe the use of boolean operations inside makeGlyph(). There is really no need for that because it's very slow and it is supposed to be used with solids only. Using it for faces seems to work but could also be the reason for the malformed wires.

wmayer

2013-06-12 13:05

administrator   ~0003199

git show 2282b72 replaces makeGlyph() with something similar used for sketches which already fixes many problems.

wmayer

2013-06-18 15:12

administrator   ~0003231

Should work now.

Issue History

Date Modified Username Field Change
2013-05-29 09:49 wandererfan New Issue
2013-05-29 09:49 wandererfan File Added: testSSBoolean.py
2013-06-02 10:05 wandererfan File Added: Draft.patch
2013-06-02 10:14 wandererfan Note Added: 0003188
2013-06-10 02:00 normandc Note Added: 0003192
2013-06-11 17:00 wmayer Note Added: 0003195
2013-06-11 17:50 wmayer Note Edited: 0003195
2013-06-11 17:55 wmayer Note Edited: 0003195
2013-06-12 04:19 shoogen Note Added: 0003196
2013-06-12 06:14 wmayer Note Added: 0003198
2013-06-12 13:05 wmayer Note Added: 0003199
2013-06-18 15:12 wmayer Note Added: 0003231
2013-06-18 15:12 wmayer Status new => closed
2013-06-18 15:12 wmayer Resolution open => fixed
2013-06-18 15:12 wmayer Fixed in Version => 0.14