# check if deviation is clearly within a range
return [expr abs ($mean - $delta) <= $sigma && $sigma <= $tolerance]
}
+
+# Check if area of triangles is valid
+proc CheckTriArea {shape {eps 0}} {
+ upvar #0 $shape result
+ set area [triarea result $eps]
+ set t_area [lindex $area 0]
+ set g_area [expr abs([lindex $area 1])]
+ puts "area by triangles: $t_area"
+ puts "area by geometry: $g_area"
+ expr ($t_area - $g_area) / $g_area * 100
+}
NewDocument D MDTV-Standard
######################################################
-catch { SaveAs D ${imagedir}/OCC381.std }
+catch { SaveAs D ${imagedir}/OCC381_1.std }
if { [catch { OCC381_Save D } ] } {
puts "OCC381: Error"
} else {
- catch { exec chmod 777 ${imagedir}/OCC381.std }
- file delete ${imagedir}/OCC381.std
+ catch { exec chmod 777 ${imagedir}/OCC381_1.std }
+ file delete -force ${imagedir}/OCC381_1.std
}
NewDocument D MDTV-Standard
######################################################
-if { [catch { OCC381_SaveAs D ${imagedir}/OCC381.std}] } {
+if { [catch { OCC381_SaveAs D ${imagedir}/OCC381_2.std}] } {
puts "OCC381: Error"
} else {
- catch {exec chmod 777 ${imagedir}/OCC381.std}
- file delete ${imagedir}/OCC381.std
+ catch {exec chmod 777 ${imagedir}/OCC381_2.std}
+ file delete -force ${imagedir}/OCC381_2.std
}
edge e3 v3 v1
wire w1 e1 e2 e3
plane pln 0 10 0 1 0 0
-mkface f1 pln w1
+mkface f1 pln
+add w1 f1
don f1
revol result f1 0 10 0 0 0 1 180
checkshape result
-set square 673.385
+set square 823.385
set nb_v_good 3
set nb_e_good 8
edge e3 v3 v1
wire w1 e1 e2 e3
plane pln 0 5 5 1 0 0
-mkface f1 pln w1
+mkface f1 pln
+add w1 f1
don f1
revol result f1 0 10 0 0 0 1 180
checkshape result
-set square 161.072
+set square 186.072
set nb_v_good 3
set nb_e_good 8
addsweep profile
buildsweep result
-set square 8997.97
+set square 8805.92
set nb_v_good 2
set nb_e_good 3
addsweep profile
buildsweep result
-set square 38260.5
+set square 38663.7
set nb_v_good 2
set nb_e_good 3
concatC0wire aa a
concatC0wire bb b
-tolerance aa
+set CMP_TOL 1.e-6
+
+# 1
checkshape aa
+set tolmaxres [tolmax aa]
+regexp {max tol = ([-0-9.+eE]+)} $tolmaxres full MaxTolerance
+if { ${MaxTolerance} > ${CMP_TOL} } {
+ puts "Error: invalid tolerance of first wire"
+}
-tolerance bb
+# 2
checkshape bb
+set tolmaxres [tolmax bb]
+regexp {max tol = ([-0-9.+eE]+)} $tolmaxres full MaxTolerance
+if { ${MaxTolerance} > ${CMP_TOL} } {
+ puts "Error: invalid tolerance of second wire"
+}
--- /dev/null
+puts "================"
+puts "OCC23849"
+puts "================"
+puts ""
+#######################################################################
+# BOP regression
+#######################################################################
+
+set BugNumber OCC23849
+
+restore [locate_data_file bug23849_segment_1.brep] b1
+restore [locate_data_file bug23849_plane_1.brep] b2
+
+bop b1 b2
+bopcommon result
+
+set square empty
--- /dev/null
+puts "================"
+puts "OCC23849"
+puts "================"
+puts ""
+#######################################################################
+# BOP regression
+#######################################################################
+
+set BugNumber OCC23849
+
+restore [locate_data_file bug23849_segment_1.brep] b1
+explode b1 f
+
+point p2D 4.1882396063720497 50.643343428894831
+
+set info [b2dclassify b1_1 p2D]
+set check [regexp "ON" $info]
+
+if { ${check} == 1 } {
+ puts "OK ${BugNumber}"
+} else {
+ puts "Faulty ${BugNumber}"
+}
--- /dev/null
+puts "================"
+puts "OCC23849"
+puts "================"
+puts ""
+#######################################################################
+# BOP regression
+#######################################################################
+
+set BugNumber OCC23849
+
+restore [locate_data_file bug23849_segment_2.brep] b1
+restore [locate_data_file bug23849_plane_2.brep] b2
+
+bop b1 b2
+bopcommon result
+
+set square empty
#12 modify
NewCommand D
-PntOffset D $Pnt1 40 25 skip
+PntOffset D $Pnt1 25 15 skip
#13 recompute
NewCommand D
set TheFileName shading_099.brep
-if { [string compare $command "shading"] != 0 } {
- set bug_area "OCC22687"
- set rel_tol 1.5
-}
+set bug_area "OCC22687"
+set rel_tol 1.5
set TheFileName shading_wrongshape_027.brep
set bug_freenodes "OCC22687"
-set nbfreenodes(All) 1
+set nbfreenodes(All) 2
if { [string compare $command "shading"] != 0 } {
set bug_area "OCC22687"
set rel_tol 1.1
}
+set nbcross(All) 2
+set bug_cross "OCC23184"
if { $rel_tol == 100 } {
puts "TODO $bug_area All:^\\s*Error : The meshing algo cannot create mesh.\\s*$"
} else {
- puts "TODO $bug_area All:^\\s*Error : area by triangles differs from the actual area by \[-.0-9\]+ %\\s*$"
+ puts "TODO ?$bug_area All:^\\s*Error : area by triangles differs from the actual area by \[-.0-9\]+ %\\s*$"
}
}
# It may be different for different OS
foreach os_cross [array names nbcross] {
if { $nbcross($os_cross) != 0 } {
- puts "TODO $bug_cross $os_cross:^\\s*Error: Cross face errors: $nbcross($os_cross)\\b\\s*"
+ puts "TODO $bug_cross $os_cross:Error: Cross face errors"
}
}
}
# It may be different for different OS
foreach os_freenodes [array names nbfreenodes] {
if { $nbfreenodes($os_freenodes) != 0 } {
- puts "TODO $bug_freenodes $os_freenodes:^\\s*Error: Free nodes: $nbfreenodes($os_freenodes)\\b\\s*"
+ puts "TODO $bug_freenodes $os_freenodes:Error: Free nodes"
}
}
}