def makePoint(x,y,z=0):
	global xmin
	global xmax
	global ymin
	global ymax
	global doodadCenter
	global tosel
	global seltopsonly
	global face

	amtx = x
	amty = y
	thepoint = (((((xmin - xmax)*amtx + xmax) - ((ymin - ymax)*amty + ymax))*.5 + ((ymin - ymax)*amty + ymax)) - doodadCenter)*2 + doodadCenter
	thepoint = thepoint + z*Vector(face.no)
	tver = Vert(thepoint[0],thepoint[1],thepoint[2])
	if tosel == 1 and seltopsonly == 0 and z == 0:
		tver.sel = 1
	return tver
def extrudedoodad(vArray,heig):
	global face
	global doodadMesh
	global tosel
	
	topVArray = []
	
	doodadMesh.verts.extend(vArray)
	
	#Create array for extruded verts
	for ind in range(0,(len(vArray))):
		point = vArray[ind].co + heig*Vector(face.no)
		ver = Vert(point[0],point[1],point[2])
		if tosel == 1:
			ver.sel = 1
		topVArray.append(ver)
		doodadMesh.verts.append(topVArray[ind])
	
	#make faces around sides
	for ind in range(0,(len(vArray) - 1)):
		face = Face()
		face.v.extend([vArray[ind],vArray[ind+1],topVArray[ind+1],topVArray[ind]])
		if tosel == 1 and seltopsonly == 0: face.sel = 1
		if thereAreMats == 1:
			if reassignMats == 0 or doodSideMat == 0:
				face.materialIndex = currmat
			else:
				face.materialIndex = doodSideMat-1
		doodadMesh.faces.append(face)
	face = Face()
	face.v.extend([vArray[len(vArray) - 1],vArray[0],topVArray[0],topVArray[len(topVArray) - 1]])
	if tosel == 1 and seltopsonly == 0: 
		face.sel = 1
	if thereAreMats == 1:
		if reassignMats == 0 or doodSideMat == 0:
			face.materialIndex = currmat
		else:
			face.materialIndex = doodSideMat-1
	doodadMesh.faces.append(face)
	
	return topVArray