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
 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

			e31, i = getBoolean(chunks, i)
			f32, i = getFloat(chunks, i)
			i33, i = getInteger(chunks, i)
			if (getVersion() > 225) and isASM():
				i34, i = getEnumByTag(chunks, i, [])
			f34, i = getFloat(chunks, i)
			self.curve = CurveInt()
			i = self.curve.setSubtype(chunks, i)
			v11, i = getVector(chunks, i)
			v12, i = getVector(chunks, i)
			v13, i = getVector(chunks, i)
			v14, i = getVector(chunks, i)
			f15, i = getFloat(chunks, i)
			e21, i = getBoolean(chunks, i)
			e22, i = getBoolean(chunks, i)
			e23, i = getBoolean(chunks, i)
			t2, i  = getInteger(chunks, i)
			if (t2 > 0):
				a1, i = getFloats(chunks, i, 3*t2)
				a1 = reshape(a1, 3)
		elif (t1 == 6):
			v11, i = getVector(chunks, i)
			v12, i = getVector(chunks, i)
			v13, i = getVector(chunks, i)
			v14, i = getVector(chunks, i)
			t2,  i = getFloat(chunks, i)
			b1,  i = getBoolean(chunks, i)
			b2,  i = getBoolean(chunks, i)
			b3,  i = getBoolean(chunks, i)
			t2,  i = getInteger(chunks, i)
			srf, i = readSurface(chunks, i)
			v14, i = getLong(chunks, i) # 0
			b4,  i = getBoolean(chunks, i) # F
			v15, i = getFloat(chunks, i)
			if (getVersion() > 225) and isASM():
				v16, i = getLong(chunks, i)
			v17, i = getFloat(chunks, i)
			d17 = CurveInt()
			i = d17.setSubtype(chunks, i)
			d18, i = getVector(chunks,i )
			d19, i = getVector(chunks,i )
			d20, i = getVector(chunks,i )
			d21, i = getVector(chunks,i )
			d22, i = getFloat(chunks, i)
			d23, i = getBoolean(chunks, i)
			d24, i = getBoolean(chunks, i)
			d25, i = getBoolean(chunks, i)
			d26, i = getVector(chunks,i )
			d27, i = getVector(chunks,i )
			d28, i = getVector(chunks,i )
			d29, i = getVector(chunks,i )
			d30, i = getFloat(chunks, i)
			d31, i = getBoolean(chunks, i)
			d32, i = getBoolean(chunks, i)
			d33, i = getBoolean(chunks, i)
			d34, i = getLong(chunks, i)
		elif (t1 == 8):
			v11, i = getVector(chunks, i)
			v12, i = getVector(chunks, i)
			v13, i = getVector(chunks, i)
			v14, i = getVector(chunks, i)
			t2, i  = getInteger(chunks, i) # 0
		else:
			raise TypeError("Unknown defm_sur_spl type %d" %(t1))
		i = self.setSurfaceShape(chunks, i, inventor, 'defm_spl_sur')
		return i
	def setExact(self, chunks, index, inventor):
		i = self.setSurfaceShape(chunks, index, inventor, 'exact_spl_sur')
		if (getVersion() > 2.0):
			rU, i = getInterval(chunks, i, MIN_INF, MAX_INF, getScale())
			rV, i = getInterval(chunks, i, MIN_INF, MAX_INF, getScale())
			if (inventor):
				ft, i = getInteger(chunks, i)
		return i
	def setG2Blend(self, chunks, index, inventor):
		t11, i = getValue(chunks, index)
		while (not isString(t11)):
			t11, i = getValue(chunks, i)
		s11, i = readSurface(chunks, i)
		c11, i = readCurve(chunks, i)
		p11, i = readBS2Curve(chunks, i)
		v11, i = getVector(chunks, i)
		p12, i = readBS2Curve(chunks, i)
		singularity, i = getSingularity(chunks, i)
		if (singularity == 'full'):
			s12, i = readBS3Surface(chunks, i)
			if (s12):
				tol11, i = getLength(chunks, i)
		elif (singularity == 'none'):
			s12, i = getFloats(chunks, i, 9)
			tol11, i = getLength(chunks, i)
			if (not chunks[i].tag in [TAG_UTF8_U8, TAG_IDENT, TAG_SUBIDENT]):
				i += 1 # newer Inventor versions (>2017
			p13, i = readBS2Curve(chunks, i)
		else:
			raise AssertionError("wrong singularity %s" %(singularity))

		t21, i = getValue(chunks, i)
		s21, i = readSurface(chunks, i)
		c21, i = readCurve(chunks, i)
		p21, i = readBS2Curve(chunks, i)
		v21, i = getVector(chunks, i)
		p22, i = readBS2Curve(chunks, i)
		s22, tol21, i = readSplineSurface(chunks, i, True)

		c1, i = readCurve(chunks, i)
		a1, i = getFloats(chunks, i, 2)
		l1, i = getLong(chunks, i) # non_
		rU, i = getInterval(chunks, i, MIN_INF, MAX_INF, 1.0)
		rV, i = getInterval(chunks, i, MIN_INF, MAX_INF, 1.0)
		a1, i = getFloats(chunks, i, 4)# 1, 0.05, 1e-4, 1
		i = self.setSurfaceShape(chunks, i, inventor, 'g2_blend_spl_sur')
		if (inventor):
			# Discontinuity-Info
			di1, i = getFloatArray(chunks, i)
			di2, i = getFloatArray(chunks, i)
			di3, i = getFloatArray(chunks, i)
		return i
	def setHelixCircle(self, chunks, index, inventor):
		self.subtype = 'helix_spl_circ'

		angle, i  = getInterval(chunks, index, MIN_PI, MAX_PI, 1.0)
