# 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
from varmain .capsub .cpc_pl import *#line:13
if not os .path .dirname (os .path .abspath (__file__ ))in sys .path :#line:18
			   sys .path .append (os .path .dirname (os .path .abspath (__file__ )))#line:19
from AX_BOXF import *#line:22
@activate (Group ="Wye",TooltipShort ="REDUCER Y",TooltipLong ="REDUCER Y",LengthUnit ="mm",Ports ="3")#line:25
@group ("MainDimensions")#line:26
@param (OD1 =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:27
@param (OD2 =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:28
def AX_P1_REDUCER_Y (O0OO0OO0000O0O000 ,OD1 =76 ,OD2 =40 ,**OO00O0OO0O0OO0O0O ):#line:31
	if OD1 ==76.0 and OD2 ==40.0 :#line:33
	    OOO00O00OO00O00O0 =220.0 #line:34
	    OO0O0000000O00O00 =366.0 #line:35
	    O0O000OO0O0O0OOO0 =230.0 #line:36
	    OO0O000O00OOO0O0O =106.0 #line:37
	elif OD1 ==76.0 and OD2 ==50.0 :#line:38
	    OOO00O00OO00O00O0 =259.0 #line:39
	    OO0O0000000O00O00 =366.0 #line:40
	    O0O000OO0O0O0OOO0 =280.0 #line:41
	    OO0O000O00OOO0O0O =106.0 #line:42
	elif OD1 ==76.0 and OD2 ==63.0 :#line:43
	    OOO00O00OO00O00O0 =262.0 #line:44
	    OO0O0000000O00O00 =366.0 #line:45
	    O0O000OO0O0O0OOO0 =280.0 #line:46
	    OO0O000O00OOO0O0O =106.0 #line:47
	elif OD1 ==100.0 and OD2 ==63.0 :#line:48
	    OOO00O00OO00O00O0 =276.0 #line:49
	    OO0O0000000O00O00 =396.0 #line:50
	    O0O000OO0O0O0OOO0 =280.0 #line:51
	    OO0O000O00OOO0O0O =116.0 #line:52
	elif OD1 ==100.0 and OD2 ==76.0 :#line:53
	    OOO00O00OO00O00O0 =281.0 #line:54
	    OO0O0000000O00O00 =396.0 #line:55
	    O0O000OO0O0O0OOO0 =280.0 #line:56
	    OO0O000O00OOO0O0O =116.0 #line:57
	elif OD1 ==168.0 and OD2 ==100.0 :#line:58
	    OOO00O00OO00O00O0 =359.0 #line:59
	    OO0O0000000O00O00 =392.0 #line:60
	    O0O000OO0O0O0OOO0 =330.0 #line:61
	    OO0O000O00OOO0O0O =86.0 #line:62
	O0OO0OO0OOO00OOOO =(OD1 /2.0 )+2 #line:65
	O0OO000OO00000OO0 =(OD2 /1.8 )+2 #line:66
	OO00OO0OOO00OO0OO =34.90 #line:67
	OO000O0OO00OOOO0O =(OD1 /2.0 )+1 #line:69
	O0OOOOO000O0O0O00 =CYLINDER (O0OO0OO0000O0O000 ,R =OD1 /2.0 ,H =OO0O0000000O00O00 ).rotateY (90 ).translate ((-OO0O0000000O00O00 /2.0 ,0 ,0 ))#line:71
	OO00OO0O000OOO0O0 =CYLINDER (O0OO0OO0000O0O000 ,R =O0OO0OO0OOO00OOOO ,H =OO0O0000000O00O00 *0.40 ).rotateY (90 ).translate ((-(OO0O0000000O00O00 *0.40 )/2.0 ,0 ,0 ))#line:72
	OOOO0OOOO00O000OO =TORUS (O0OO0OO0000O0O000 ,R1 =OO000O0OO00OOOO0O -2.0 ,R2 =4.0 ).rotateY (90 ).translate (((OO0O0000000O00O00 /2.0 )-OO00OO0OOO00OO0OO ,0 ,0 ))#line:74
	OOO0000O000O0O00O =TORUS (O0OO0OO0000O0O000 ,R1 =OO000O0OO00OOOO0O -2.0 ,R2 =4.0 ).rotateY (90 ).translate ((-(OO0O0000000O00O00 /2.0 )+OO00OO0OOO00OO0OO ,0 ,0 ))#line:75
	OOOO0OO0OOOOOOOOO =CYLINDER (O0OO0OO0000O0O000 ,R =OD2 /2.0 ,H =O0O000OO0O0O0OOO0 ).rotateY (-90 )#line:77
	O0000000O0000OOO0 =CYLINDER (O0OO0OO0000O0O000 ,R =O0OO000OO00000OO0 ,H =O0O000OO0O0O0OOO0 *0.50 ).rotateY (-90 )#line:78
	OO0000O0OOOO0OOO0 =CPC (O0OO0OO0000O0O000 ,D =O0OO000OO00000OO0 *2.0 ,L =O0O000OO0O0O0OOO0 *0.05 ,L1 =10 ,DISP =0 ,OF =-1.0 ).rotateY (180 ).translate ((-O0O000OO0O0O0OOO0 *0.50 ,0 ,0 ))#line:79
	for OOOOO0OO000000OO0 in [O0000000O0000OOO0 ,OO0000O0OOOO0OOO0 ]:#line:80
	    OOOO0OO0OOOOOOOOO .uniteWith (OOOOO0OO000000OO0 )#line:81
	    OOOOO0OO000000OO0 .erase ()#line:82
	OOOO0OO0OOOOOOOOO .rotateY (45 ).translate (((OO0O0000000O00O00 /2.0 )-OO0O000O00OOO0O0O ,0 ,0 ))#line:83
	for OOOOO0OO000000OO0 in [OO00OO0O000OOO0O0 ,OOOO0OOOO00O000OO ,OOO0000O000O0O00O ,OOOO0OO0OOOOOOOOO ]:#line:85
	    O0OOOOO000O0O0O00 .uniteWith (OOOOO0OO000000OO0 )#line:86
	    OOOOO0OO000000OO0 .erase ()#line:87
	O00O000OO00O000O0 =CYLINDER (O0OO0OO0000O0O000 ,R =(OD1 /2.0 )-2 ,H =OO0O0000000O00O00 ).rotateY (90 ).translate ((-OO0O0000000O00O00 /2.0 ,0 ,0 ))#line:89
	OO0O000000O0OOOOO =CYLINDER (O0OO0OO0000O0O000 ,R =(OD2 /2.0 )-2 ,H =O0O000OO0O0O0OOO0 ).rotateY (-45 ).translate (((OO0O0000000O00O00 /2.0 )-OO0O000O00OOO0O0O ,0 ,0 ))#line:90
	for OOOOO0OO000000OO0 in [O00O000OO00O000O0 ,OO0O000000O0OOOOO ]:#line:91
		O0OOOOO000O0O0O00 .subtractFrom (OOOOO0OO000000OO0 )#line:92
		OOOOO0OO000000OO0 .erase ()#line:93
	O0O00O0OO00OO0OO0 =45 #line:108
	OOO0O000O000OO0OO =math .radians (O0O00O0OO00OO0OO0 )#line:109
	O000O0O0OOO00OO00 =O0O000OO0O0O0OOO0 #line:110
	O00OO0OOOOOOO0000 =O000O0O0OOO00OO00 *math .sin (OOO0O000O000OO0OO )#line:111
	OOO00OO0OOOO00O00 =math .sqrt (O000O0O0OOO00OO00 **2 -O00OO0OOOOOOO0000 **2 )#line:112
	O0OO0OO0000O0O000 .setPoint ((-(OO0O0000000O00O00 /2.0 ),0 ,0 ),(-1 ,0 ,0 ))#line:115
	O0OO0OO0000O0O000 .setPoint (((OO0O0000000O00O00 /2.0 ),0 ,0 ),(1 ,0 ,0 ))#line:116
	O0OO0OO0000O0O000 .setPoint (((OO0O0000000O00O00 /2.0 )-OO0O000O00OOO0O0O -OOO00OO0OOOO00O00 ,0 ,O00OO0OOOOOOO0000 ),(-1 ,0 ,1 ))#line:117
