from math import pi as _pi, sqrt as _sqrt
from geometry.coord import coord2

DEG2RAD = _pi/180.0
RAD2DEG = 180.0/_pi

#----------------------------------------------------------------------------
#Some global constants
#----------------------------------------------------------------------------
TEXT_ALIGN_LEFT = 0
TEXT_ALIGN_CENTER = 1
TEXT_ALIGN_RIGHT = 2
TEXT_ALIGNS_HORIZONTAL = [TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT]


TEXT_ALIGN_TOP = 0
TEXT_ALIGN_MIDDLE = 1
TEXT_ALIGN_BOTTOM = 2
TEXT_ALIGNS_VERTICAL = [TEXT_ALIGN_TOP, TEXT_ALIGN_MIDDLE, TEXT_ALIGN_BOTTOM]

TEXT_STYLE_POLYGONS = 1
TEXT_STYLE_LABELS = 2

PATH_TYPE_NORMAL = 0
PATH_TYPE_ROUNDED = 1
PATH_TYPE_EXTENDED = 2
PATH_TYPES = [PATH_TYPE_NORMAL, PATH_TYPE_ROUNDED, PATH_TYPE_EXTENDED]

GDSII_MAX_COORDINATES = 200

NORTH = coord2(0.0, 1.0)
SOUTH = coord2(0.0, -1.0)
EAST = coord2(1.0, 0.0)
WEST = coord2(-1.0, 0.0)

_sqrt2_2 = _sqrt(0.5)
NORTHEAST = coord2( _sqrt2_2,_sqrt2_2,)
NORTHWEST = coord2( - _sqrt2_2,_sqrt2_2,)
SOUTHEAST = coord2( _sqrt2_2, - _sqrt2_2,)
SOUTHWEST = coord2( - _sqrt2_2,- _sqrt2_2,)

	
