Archived issue #0033536
BRepAlgoAPI_Cut produces broken shapes
Description
We, in KiCad, are using BRepAlgoAPI_Cut to cut holes (mostly cylindrical) out of track segments and zone fills.
Unfortunately, this operation produces bad shapes in some cases.
Test cases and the test script is attached.
Tested in versions 7.7.0 (Draw Harness), 7.7.2 (C++), and the latest [revision removed] (Draw Harness, C++)
Unfortunately, this operation produces bad shapes in some cases.
Test cases and the test script is attached.
Tested in versions 7.7.0 (Draw Harness), 7.7.2 (C++), and the latest [revision removed] (Draw Harness, C++)
Steps to reproduce
1. Extract Attachment 1 (ZIP) into cut_data directory
2. Put Attachment 2 (TCL) at the same level as the cut_data directory and draw.bat
3. Start draw.bat
4. Execute command: source Attachment 2 (TCL)
The script will cut shapes using different fuzzy values (0 and 0.0005), check, attempt to fix the result, check the fixed shape.
It also saves all outputs.
Comments in the tcl script basically describe the encountered deficiencies:
_mycheck "zones/zones_bad_1"; # Self-interfering (constructed with precision 0.001 mm)
_mycheck "zones/zones_1"; # OK (constructed with default precision)
_mycheck "tracks_nfuz/tracks_690"; # Bad, no warning after Cut
_mycheck "tracks_nfuz/tracks_3866"; # Bad but OK for shape check
_mycheck "tracks_fuz/tracks_363"; # Bad with fuzzy value
_mycheck "tracks_fuz/tracks_873"; # Bad with fuzzy value
_mycheck "tracks_fuz/tracks_3085"; # Bad with fuzzy value
2. Put Attachment 2 (TCL) at the same level as the cut_data directory and draw.bat
3. Start draw.bat
4. Execute command: source Attachment 2 (TCL)
The script will cut shapes using different fuzzy values (0 and 0.0005), check, attempt to fix the result, check the fixed shape.
It also saves all outputs.
Comments in the tcl script basically describe the encountered deficiencies:
_mycheck "zones/zones_bad_1"; # Self-interfering (constructed with precision 0.001 mm)
_mycheck "zones/zones_1"; # OK (constructed with default precision)
_mycheck "tracks_nfuz/tracks_690"; # Bad, no warning after Cut
_mycheck "tracks_nfuz/tracks_3866"; # Bad but OK for shape check
_mycheck "tracks_fuz/tracks_363"; # Bad with fuzzy value
_mycheck "tracks_fuz/tracks_873"; # Bad with fuzzy value
_mycheck "tracks_fuz/tracks_3085"; # Bad with fuzzy value
Additional information
*_orig.brep files are arguments
*_hole_0.brep files are tools
*_cut.brep are the cut results we're getting in KiCad.
*_hole_0.brep files are tools
*_cut.brep are the cut results we're getting in KiCad.
Public activity
2 archived notes
Participants are labeled by their role within this record.
Added some CAD Assistant screenshots.
Attachment 4 (PNG) (31,384 bytes)
Attachment 5 (PNG) (22,499 bytes)
Attachment 6 (PNG) (38,799 bytes)
Attachment 3 (PNG) (21,505 bytes)
Still reproduces in 7.8.0+ ([revision removed])