# 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 ="Wye",TooltipShort ="EQUAL Y",TooltipLong ="EQUAL Y",LengthUnit ="mm",Ports ="3")#line:24
@group ("MainDimensions")#line:25
@param (OD =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:26
def AX_P1_EQUAL_Y (OO0OO00O0O00000OO ,OD =63 ,**O0OO0O0O00O000000 ):#line:29
	if OD ==63.0 :#line:31
	    OD =63.0 #line:32
	    O00000O0O000O0O00 =257.0 #line:33
	    O0OOO0O0O0O0O0O0O =432.0 #line:34
	    O0O0000OOOO00OOO0 =280.0 #line:35
	    OO0000OOO0O0OOOOO =152.0 #line:36
	elif OD ==76.0 :#line:37
	    OD =76.0 #line:38
	    O00000O0O000O0O00 =254.0 #line:39
	    O0OOO0O0O0O0O0O0O =366.0 #line:40
	    O0O0000OOOO00OOO0 =260.0 #line:41
	    OO0000OOO0O0OOOOO =106.0 #line:42
	elif OD ==100.0 :#line:43
	    OD =100.0 #line:44
	    O00000O0O000O0O00 =290.0 #line:45
	    O0OOO0O0O0O0O0O0O =396.0 #line:46
	    O0O0000OOOO00OOO0 =280.0 #line:47
	    OO0000OOO0O0OOOOO =116.0 #line:48
	elif OD ==168.0 :#line:49
	    OD =168.0 #line:50
	    O00000O0O000O0O00 =401.0 #line:51
	    O0OOO0O0O0O0O0O0O =476.0 #line:52
	    O0O0000OOOO00OOO0 =350.0 #line:53
	    OO0000OOO0O0OOOOO =126.0 #line:54
	O000O00O0OOOOOOO0 =(OD /2.0 )+2 #line:56
	OO0OOO0O0OOOO0O00 =34.90 #line:57
	OO0OOO0O0O00O0O0O =(OD /2.0 )+1 #line:59
	O000OOOOOO00OOO00 =CYLINDER (OO0OO00O0O00000OO ,R =OD /2.0 ,H =O0OOO0O0O0O0O0O0O ).rotateY (90 ).translate ((-O0OOO0O0O0O0O0O0O /2.0 ,0 ,0 ))#line:61
	O0OO0OO000O000OOO =CYLINDER (OO0OO00O0O00000OO ,R =O000O00O0OOOOOOO0 ,H =O0OOO0O0O0O0O0O0O *0.40 ).rotateY (90 ).translate ((-(O0OOO0O0O0O0O0O0O *0.40 )/2.0 ,0 ,0 ))#line:62
	O0OO0O0O00O0O0OOO =TORUS (OO0OO00O0O00000OO ,R1 =OO0OOO0O0O00O0O0O -2.0 ,R2 =4.0 ).rotateY (90 ).translate (((O0OOO0O0O0O0O0O0O /2.0 )-OO0OOO0O0OOOO0O00 ,0 ,0 ))#line:64
	OOO0O00OOOO0OO0OO =TORUS (OO0OO00O0O00000OO ,R1 =OO0OOO0O0O00O0O0O -2.0 ,R2 =4.0 ).rotateY (90 ).translate ((-(O0OOO0O0O0O0O0O0O /2.0 )+OO0OOO0O0OOOO0O00 ,0 ,0 ))#line:65
	O000O0OOOOO0O0O0O =CYLINDER (OO0OO00O0O00000OO ,R =OD /2.0 ,H =O0O0000OOOO00OOO0 ).rotateY (-90 )#line:67
	OOOOOOO00O0OO00OO =CYLINDER (OO0OO00O0O00000OO ,R =O000O00O0OOOOOOO0 ,H =O0O0000OOOO00OOO0 *0.40 ).rotateY (-90 )#line:68
	O0OOO0000O00O0O0O =TORUS (OO0OO00O0O00000OO ,R1 =OO0OOO0O0O00O0O0O -2.0 ,R2 =4.0 ).rotateY (-90 ).translate ((-O0O0000OOOO00OOO0 +OO0OOO0O0OOOO0O00 ,0 ,0 ))#line:69
	for O0000O0O000OO0O00 in [OOOOOOO00O0OO00OO ,O0OOO0000O00O0O0O ]:#line:70
	    O000O0OOOOO0O0O0O .uniteWith (O0000O0O000OO0O00 )#line:71
	    O0000O0O000OO0O00 .erase ()#line:72
	O000O0OOOOO0O0O0O .rotateY (45 ).translate (((O0OOO0O0O0O0O0O0O /2.0 )-OO0000OOO0O0OOOOO ,0 ,0 ))#line:73
	for O0000O0O000OO0O00 in [O0OO0OO000O000OOO ,O0OO0O0O00O0O0OOO ,OOO0O00OOOO0OO0OO ,O000O0OOOOO0O0O0O ]:#line:75
	    O000OOOOOO00OOO00 .uniteWith (O0000O0O000OO0O00 )#line:76
	    O0000O0O000OO0O00 .erase ()#line:77
	OO000OOOOO000O0OO =CYLINDER (OO0OO00O0O00000OO ,R =(OD /2.0 )-2 ,H =O0OOO0O0O0O0O0O0O ).rotateY (90 ).translate ((-O0OOO0O0O0O0O0O0O /2.0 ,0 ,0 ))#line:79
	O00O0OO00O00O000O =CYLINDER (OO0OO00O0O00000OO ,R =(OD /2.0 )-2 ,H =O0O0000OOOO00OOO0 ).rotateY (-45 ).translate (((O0OOO0O0O0O0O0O0O /2.0 )-OO0000OOO0O0OOOOO ,0 ,0 ))#line:80
	for O0000O0O000OO0O00 in [OO000OOOOO000O0OO ,O00O0OO00O00O000O ]:#line:81
		O000OOOOOO00OOO00 .subtractFrom (O0000O0O000OO0O00 )#line:82
		O0000O0O000OO0O00 .erase ()#line:83
	O0O0O0O0OOOO0O00O =45 #line:93
	OO000OO0O0O000OO0 =math .radians (O0O0O0O0OOOO0O00O )#line:94
	OOOOO0O00OOO00O00 =O0O0000OOOO00OOO0 #line:95
	O00OOO00OOOO0O0O0 =OOOOO0O00OOO00O00 *math .sin (OO000OO0O0O000OO0 )#line:96
	O0OOOOO0O0OOOOO00 =math .sqrt (OOOOO0O00OOO00O00 **2 -O00OOO00OOOO0O0O0 **2 )#line:97
	OO0OO00O0O00000OO .setPoint ((-(O0OOO0O0O0O0O0O0O /2.0 ),0 ,0 ),(-1 ,0 ,0 ))#line:100
	OO0OO00O0O00000OO .setPoint ((-(O0OOO0O0O0O0O0O0O /2.0 )+O0O0000OOOO00OOO0 -O0OOOOO0O0OOOOO00 ,0 ,O00OOO00OOOO0O0O0 ),(-1 ,0 ,1 ))#line:101
	OO0OO00O0O00000OO .setPoint (((O0OOO0O0O0O0O0O0O /2.0 ),0 ,0 ),(1 ,0 ,0 ))#line:102
