@@ -1112,24 +1112,24 @@ def __init__(self, *args, **kwargs):
11121112 def test_binsurface (self ):
11131113 no , fc = binsurface (self .im )
11141114 expected_fc = [
1115- [10 , 4 , 1 ],
1116- [7 , 10 , 1 ],
1117- [12 , 6 , 5 ],
1118- [11 , 5 , 4 ],
1119- [2 , 3 , 9 ],
1120- [1 , 2 , 8 ],
1121- [11 , 12 , 5 ],
1122- [10 , 11 , 4 ],
1123- [2 , 9 , 8 ],
1124- [1 , 8 , 7 ],
1125- [8 , 9 , 12 ],
1126- [7 , 8 , 11 ],
1127- [6 , 3 , 2 ],
1128- [5 , 2 , 1 ],
1129- [8 , 12 , 11 ],
1130- [7 , 11 , 10 ],
1131- [5 , 6 , 2 ],
11321115 [4 , 5 , 1 ],
1116+ [5 , 6 , 2 ],
1117+ [7 , 11 , 10 ],
1118+ [8 , 12 , 11 ],
1119+ [5 , 2 , 1 ],
1120+ [6 , 3 , 2 ],
1121+ [7 , 8 , 11 ],
1122+ [8 , 9 , 12 ],
1123+ [1 , 8 , 7 ],
1124+ [2 , 9 , 8 ],
1125+ [10 , 11 , 4 ],
1126+ [11 , 12 , 5 ],
1127+ [1 , 2 , 8 ],
1128+ [2 , 3 , 9 ],
1129+ [11 , 5 , 4 ],
1130+ [12 , 6 , 5 ],
1131+ [7 , 10 , 1 ],
1132+ [10 , 4 , 1 ],
11331133 ]
11341134 self .assertEqual (fc .tolist (), expected_fc )
11351135
@@ -1168,7 +1168,7 @@ def test_v2s(self):
11681168 def test_v2m (self ):
11691169 no , el , fc = v2m (self .im , 0.5 , 0.03 , 10 )
11701170 self .assertAlmostEqual (sum (elemvolume (no , fc [:, :3 ])), 5.01 , 2 )
1171- self .assertAlmostEqual (sum (elemvolume (no , el [:, :4 ])), 0.8786 , 4 )
1171+ self .assertAlmostEqual (sum (elemvolume (no , el [:, :4 ])), 0.8786654361973504 , 4 )
11721172
11731173 def test_cgalv2m (self ):
11741174 no , el , fc = v2m (
@@ -1184,11 +1184,12 @@ def test_cgalv2m(self):
11841184 @unittest .skipIf (sys .platform .startswith ("darwin" ), "skip cgals2m" )
11851185 def test_cgals2m (self ):
11861186 node , elem , face = cgals2m (self .no [:, :3 ], self .fc [:, :3 ], 1 , 50 )
1187+
11871188 self .assertAlmostEqual (
1188- sum (elemvolume (node [:, :3 ], face [:, :3 ])) * 0.001 , 2.464594888865948 , 3
1189+ sum (elemvolume (node [:, :3 ], face [:, :3 ])) * 0.001 , 2.456809397314205 , 3
11891190 )
11901191 self .assertAlmostEqual (
1191- sum (elemvolume (node [:, :3 ], elem [:, :4 ])) * 0.001 , 3.9983115207040685 , 2
1192+ sum (elemvolume (node [:, :3 ], elem [:, :4 ])) * 0.001 , 3.983804447661502 , 2
11921193 )
11931194
11941195 def test_v2s_label (self ):
@@ -1252,7 +1253,7 @@ def test_surf2volz(self):
12521253 np .arange (19 , 42 , 1 ),
12531254 np .arange (19 , 42 , 1 ),
12541255 )
1255- self .assertAlmostEqual (np .sum (vol .astype (np .float32 )) * 0.001 , 1.099 , 2 )
1256+ self .assertAlmostEqual (np .sum (vol .astype (np .float32 )) * 0.001 , 1.125 , 2 )
12561257
12571258 def test_surf2vol (self ):
12581259 vol = surf2vol (
@@ -1262,7 +1263,7 @@ def test_surf2vol(self):
12621263 np .arange (19 , 42 , 1 ),
12631264 np .arange (19 , 42 , 1 ),
12641265 )
1265- self .assertAlmostEqual (np .sum (vol .astype (np .float32 )) * 0.001 , 1.704 , 2 )
1266+ self .assertAlmostEqual (np .sum (vol .astype (np .float32 )) * 0.001 , 1.72 , 2 )
12661267
12671268 def test_surf2vol_fill (self ):
12681269 vol = surf2vol (
@@ -1273,11 +1274,11 @@ def test_surf2vol_fill(self):
12731274 np .arange (19 , 42 , 0.5 ),
12741275 fill = 1 ,
12751276 )
1276- self .assertAlmostEqual (np .sum (vol .astype (np .float32 )) * 0.0001 , 3.5536 , 2 )
1277+ self .assertAlmostEqual (np .sum (vol .astype (np .float32 )) * 0.0001 , 3.5391 , 2 )
12771278
12781279 def test_s2v (self ):
12791280 vol = s2v (self .no , self .fc , 100 , fill = 1 )
1280- self .assertAlmostEqual (np .sum (vol .astype (np .float32 )) * 0.00001 , 6.0827 , 2 )
1281+ self .assertAlmostEqual (np .sum (vol .astype (np .float32 )) * 0.00001 , 6.0598097 , 2 )
12811282
12821283 def test_mesh2mask (self ):
12831284 node = np .array ([[0 , 0 ], [2 , 0 ], [2 , 1 ], [0 , 1 ], [1 , 0.5 ]])
0 commit comments