# Path: importerUtils.py
# def isEqual(a, b, e = 0.0001):
# 	if (a is None): return isEqual(b, CENTER)
# 	if (b is None): return isEqual(a, CENTER)
# 	return ((a - b).Length < e)
# 
# def getDumpFolder():
# 	global _dump_folder
# 	return _dump_folder
# 
# Path: importerUtils.py
# def logInfo(msg, *args):
# 	if (__prmPrefOW__.GetBool("checkLogging", False)): _log("logInfo",    Console.PrintMessage, msg, args)
# 
# def logWarning(msg, *args):
# 	if (__prmPrefOW__.GetBool("checkWarning", False)): _log("logWarning", Console.PrintWarning, msg, args)
# 
# def logError(msg, *args):
# 	if (__prmPrefOW__.GetBool("checkError", True)):    _log("logError",   Console.PrintError,   msg, args)
# 
# def logAlways(msg, *args):
# 	_log("logAlways", Console.PrintMessage, msg, args)
# 
# def isEqual1D(a, b, e = 0.0001):
# 	if (a is None): return isEqual1D(b, 0.0)
# 	if (b is None): return isEqual1D(a, 0.0)
# 	return abs(a - b) < e
# 
# def getAuthor():
# 	return _author
# 
# def getDescription():
# 	return _description
# 
# def getColorDefault():
# 	global _colorDefault
# 	return _colorDefault
# 
# 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'


from datetime          import datetime
from importerUtils     import isEqual, getDumpFolder
from FreeCAD           import Vector as VEC, Placement as PLC
from importerUtils     import logInfo, logWarning, logError, logAlways, isEqual1D, getAuthor, getDescription, getColorDefault
from importerConstants import CENTER, DIR_X, DIR_Y, DIR_Z, ENCODING_FS
import traceback, inspect, os, sys, Acis, math, re, Part, io

	curve    = _createCurve(acisEdge.getCurve())
	if (curve is not None):
		oe = ORIENTED_EDGE((acisCoEdge.sense == 'forward'))
		p1      = _createVertexPoint(acisEdge.getStart())
		p2      = _createVertexPoint(acisEdge.getEnd())
		e       = _createEdgeCurve(p1, p2, curve, (acisEdge.sense == 'forward'))
		oe.edge = e
		return oe
	return None

def _createBoundaries(acisLoops):
	boundaries = []
	isouter = True
	for acisLoop in acisLoops:
		coedges = acisLoop.getCoEdges()
		edges = []
		for index in coedges:
			acisCoEdge = coedges[index]
			edge = _createCoEdge(acisCoEdge)
			if (edge is not None):
				edges.append(edge)
		if (len(edges) > 0):
			face = FACE_BOUND('', True)
			loop = EDGE_LOOP('', edges)
			face.wire = loop
			boundaries.append(face)
	return boundaries

def _calculateRef(axis):
	if (isEqual1D(axis.x, 1.0)):  return DIR_Y

# Path: importerUtils.py
# def isEqual(a, b, e = 0.0001):
# 	if (a is None): return isEqual(b, CENTER)
# 	if (b is None): return isEqual(a, CENTER)
# 	return ((a - b).Length < e)
# 
# def getDumpFolder():
# 	global _dump_folder
# 	return _dump_folder
# 
# Path: importerUtils.py
# def logInfo(msg, *args):
# 	if (__prmPrefOW__.GetBool("checkLogging", False)): _log("logInfo",    Console.PrintMessage, msg, args)
# 
# def logWarning(msg, *args):
# 	if (__prmPrefOW__.GetBool("checkWarning", False)): _log("logWarning", Console.PrintWarning, msg, args)
# 
# def logError(msg, *args):
# 	if (__prmPrefOW__.GetBool("checkError", True)):    _log("logError",   Console.PrintError,   msg, args)
# 
# def logAlways(msg, *args):
# 	_log("logAlways", Console.PrintMessage, msg, args)
# 
# def isEqual1D(a, b, e = 0.0001):
# 	if (a is None): return isEqual1D(b, 0.0)
# 	if (b is None): return isEqual1D(a, 0.0)
# 	return abs(a - b) < e
# 
# def getAuthor():
# 	return _author
# 
# def getDescription():
# 	return _description
# 
# def getColorDefault():
# 	global _colorDefault
# 	return _colorDefault
# 
# 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: Acis2Step.py
from datetime          import datetime
from importerUtils     import isEqual, getDumpFolder
from FreeCAD           import Vector as VEC, Placement as PLC
from importerUtils     import logInfo, logWarning, logError, logAlways, isEqual1D, getAuthor, getDescription, getColorDefault
from importerConstants import CENTER, DIR_X, DIR_Y, DIR_Z, ENCODING_FS
import traceback, inspect, os, sys, Acis, math, re, Part, io

	curve    = _createCurve(acisEdge.getCurve())
	if (curve is not None):
		oe = ORIENTED_EDGE((acisCoEdge.sense == 'forward'))
		p1      = _createVertexPoint(acisEdge.getStart())
		p2      = _createVertexPoint(acisEdge.getEnd())
		e       = _createEdgeCurve(p1, p2, curve, (acisEdge.sense == 'forward'))
		oe.edge = e
		return oe
	return None

def _createBoundaries(acisLoops):
	boundaries = []
	isouter = True
	for acisLoop in acisLoops:
		coedges = acisLoop.getCoEdges()
		edges = []
		for index in coedges:
			acisCoEdge = coedges[index]
			edge = _createCoEdge(acisCoEdge)
			if (edge is not None):
				edges.append(edge)
		if (len(edges) > 0):
			face = FACE_BOUND('', True)
			loop = EDGE_LOOP('', edges)
			face.wire = loop
			boundaries.append(face)
	return boundaries

def _calculateRef(axis):
	if (isEqual1D(axis.x, 1.0)):  return DIR_Y

	if (isEqual1D(axis.x, -1.0)): return -DIR_Y
