File wellmet/dicebox/circumtri.py changed (mode: 100644) (index 3ed327d..9df95d1) |
... |
... |
class CircumTri: |
331 |
331 |
bx.convex_hull.update() |
bx.convex_hull.update() |
332 |
332 |
bx.estimate_outside() |
bx.estimate_outside() |
333 |
333 |
|
|
334 |
|
#bx.estimations.append(bx.get_pf_estimation()) |
|
|
334 |
|
bx.estimations.append(bx.get_pf_estimation()) |
335 |
335 |
|
|
336 |
336 |
|
|
337 |
337 |
|
|
|
... |
... |
class CircumTri: |
431 |
431 |
#č takže musíme sami lepit nové etikety |
#č takže musíme sami lepit nové etikety |
432 |
432 |
bx.global_stats['nsim'] = bx.nsim |
bx.global_stats['nsim'] = bx.nsim |
433 |
433 |
|
|
|
434 |
|
#č kvůli názvu neleze do namedtuple |
|
435 |
|
bx.global_stats.pop('2FORM_outside', None) |
|
436 |
|
|
434 |
437 |
failsi = bx.failsi |
failsi = bx.failsi |
435 |
438 |
|
|
436 |
439 |
if 'tri' in dir(bx): |
if 'tri' in dir(bx): |
437 |
|
#č Tri.get_pf_estimation() vrací: |
|
438 |
|
# 'TRI_estimation': tri_estimation, 'global_stats': {mix, failure}, \ |
|
439 |
|
#'vertex_estimation' : vertex_estimation, \ |
|
440 |
|
#'weighted_vertex_estimation' : weighted_vertex_estimation, |
|
441 |
|
#'coplanar':sx.tri.coplanar} |
|
442 |
|
estimations = bx.Tri.get_pf_estimation() |
|
443 |
|
# TRI-compatible estimation |
|
444 |
|
# -1=outside, 0=success, 1=failure, 2=mix |
|
445 |
|
#č to je JustTriangulation, |
|
446 |
|
#č outside (-1), ani success (1) nebudou korektní |
|
447 |
|
tri_estimation = estimations.pop('TRI_estimation') |
|
448 |
|
tri_estimation[-1] = pf_outside |
|
449 |
|
tri_estimation[0] = pf_inside - tri_estimation[1] - tri_estimation[2] |
|
450 |
|
estimations['TRI_overall_estimations'] = tri_estimation |
|
451 |
|
estimations['ghull_estimation'] = bx.ghull_estimation |
|
452 |
|
|
|
453 |
|
#č hrozně důležitý. Těšíme se na csv-čko. |
|
454 |
|
bx.global_stats.update(estimations['global_stats']) |
|
|
440 |
|
bx.global_stats.update(bx.Tri.get_pf_estimation()) |
|
441 |
|
failure = bx.global_stats['failure'] |
|
442 |
|
mixed = bx.global_stats['mix'] |
455 |
443 |
bx.global_stats['success_points'] = len(failsi[~failsi]) |
bx.global_stats['success_points'] = len(failsi[~failsi]) |
456 |
444 |
bx.global_stats['failure_points'] = len(failsi[failsi]) |
bx.global_stats['failure_points'] = len(failsi[failsi]) |
457 |
|
bx.global_stats['success'] = tri_estimation[0] |
|
|
445 |
|
bx.global_stats['success'] = pf_inside - failure - mixed |
458 |
446 |
bx.global_stats['candidates_sets'] = len(bx.candidates_index) |
bx.global_stats['candidates_sets'] = len(bx.candidates_index) |
459 |
|
estimations['global_stats'].update(bx.global_stats) |
|
460 |
|
return estimations |
|
|
447 |
|
|
|
448 |
|
return TriEstimation(**bx.global_stats) |
461 |
449 |
|
|
462 |
450 |
|
|
463 |
451 |
#оӵ триангуляци ӧвӧл, иськем... |
#оӵ триангуляци ӧвӧл, иськем... |
|
... |
... |
class CircumTri: |
491 |
479 |
global_stats['candidates_sets'] = len(bx.candidates_index) |
global_stats['candidates_sets'] = len(bx.candidates_index) |
492 |
480 |
global_stats['ncoplanar'] = 0 |
global_stats['ncoplanar'] = 0 |
493 |
481 |
|
|
494 |
|
return {'TRI_overall_estimations': tri_estimation, \ |
|
495 |
|
'vertex_estimation' : vertex_estimation, \ |
|
496 |
|
'weighted_vertex_estimation' : weighted_vertex_estimation, \ |
|
497 |
|
'ghull_estimation' : bx.ghull_estimation} |
|
|
482 |
|
return TriEstimation(**global_stats) |
498 |
483 |
|
|
499 |
484 |
|
|