0030145: Modeling Algorithms - Boolean Operations on open solids
[occt.git] / tests / boolean / opensolid / A3
diff --git a/tests/boolean/opensolid/A3 b/tests/boolean/opensolid/A3
new file mode 100644 (file)
index 0000000..db57478
--- /dev/null
@@ -0,0 +1,44 @@
+puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_2"
+
+box b1 -15 0 0 20 5 5
+box b2 5 5 20
+
+shape s1 So
+shape s2 So
+shape sh1 Sh
+shape sh2 Sh
+
+foreach f [lrange [explode b1 f] 1 5] { add $f sh1 }
+foreach f [lrange [explode b2 f] 0 4] { add $f sh2 }
+
+add sh1 s1
+add sh2 s2
+
+bclearobjects
+bcleartools
+baddobjects s1
+baddtools s2
+bfillds
+
+bbop r0 0
+bbop r1 1
+bbop r2 2
+bbop r3 3
+
+foreach r {r0 r1 r2 r3} {
+  checkshape $r
+  if {![regexp "OK" [bopcheck $r]]} {
+    puts "Error: shape is self-interfered"
+  }
+}
+
+checknbshapes r0 -vertex 8 -edge 12 -wire 6 -face 6 -shell 1 -solid 1
+checkprops r0 -s 150
+
+checknbshapes r1 -vertex 16 -edge 28 -wire 12 -face 12 -shell 1 -solid 1
+checkprops r1 -s 700
+
+foreach r {r2 r3} {
+  checknbshapes $r -vertex 8 -edge 12 -wire 5 -face 5 -shell 1 -solid 1
+  checkprops $r -s 325
+}