# By Axelerator AB All rights reserved
# Author Marcus Isaksson
from varmain .primitiv import *#line:5
from varmain .custom import *#line:6
from varmain .var_basic import *#line:7
from varmain .dummy_var import *#line:8
from aqa .math import *#line:9
import math #line:10
import sys ,os #line:11
if not os .path .dirname (os .path .abspath (__file__ ))in sys .path :#line:17
			   sys .path .append (os .path .dirname (os .path .abspath (__file__ )))#line:18
from AX_BOXF import *#line:21
@activate (Group ="Tee,Lateral",TooltipShort ="Equal Tee",TooltipLong ="Equal Tee",LengthUnit ="mm",Ports ="3")#line:24
@group ("MainDimensions")#line:25
@param (DN =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:26
@param (CT =LENGTH ,TooltipShort ="Connection Type",TooltipLong ="Connection Type")#line:29
def AX_P1_EQUAL_TEE (OO0O0OO0OO0O00000 ,DN =16.5 ,CT =0 ,**O0000000OOOOOOOOO ):#line:37
	if DN ==16.5 :#line:40
		OO0OOO0O00O0O0OO0 =16.5 #line:41
		OOO000O0O0OOO0O0O =34.0 #line:42
		OO0OOOO0O0OOOO0O0 =58.0 #line:43
		OO0O0O000000O00O0 =120.5 #line:44
		OO000OO0O00O0O000 =34.0 #line:45
		OOO0OOOOO0OO00O00 =31.0 #line:46
	elif DN ==25 :#line:47
		OO0OOO0O00O0O0OO0 =25.0 #line:48
		OOO000O0O0OOO0O0O =44.5 #line:49
		OO0OOOO0O0OOOO0O0 =67.0 #line:50
		OO0O0O000000O00O0 =151.0 #line:51
		OO000OO0O00O0O000 =48.0 #line:52
		OOO0OOOOO0OO00O00 =40.0 #line:53
	elif DN ==40 :#line:54
		OO0OOO0O00O0O0OO0 =40.0 #line:55
		OOO000O0O0OOO0O0O =67.0 #line:56
		OO0OOOO0O0OOOO0O0 =102.0 #line:57
		OO0O0O000000O00O0 =205.0 #line:58
		OO000OO0O00O0O000 =57.0 #line:59
		OOO0OOOOO0OO00O00 =57.0 #line:60
	elif DN ==50 :#line:61
		OO0OOO0O00O0O0OO0 =50.0 #line:62
		OOO000O0O0OOO0O0O =80.0 #line:63
		OO0OOOO0O0OOOO0O0 =156.0 #line:64
		OO0O0O000000O00O0 =231.0 #line:65
		OO000OO0O00O0O000 =56.0 #line:66
		OOO0OOOOO0OO00O00 =56.0 #line:67
	elif DN ==63 :#line:68
		OO0OOO0O00O0O0OO0 =63.0 #line:69
		OOO000O0O0OOO0O0O =91.0 #line:70
		OO0OOOO0O0OOOO0O0 =170.0 #line:71
		OO0O0O000000O00O0 =249.0 #line:72
		OO000OO0O00O0O000 =61.0 #line:73
		OOO0OOOOO0OO00O00 =61.0 #line:74
	elif DN ==76 :#line:76
		OO0OOO0O00O0O0OO0 =76.0 #line:77
		OO0O0O000000O00O0 =292.0 #line:78
		OO000OO0O00O0O000 =146.0 #line:79
		OOO0OOOOO0OO00O00 =146.0 #line:80
	elif DN ==100 :#line:81
		OO0OOO0O00O0O0OO0 =100.0 #line:82
		OO0O0O000000O00O0 =312.0 #line:83
		OO000OO0O00O0O000 =156.0 #line:84
		OOO0OOOOO0OO00O00 =136.0 #line:85
	elif DN ==168 :#line:86
		OO0OOO0O00O0O0OO0 =168.0 #line:87
		OO0O0O000000O00O0 =360.0 #line:88
		OO000OO0O00O0O000 =180.0 #line:89
		OOO0OOOOO0OO00O00 =185.0 #line:90
	if DN <76 :#line:92
		OOOOO00OOOO00OO0O =(OO0OOO0O00O0O0OO0 /2.0 )+2.0 #line:94
		OOO00O0000OO0OOOO =(OO0OOO0O00O0O0OO0 /2.0 )*1.1 #line:95
		OOO00OO0O0OOOO000 =((OO0O0O000000O00O0 /2.0 )-OO000OO0O00O0O000 )*1.2 #line:96
		O0000000O00O0000O =(OO000OO0O00O0O000 *2.0 )#line:97
		if 16.5 <=DN <=40 :#line:99
			O000OO0OO0OO0OOOO =OO0OOOO0O0OOOO0O0 #line:100
		if 50 <=DN <=63 :#line:101
			O000OO0OO0OO0OOOO =OO0OOOO0O0OOOO0O0 -(OOO000O0O0OOO0O0O /2.0 )#line:102
		O0OO00OO00O0000OO =CYLINDER (OO0O0OO0OO0O00000 ,R =OOO00O0000OO0OOOO *1.1 ,H =O0000000O00O0000O ).rotateY (90 ).translate ((-O0000000O00O0000O /2.0 ,0 ,0 ))#line:104
		O00000000OOOO00OO =CYLINDER (OO0O0OO0OO0O00000 ,R =OOO00O0000OO0OOOO *1.1 ,H =OOO0OOOOO0OO00O00 ).rotateX (90 )#line:105
		O0OO00OO00O0000OO .uniteWith (O00000000OOOO00OO )#line:106
		O00000000OOOO00OO .erase ()#line:107
		O000OO0O00O0000OO =CONE (OO0O0OO0OO0O00000 ,R1 =OOOOO00OOOO00OO0O ,R2 =OOO000O0O0OOO0O0O /2.0 ,H =OOO00OO0O0OOOO000 *0.20 ).rotateY (-90 ).translate ((OO0O0O000000O00O0 /2.0 ,0 ,0 ))#line:111
		OO00O0O00O0O0OOO0 =CYLINDER (OO0O0OO0OO0O00000 ,R =OOO000O0O0OOO0O0O /2.0 ,H =OOO00OO0O0OOOO000 *0.70 ).rotateY (-90 ).translate (((OO0O0O000000O00O0 /2.0 )-OOO00OO0O0OOOO000 *0.20 ,0 ,0 ))#line:112
		O0O000OOOOOOOOOOO =CONE (OO0O0OO0OO0O00000 ,R1 =OOO000O0O0OOO0O0O /2.0 ,R2 =OOO00O0000OO0OOOO *1.1 ,H =OOO00OO0O0OOOO000 *0.10 ).rotateY (-90 ).translate (((OO0O0O000000O00O0 /2.0 )-OOO00OO0O0OOOO000 *0.90 ,0 ,0 ))#line:113
		for OOOO0O0OO0000O00O in [OO00O0O00O0O0OOO0 ,O0O000OOOOOOOOOOO ]:#line:114
		    O000OO0O00O0000OO .uniteWith (OOOO0O0OO0000O00O )#line:115
		    OOOO0O0OO0000O00O .erase ()#line:116
		O00OOO0O0OOO0000O =CONE (OO0O0OO0OO0O00000 ,R1 =OOOOO00OOOO00OO0O ,R2 =OOO000O0O0OOO0O0O /2.0 ,H =OOO00OO0O0OOOO000 *0.20 ).rotateY (-90 ).translate ((OO0O0O000000O00O0 /2.0 ,0 ,0 ))#line:119
		O0OO0O000O00O0000 =CYLINDER (OO0O0OO0OO0O00000 ,R =OOO000O0O0OOO0O0O /2.0 ,H =OOO00OO0O0OOOO000 *0.70 ).rotateY (-90 ).translate (((OO0O0O000000O00O0 /2.0 )-OOO00OO0O0OOOO000 *0.20 ,0 ,0 ))#line:120
		O0O0O000OO0OOOO0O =CONE (OO0O0OO0OO0O00000 ,R1 =OOO000O0O0OOO0O0O /2.0 ,R2 =OOO00O0000OO0OOOO *1.1 ,H =OOO00OO0O0OOOO000 *0.10 ).rotateY (-90 ).translate (((OO0O0O000000O00O0 /2.0 )-OOO00OO0O0OOOO000 *0.90 ,0 ,0 ))#line:121
		for OOOO0O0OO0000O00O in [O0OO0O000O00O0000 ,O0O0O000OO0OOOO0O ]:#line:122
		    O00OOO0O0OOO0000O .uniteWith (OOOO0O0OO0000O00O )#line:123
		    OOOO0O0OO0000O00O .erase ()#line:124
		O00OOO0O0OOO0000O .rotateZ (180 )#line:125
		O0O0O0OOOOOOO0OOO =CONE (OO0O0OO0OO0O00000 ,R1 =OOOOO00OOOO00OO0O ,R2 =OOO000O0O0OOO0O0O /2.0 ,H =OOO00OO0O0OOOO000 *0.20 ).rotateY (-90 ).translate ((O000OO0OO0OO0OOOO ,0 ,0 ))#line:128
		O00O00O00O0O00O00 =CYLINDER (OO0O0OO0OO0O00000 ,R =OOO000O0O0OOO0O0O /2.0 ,H =OOO00OO0O0OOOO000 *0.70 ).rotateY (-90 ).translate ((O000OO0OO0OO0OOOO -OOO00OO0O0OOOO000 *0.20 ,0 ,0 ))#line:129
		OO00O00OO0OO0O0OO =CONE (OO0O0OO0OO0O00000 ,R1 =OOO000O0O0OOO0O0O /2.0 ,R2 =OOO00O0000OO0OOOO *1.1 ,H =OOO00OO0O0OOOO000 *0.10 ).rotateY (-90 ).translate ((O000OO0OO0OO0OOOO -OOO00OO0O0OOOO000 *0.90 ,0 ,0 ))#line:130
		for OOOO0O0OO0000O00O in [O00O00O00O0O00O00 ,OO00O00OO0OO0O0OO ]:#line:131
		    O0O0O0OOOOOOO0OOO .uniteWith (OOOO0O0OO0000O00O )#line:132
		    OOOO0O0OO0000O00O .erase ()#line:133
		O0O0O0OOOOOOO0OOO .rotateZ (-90 )#line:134
		if CT ==0 :#line:136
			O0O0OO0OOOOO0000O =[O00OOO0O0OOO0000O ,O000OO0O00O0000OO ,O0O0O0OOOOOOO0OOO ]#line:137
		elif CT ==1 :#line:138
			O0O0OO0OOOOO0000O =[O000OO0O00O0000OO ,O0O0O0OOOOOOO0OOO ]#line:139
			O00OOO0O0OOO0000O .erase ()#line:140
		elif CT ==2 :#line:141
			O0O0OO0OOOOO0000O =[O00OOO0O0OOO0000O ,O0O0O0OOOOOOO0OOO ]#line:142
			O000OO0O00O0000OO .erase ()#line:143
		elif CT ==3 :#line:144
			O0O0OO0OOOOO0000O =[O00OOO0O0OOO0000O ,O000OO0O00O0000OO ]#line:145
			O0O0O0OOOOOOO0OOO .erase ()#line:146
		for OOOO0O0OO0000O00O in O0O0OO0OOOOO0000O :#line:148
		    O0OO00OO00O0000OO .uniteWith (OOOO0O0OO0000O00O )#line:149
		    OOOO0O0OO0000O00O .erase ()#line:150
		OOOOOO0O0O0OOO0OO =CYLINDER (OO0O0OO0OO0O00000 ,R =OO0OOO0O00O0O0OO0 /2.0 ,H =(OO0O0O000000O00O0 /2.0 )-OO000OO0O00O0O000 ).rotateY (90 ).translate ((OO000OO0O00O0O000 ,0 ,0 ))#line:152
		OOO00O00O00000OOO =CYLINDER (OO0O0OO0OO0O00000 ,R =OO0OOO0O00O0O0OO0 /2.0 ,H =(OO0O0O000000O00O0 /2.0 )-OO000OO0O00O0O000 ).rotateY (-90 ).translate ((-OO000OO0O00O0O000 ,0 ,0 ))#line:153
		OOOOOO000OO0OOO00 =CYLINDER (OO0O0OO0OO0O00000 ,R =OO0OOO0O00O0O0OO0 /2.0 ,H =O000OO0OO0OO0OOOO -OOO0OOOOO0OO00O00 ).rotateX (90 ).translate ((0 ,-OOO0OOOOO0OO00O00 ,0 ))#line:154
		for OOOO0O0OO0000O00O in [OOOOOO0O0O0OOO0OO ,OOO00O00O00000OOO ,OOOOOO000OO0OOO00 ]:#line:155
		    O0OO00OO00O0000OO .subtractFrom (OOOO0O0OO0000O00O )#line:156
		    OOOO0O0OO0000O00O .erase ()#line:157
		OO0O0OO0OO0O00000 .setPoint ((OO000OO0O00O0O000 ,0 ,0 ),(1 ,0 ,0 ))#line:159
		OO0O0OO0OO0O00000 .setPoint ((-OO000OO0O00O0O000 ,0 ,0 ),(-1 ,0 ,0 ))#line:160
		OO0O0OO0OO0O00000 .setPoint ((0 ,-OOO0OOOOO0OO00O00 ,0 ),(0 ,-1 ,0 ))#line:161
	elif DN >=76 :#line:164
		OOO00O0000OO0OOOO =(OO0OOO0O00O0O0OO0 /2.0 )+1.0 #line:166
		OO00O00OOOOOOO0O0 =OO0O0O000000O00O0 /2.0 -34.90 #line:167
		O00O0000O00OO0O00 =OOO0OOOOO0OO00O00 -34.90 #line:168
		O0OO00OO00O0000OO =CYLINDER (OO0O0OO0OO0O00000 ,R =OOO00O0000OO0OOOO ,H =OO0O0O000000O00O0 ).rotateY (90 ).translate ((-OO0O0O000000O00O0 /2.0 ,0 ,0 ))#line:170
		O00000000OOOO00OO =CYLINDER (OO0O0OO0OO0O00000 ,R =OOO00O0000OO0OOOO ,H =OOO0OOOOO0OO00O00 ).rotateX (90 )#line:171
		O000000OOO00O000O =TORUS (OO0O0OO0OO0O00000 ,R1 =OOO00O0000OO0OOOO -2.0 ,R2 =4.0 ).rotateY (90 ).translate ((OO00O00OOOOOOO0O0 ,0 ,0 ))#line:173
		O0O0OOOOO000O0000 =TORUS (OO0O0OO0OO0O00000 ,R1 =OOO00O0000OO0OOOO -2.0 ,R2 =4.0 ).rotateY (90 ).translate ((-OO00O00OOOOOOO0O0 ,0 ,0 ))#line:174
		OOO00OOO000000000 =TORUS (OO0O0OO0OO0O00000 ,R1 =OOO00O0000OO0OOOO -2.0 ,R2 =4.0 ).rotateY (90 ).rotateZ (90 ).translate ((0 ,-O00O0000O00OO0O00 ,0 ))#line:175
		for OOOO0O0OO0000O00O in [O00000000OOOO00OO ,O000000OOO00O000O ,O0O0OOOOO000O0000 ,OOO00OOO000000000 ]:#line:177
		    O0OO00OO00O0000OO .uniteWith (OOOO0O0OO0000O00O )#line:178
		    OOOO0O0OO0000O00O .erase ()#line:179
		O00O00OO00O0O0O0O =CYLINDER (OO0O0OO0OO0O00000 ,R =OO0OOO0O00O0O0OO0 /2.0 ,H =OO0O0O000000O00O0 ).rotateY (90 ).translate ((-OO0O0O000000O00O0 /2.0 ,0 ,0 ))#line:181
		OO0OO0O00O0O00000 =CYLINDER (OO0O0OO0OO0O00000 ,R =OO0OOO0O00O0O0OO0 /2.0 ,H =OOO0OOOOO0OO00O00 ).rotateX (90 )#line:182
		for OOOO0O0OO0000O00O in [O00O00OO00O0O0O0O ,OO0OO0O00O0O00000 ]:#line:184
		    O0OO00OO00O0000OO .subtractFrom (OOOO0O0OO0000O00O )#line:185
		    OOOO0O0OO0000O00O .erase ()#line:186
		OO0O0OO0OO0O00000 .setPoint ((OO0O0O000000O00O0 /2.0 ,0 ,0 ),(1 ,0 ,0 ))#line:190
		OO0O0OO0OO0O00000 .setPoint ((-OO0O0O000000O00O0 /2.0 ,0 ,0 ),(-1 ,0 ,0 ))#line:191
		OO0O0OO0OO0O00000 .setPoint ((0 ,-OOO0OOOOO0OO00O00 ,0 ),(0 ,-1 ,0 ))#line:192
