From feaedd5756afb37c26cdd01fb75ad01bfdc7a107 Mon Sep 17 00:00:00 2001
From: emv <emv@opencascade.com>
Date: Mon, 16 Jul 2018 13:03:17 +0300
Subject: [PATCH] 0027230: Boolean operations fails on attached shapes

Test case for the issue as it is not reproduced anymore.
---
 tests/bugs/modalg_7/bug27230 | 46 ++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 tests/bugs/modalg_7/bug27230

diff --git a/tests/bugs/modalg_7/bug27230 b/tests/bugs/modalg_7/bug27230
new file mode 100644
index 0000000000..3483fb47a1
--- /dev/null
+++ b/tests/bugs/modalg_7/bug27230
@@ -0,0 +1,46 @@
+puts "=============================================================="
+puts "OCC27230: Boolean operations fails on attached shapes"
+puts "=============================================================="
+puts ""
+
+brestore [locate_data_file bug27230_s1.brep] s1
+brestore [locate_data_file bug27230_s2.brep] s2
+
+bclearobjects
+bcleartools
+baddobjects s1
+baddtools s2
+bfillds
+
+bbop r0 0
+bbop r1 1
+bbop r2 2
+bbop r3 3
+bbop r4 4
+
+foreach r {r0 r1 r2 r3 r4} {
+  checkshape $r
+  if {![regexp "OK" [bopcheck $r]]} {
+    puts "Error: the result of BOP is self-interfering shape"
+  }
+}
+
+checknbshapes r0 -wire 10 -face 8 -shell 1 -solid 1
+checkprops r0 -s 8224.83 -v 17106.7
+
+checknbshapes r1 -wire 22 -face 18 -shell 1 -solid 1
+checkprops r1 -s 75638.3 -v 661141
+
+checknbshapes r2 -wire 16 -face 14 -shell 2 -solid 2
+checkprops r2 -s 40609.3 -v 322017
+
+checknbshapes r3 -wire 16 -face 12 -shell 1 -solid 1
+checkprops r3 -s 43253.8 -v 322017
+
+checkprops r4 -l 345.256
+
+if {![regexp "nb alone Vertices : 0" [checksection r4]]} {
+  puts "Error: Section is not closed"
+}
+
+checkview -display r1 -2d -path ${imagedir}/${test_image}.png