# Path: importerConstants.py
# MIN_0   = 0.0
# 
# MIN_PI  = -pi
# 
# MIN_PI2 = -pi / 2
# 
# MIN_INF = float('-inf')
# 
# MAX_2PI = 2 * pi
# 
# MAX_PI  = pi
# 
# MAX_PI2 = pi / 2
# 
# MAX_INF = float('inf')
# 
# MAX_LEN = 2e+100
# 
# Path: importerConstants.py
# CENTER = VEC(0, 0, 0)
# 
# DIR_X  = VEC(1, 0, 0)
# 
# DIR_Y  = VEC(0, 1, 0)
# 
# DIR_Z  = VEC(0, 0, 1)
# 
# ENCODING_FS      = 'utf8'


import traceback, Part, Draft, os, FreeCAD, re
from importerUtils              import *
from FreeCAD                    import Vector as VEC, Rotation as ROT, Placement as PLC, Matrix as MAT, Base
from math                       import pi, fabs, degrees, asin, sin, cos, tan, atan2, ceil, e, cosh, sinh, tanh, acos, acosh, asin, asinh, atan, atanh, log, sqrt, exp, log10
from importerConstants          import MIN_0, MIN_PI, MIN_PI2, MIN_INF, MAX_2PI, MAX_PI, MAX_PI2, MAX_INF, MAX_LEN
from importerConstants          import CENTER, DIR_X, DIR_Y, DIR_Z, ENCODING_FS

def getParameterization(pts, fac, closed):
        # Computes a knot Sequence for a set of points
        # fac (0-1) : parameterization factor
        #     0 -> Uniform
        #     0.5 -> Centripetal
        #     1.0 -> Chord-Length
        if closed: # we need to add the first point as the end point
            pts.append(pts[0])
        params = [0]
        for i in range(1, len(pts)):
            p = pts[i].sub(pts[i-1])
            pl = pow(p.Length, fac) # parametrization -> Chord-Length
            params.append(params[-1] + pl)
        return params

class BDY_GEOM(object):
	def __init__(self, svId):
		self.svId  = svId
		self.shape = None
		self.__ready_to_build__ = True  # Don't try to create me more than once
	def build(self):
		if (self.__ready_to_build__):
			self.__ready_to_build__ = False
			self.buildCurve()
		return self.shape
class BDY_GEOM_CIRCLE(BDY_GEOM):
	def __init__(self):
		super(BDY_GEOM_CIRCLE, self).__init__('circle')
		self.curve      = None
		self.twist      = (None, None)

# Path: importerConstants.py
# MIN_0   = 0.0
# 
# MIN_PI  = -pi
# 
# MIN_PI2 = -pi / 2
# 
# MIN_INF = float('-inf')
# 
# MAX_2PI = 2 * pi
# 
# MAX_PI  = pi
# 
# MAX_PI2 = pi / 2
# 
# MAX_INF = float('inf')
# 
# MAX_LEN = 2e+100
# 
# Path: importerConstants.py
# CENTER = VEC(0, 0, 0)
# 
# DIR_X  = VEC(1, 0, 0)
# 
# DIR_Y  = VEC(0, 1, 0)
# 
# DIR_Z  = VEC(0, 0, 1)
# 
# ENCODING_FS      = 'utf8'


# Path: Acis.py
import traceback, Part, Draft, os, FreeCAD, re
from importerUtils              import *
from FreeCAD                    import Vector as VEC, Rotation as ROT, Placement as PLC, Matrix as MAT, Base
from math                       import pi, fabs, degrees, asin, sin, cos, tan, atan2, ceil, e, cosh, sinh, tanh, acos, acosh, asin, asinh, atan, atanh, log, sqrt, exp, log10
from importerConstants          import MIN_0, MIN_PI, MIN_PI2, MIN_INF, MAX_2PI, MAX_PI, MAX_PI2, MAX_INF, MAX_LEN
from importerConstants          import CENTER, DIR_X, DIR_Y, DIR_Z, ENCODING_FS

def getParameterization(pts, fac, closed):
        # Computes a knot Sequence for a set of points
        # fac (0-1) : parameterization factor
        #     0 -> Uniform
        #     0.5 -> Centripetal
        #     1.0 -> Chord-Length
        if closed: # we need to add the first point as the end point
            pts.append(pts[0])
        params = [0]
        for i in range(1, len(pts)):
            p = pts[i].sub(pts[i-1])
            pl = pow(p.Length, fac) # parametrization -> Chord-Length
            params.append(params[-1] + pl)
        return params

class BDY_GEOM(object):
	def __init__(self, svId):
		self.svId  = svId
		self.shape = None
		self.__ready_to_build__ = True  # Don't try to create me more than once
	def build(self):
		if (self.__ready_to_build__):
			self.__ready_to_build__ = False
			self.buildCurve()
		return self.shape
class BDY_GEOM_CIRCLE(BDY_GEOM):
	def __init__(self):
		super(BDY_GEOM_CIRCLE, self).__init__('circle')
		self.curve      = None
		self.twist      = (None, None)

		self.parameters = (MIN_0, MAX_2PI)
