MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / exactinit

Function exactinit

tools/Predicates/predicates.c:644–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

642/*****************************************************************************/
643
644void exactinit()
645{
646 REAL half;
647 REAL check, lastcheck;
648 int every_other;
649
650 every_other = 1;
651 half = 0.5;
652 epsilon = 1.0;
653 splitter = 1.0;
654 check = 1.0;
655 /* Repeatedly divide `epsilon' by two until it is too small to add to */
656 /* one without causing roundoff. (Also check if the sum is equal to */
657 /* the previous sum, for machines that round up instead of using exact */
658 /* rounding. Not that this library will work on such machines anyway. */
659 do {
660 lastcheck = check;
661 epsilon *= half;
662 if (every_other) {
663 splitter *= 2.0;
664 }
665 every_other = !every_other;
666 check = 1.0 + epsilon;
667 } while ((check != 1.0) && (check != lastcheck));
668 splitter += 1.0;
669
670 /* Error bounds for orientation and incircle tests. */
671 resulterrbound = (3.0 + 8.0 * epsilon) * epsilon;
672 ccwerrboundA = (3.0 + 16.0 * epsilon) * epsilon;
673 ccwerrboundB = (2.0 + 12.0 * epsilon) * epsilon;
674 ccwerrboundC = (9.0 + 64.0 * epsilon) * epsilon * epsilon;
675 o3derrboundA = (7.0 + 56.0 * epsilon) * epsilon;
676 o3derrboundB = (3.0 + 28.0 * epsilon) * epsilon;
677 o3derrboundC = (26.0 + 288.0 * epsilon) * epsilon * epsilon;
678 iccerrboundA = (10.0 + 96.0 * epsilon) * epsilon;
679 iccerrboundB = (4.0 + 48.0 * epsilon) * epsilon;
680 iccerrboundC = (44.0 + 576.0 * epsilon) * epsilon * epsilon;
681 isperrboundA = (16.0 + 224.0 * epsilon) * epsilon;
682 isperrboundB = (5.0 + 72.0 * epsilon) * epsilon;
683 isperrboundC = (71.0 + 1408.0 * epsilon) * epsilon * epsilon;
684}
685
686/*****************************************************************************/
687/* */

Callers 6

is_colinear_2DMethod · 0.85
is_colinear_3DMethod · 0.85
get_degenerated_facesMethod · 0.85
get_tet_orientationsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected