# Path: Generic/Kernel/GeoUtil/tolerance.py
# TOL = 1e-10


import random
import string 
import types
from math import fmod, pi
from .tolerance import TOL
        from Kernel.GeoEntity.segment import Segment
        from Kernel.GeoEntity.point import Point
        from Kernel.GeoUtil.geolib import Vector
def get_float(val):
    _v = val
    if not isinstance(_v, float):
        if not isinstance(_v, int):
            raise TypeError("Invalid non-numeric type: " + str(type(_v)))
        _v = float(val)
    return _v

def test_boolean(val):
    if hasattr(types, 'BooleanType'):
        if not isinstance(val, types.BooleanType):
            raise TypeError("Invalid non-boolean type: " + str(type(val)))
    else:
        if val is not True and val is not False:
            raise TypeError("Invalid non-boolean type: " + str(type(val)))

def tuple_to_two_floats(t):
    if not isinstance(t, tuple):
        raise TypeError("Argument must be a tuple: " + str(type(t)))
    if len(t) != 2:
        raise ValueError("Tuple must hold exactly two objects: " + str(t))
    _obj1, _obj2 = t
    _x = get_float(_obj1)
    _y = get_float(_obj2)
    return _x, _y

def tuple_to_three_floats(t):
    if not isinstance(t, tuple):
        raise TypeError("Argument must be a tuple: " + str(type(t)))
    if len(t) != 3:

# Path: Generic/Kernel/GeoUtil/tolerance.py
# TOL = 1e-10


# Path: Generic/Kernel/GeoUtil/util.py
import random
import string 
import types
from math import fmod, pi
from .tolerance import TOL
        from Kernel.GeoEntity.segment import Segment
        from Kernel.GeoEntity.point import Point
        from Kernel.GeoUtil.geolib import Vector

def get_float(val):
    _v = val
    if not isinstance(_v, float):
        if not isinstance(_v, int):
            raise TypeError("Invalid non-numeric type: " + str(type(_v)))
        _v = float(val)
    return _v

def test_boolean(val):
    if hasattr(types, 'BooleanType'):
        if not isinstance(val, types.BooleanType):
            raise TypeError("Invalid non-boolean type: " + str(type(val)))
    else:
        if val is not True and val is not False:
            raise TypeError("Invalid non-boolean type: " + str(type(val)))

def tuple_to_two_floats(t):
    if not isinstance(t, tuple):
        raise TypeError("Argument must be a tuple: " + str(type(t)))
    if len(t) != 2:
        raise ValueError("Tuple must hold exactly two objects: " + str(t))
    _obj1, _obj2 = t
    _x = get_float(_obj1)
    _y = get_float(_obj2)
    return _x, _y

def tuple_to_three_floats(t):
    if not isinstance(t, tuple):
        raise TypeError("Argument must be a tuple: " + str(type(t)))
    if len(t) != 3:

        raise ValueError("Tuple must hold exactly three objects: " + str(t))